To create the new Virtual Host File
on the apache, you need to set up the apache configuration. It's good idea to create duplicate file rather than creating new. Here is how to do so
sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/Open the newly created configuration file.
sudo nano /etc/apache2/sites-available/Edit server details of your domain.
<VirtualHost *:80>Now, create shortcut of apache host file.
ServerAdmin [email protected]
ServerName example.com
ServerAlias www.example.com
DocumentRoot /var/www/example.com/public_html
sudo a2ensite example.comRetart apache
sudo service apache2 restartbased on digital ocean vps experience