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

Be the First to Comment!

Notify of
avatar
wpDiscuz