Advertisement
Guest User

Instructions for using Virtual Hosts with MAMP

a guest
Jan 12th, 2011
980
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. # In your /Applications/MAMP/conf/apache/httpd.conf file, ensure your Directory settings are as follows:
  2. <Directory "/Applications/MAMP/htdocs">
  3. Options Indexes Includes FollowSymLinks ExecCGI
  4. AllowOverride All
  5. Order allow,deny
  6. Allow from all
  7. </Directory>
  8.  
  9. # In your httpd.conf file, add the following at the end of the file to enable/use virtual hosts:
  10.  
  11. #
  12. # MAMP Virtual Hosts
  13. #
  14. NameVirtualHost *:80
  15.  
  16. <VirtualHost _default_:80>
  17. DocumentRoot "/Applications/MAMP/htdocs"
  18. </VirtualHost>
  19.  
  20. <VirtualHost *:80>
  21. ServerName localhost
  22. DocumentRoot "/Applications/MAMP/htdocs"
  23. ErrorLog /MAMP/logs/localhost_error.log
  24. LogLevel warn
  25. <Directory "/Applications/MAMP/htdocs">
  26. Options Indexes Includes FollowSymLinks ExecCGI
  27. AllowOverride All
  28. Order allow,deny
  29. Allow from all
  30. </Directory>
  31. </VirtualHost>
  32.  
  33. # Then, for each site (virtual host), you would add a new VirtualHost entry like this:
  34. <VirtualHost *:80>
  35. ServerName local.mywebsite.com
  36. DocumentRoot "/Applications/MAMP/htdocs/mywebsite.com"
  37. ErrorLog /MAMP/logs/mywebsite.com_error.log
  38. LogLevel warn
  39. <Directory "/Applications/MAMP/htdocs/mywebsite.com">
  40. Options Includes FollowSymLinks
  41. AllowOverride All
  42. Order allow,deny
  43. Allow from all
  44. </Directory>
  45. </VirtualHost>
  46.  
  47. # Then edit your /etc/hosts file to include your site:
  48. # Add:
  49. 127.0.0.1 local.mywebsite.com
  50.  
  51. # Then restart MAMP.
  52. # If you have MAMP Pro, it will do all of this automatically for you.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement