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/domain.com

2: Edit config:

# sudo vim /etc/apache2/sites-available/domain.com

  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 domain.com

Restart Apache

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

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.