Skip to content

Instantly share code, notes, and snippets.

@tomazsaraiva
Last active January 6, 2020 23:52
Show Gist options
  • Save tomazsaraiva/011655fde9cef16d11638e9c2b2fc30b to your computer and use it in GitHub Desktop.
Save tomazsaraiva/011655fde9cef16d11638e9c2b2fc30b to your computer and use it in GitHub Desktop.
[Apache Virtual Hosts] #mamp #unix #server #apache
// local
// edit the hosts
sudo nano /etc/hosts
// edit the /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf
<VirtualHost *>
DocumentRoot "/Users/tomazsaraiva/Documents/example/"
ServerName example.localhost
</VirtualHost>
// server
// create /etc/apache2/sites-available/example.conf
<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
ServerAdmin mail@example.com
DocumentRoot /var/www/example.com/public_html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment