Add domain to DigitalOcean with Ubuntu server

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/

2: Edit config:

# sudo vim /etc/apache2/sites-available/

  1. Add  ServerName
  2. Add  ServerAlias
  3. Edit DocumentRoot
  4. 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

Restart Apache

# sudo service apache2 restart
# sudo /etc/init.d/apache2 restart

Leave a Reply

Disclosure: (1) We may receive a commission throught external affiliate links if you choose to purchase the mentioned product in the post. (2) We are independently owned, and the opinions expressed here are our own.