First - need to make permissiom
Second - Create Bew Virtual Host File
The file locate in
Duplicate the file
Then edit file using nano
File will look like this
The file will look like this
Third - Enable the Virtual Host File
sudo chmod -R 755 /var/www
Second - Create Bew Virtual Host File
The file locate in
/etc/apache2/sites-available/000-default.conf
Duplicate the file
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/example.com.conf
Then edit file using nano
sudo nano /etc/apache2/sites-available/example.com.conf
File will look like this
<VirtualHost *:80>Edit the line to this:
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
ServerAdmin admin@example.com
ServerName example.com
ServerAlias www.example.com
DocumentRoot /var/www/example.com/public_html
The file will look like this
<VirtualHost *:80>
ServerAdmin admin@test.com
ServerName test.com
ServerAlias www.test.com
DocumentRoot /var/www/test.com/public_html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Third - Enable the Virtual Host File
sudo a2ensite example.com.confThen restart apache
sudo service apache2 restartThen Set Up Local Hosts File
sudo nano /etc/hostsThe file will look like this:
127.0.0.1 localhost
127.0.1.1 guest-desktop
111.111.111.111 example.com