Skip to content

Instantly share code, notes, and snippets.

@acbilimoria
Last active May 4, 2017 18:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save acbilimoria/e31029e2597ca1da37eb6e2eb778707e to your computer and use it in GitHub Desktop.
Save acbilimoria/e31029e2597ca1da37eb6e2eb778707e to your computer and use it in GitHub Desktop.
VHost Ubuntu 16.04 LAMP
sudo vim /etc/hosts
# add this line:
127.0.0.1 EXAMPLE.loc
# create new conf file based off of the default
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/EXAMPLE.loc.conf
# edit the apache2.conf file
# add this block of text below the other Directory tags
<Directory /home/mac/code/ztrust/ztrust/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
# edit the new conf file
sudo vim /etc/apache2/sites-available/EXAMPLE.loc.conf
# add these lines:
ServerName EXAMPLE.loc
ServerAlias www.EXAMPLE.loc
# edit DocumentRoot line.
DocumentRoot PATH-TO-EXAMPLE-FILES
# enable the new site
sudo a2ensite EXAMPLE.loc.conf
# reload apache2
sudo service apache2 reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment