Learn how to add domain to degitalocean vps with ubuntu server.
1. Copy default config, open Terminal Console
# sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/domain.com
2: Edit config:
# sudo vim /etc/apache2/sites-available/domain.com
- Add ServerName
- Add ServerAlias
- Edit DocumentRoot
- Change AllowOverride from None to All to enable RewriteURL (if using permalink)
after that, save config using ESC key.
press (:) , press wp, Enter for save and exit.
3. Active Config and restart Apache
Active config
# sudo a2ensite domain.com
Restart Apache
# sudo service apache2 restart or # sudo /etc/init.d/apache2 restart Done.