Start by copying the file for the first domain:
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/example.com.confStep 2 :
Open the new file in your editor with root privileges:
sudo nano /etc/apache2/sites-available/example.com.conf
The file will look something like this (I've removed the comments here to make the file more approachable):
<VirtualHost *:80>Step 5 :
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
We can use the
a2ensite
tool to enable each of our sites like this:sudo a2ensite example.com.confStep : 6
When you are finished, you need to restart Apache to make these changes take affect:
sudo service apache2 restartStep 7 :
Open browser enter example.com
Done! Good Luck ^-^
No comments:
Post a Comment