Created
March 8, 2019 14:19
-
-
Save jaynarayan89/ffd123f4b924e927197fe8d8b822bc84 to your computer and use it in GitHub Desktop.
lamp virtual host
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo mkdir -p ~/Documents/projects/NEW-SITE-NAME.loc/public_html | |
sudo touch /etc/apache2/sites-available/NEW-SITE-NAME.loc.conf | |
sudo gedit /etc/apache2/sites-available/NEW-SITE-NAME.loc.conf | |
put the following content in file and save. | |
-------------------------------------------- | |
<VirtualHost *:80> | |
ServerAdmin admin@NEW-SITE-NAME.loc | |
ServerName NEW-SITE-NAME.loc | |
ServerAlias www.NEW-SITE-NAME.loc | |
DocumentRoot /home/jay/Documents/projects/NEW-SITE-NAME.loc/public_html | |
<Directory /home/jay/Documents/projects/NEW-SITE-NAME.loc/public_html> | |
Options Indexes FollowSymLinks MultiViews | |
AllowOverride All | |
Order allow,deny | |
Allow from all | |
Require all granted | |
</Directory> | |
ErrorLog ${APACHE_LOG_DIR}/error.log | |
CustomLog ${APACHE_LOG_DIR}/access.log combined | |
</VirtualHost> | |
-------------------------------------------- | |
sudo a2ensite NEW-SITE-NAME.loc.conf | |
sudo service apache2 restart | |
sudo gedit /etc/hosts | |
-------------------------------------------- | |
in case eny errors | |
apachectl configtest | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment