MAMP add virtualhosts

If you want to run your own VirtualHosts when you are using MAMP on Mac, just do the following step:

1.) Open your terminal

2.) Run: pico /Applications/MAMP/conf/apache/httpd.conf

3.) Add the following to the bottom of the file (change for your values):


NameVirtualHost *

DocumentRoot ”/Applications/MAMP/htdocs/”
ServerName localhost

DocumentRoot ”/Applications/MAMP/htdocs/YOUR-PATH”
ServerName http://www.YOUR-DOMAIN.com
ServerAlias YOUR-DOMAIN.com *.YOUR-DOMAIN.com
4.) Save

5.) Open your hosts file, ”sudo pico /etc/hosts”

6.) Add your domain and point it to your localhost (add at the bottom of the file):

127.0.0.1 http://www.YOUR-DOMAIN.com

7.) Save and your done

If you want to check your configuration, just run: apachectl configtest

Annonser

Kommentera

Fyll i dina uppgifter nedan eller klicka på en ikon för att logga in:

WordPress.com Logo

Du kommenterar med ditt WordPress.com-konto. Logga ut / Ändra )

Twitter-bild

Du kommenterar med ditt Twitter-konto. Logga ut / Ändra )

Facebook-foto

Du kommenterar med ditt Facebook-konto. Logga ut / Ändra )

Google+ photo

Du kommenterar med ditt Google+-konto. Logga ut / Ändra )

Ansluter till %s