Path to your Apache files in MAMP on OS X Open the file nf located in /Applications/MAMP/conf/apache in a text editor of your choice (either TextEdit in plain text mode, TextWrangler or BBEdit will do). The editor will overwrite the existing /etc/hosts file. Press Control-X to exit pico. When prompted to overwrite existing file, confirm with Return. When you are done editing the /etc/hosts file, press Control-O in order to output your changes to the file. Instead of localhost, localhost2, localhost3 you could actually put in the name of a project. Do not change this entry.ġ27.0.0.1 localhost localhost2 localhost3 # localhost is used to configure the loopback interface
When prompted, enter the password of your administrator account.Įdit the file in a way that you see a result like this: In order to complete the other steps you should stop your servers now. In order to manage your servers, locate a folder named MAMP in your Applications folder and double-click MAMP.app. Installing MAMP and MAMP ProĪt this point, you should have a working installation of Apache with MySQL. Unzip the packgage, double-click the installer and follow the on-screen instructions.
Today we will show you how to set up virtual hosts on MAMP.įirst, go to the official MAMP website and download your free copy of MAMP. This will work with any popular distribution including MAMP, WAMP and XAMP. Instead, you can set up virtual hosts on your existing Apache installation. Open Safari and visit to verify your configuration.In order to comfortably edit several dynamic websites in Dreamweaver at the same time you do not need several teting servers. SSLCertificateKeyFile /etc/apache2/ssl/localhost.keyįinally restart Apache using Terminal.app : sudo apachectl restart SSLCertificateFile /etc/apache2/ssl/localhost.crt SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL LoadModule ssl_module libexec/apache2/mod_ssl.soĮnable Secure (SSL/TLS) connections Include /private/etc/apache2/extra/nfĮdit the Virtual Hosts file /etc/apache2/extra/nf and add the SSL Directive at the end of the file: ĭocumentRoot "/Library/WebServer/Documents" sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain /etc/apache2/ssl/localhost.crtĮdit the Apache main configuration file /etc/apache2/nf and enable the required modules to support SSL : LoadModule socache_shmcb_module libexec/apache2/mod_socache_shmcb.so Sudo openssl x509 -req -extensions v3_req -days 365 -in /etc/apache2/ssl/localhost.csr -signkey /etc/apache2/ssl/ -out /etc/apache2/ssl/localhost.crt -extfile /etc/apache2/ssl/nfĪdd the SSL Certificate to Keychain Access. Use the Certificate Requests to sign the SSL Certificates using Terminal.app: sudo openssl x509 -req -days 365 -in /etc/apache2/server.csr -signkey /etc/apache2/server.key -out /etc/apache2/server.crt Common Name: The fully qualified domain name for your web server
Organization: he exact legal name of your organization. City or Locality: The city where your organization is legally located. State or Province: The state or province where your organization is legally located.
Country: The two-letter ISO abbreviation for your country. Note: Complete the values C= ST= L= O= CN= to reflect your own organizational structure, where: Sudo openssl req -new -key /etc/apache2/ssl/ -subj "/C=/ST=/L=/O=/CN=localhost/" -out /etc/apache2/ssl/localhost.csr -config /etc/apache2/ssl/nf Generate the required Certificate Requests using Terminal.app: sudo openssl req -new -key /etc/apache2/server.key -subj "/C=/ST=/L=/O=/CN=/emailAddress=/" -out /etc/apache2/server.csr KeyUsage = nonRepudiation, digitalSignature, keyEncipherment Sudo openssl rsa -in /etc/apache2/ssl/localhost.key -out /etc/apache2/ssl/Ĭreate a configuration file using Terminal.app: sudo touch /etc/apache2/ssl/nfĮdit the newly created configuration file and add the following: ĭistinguished_name = req_distinguished_name Sudo openssl genrsa -out /etc/apache2/ssl/localhost.key 2048 Next, generate two host keys: sudo openssl genrsa -out /etc/apache2/server.key 2048