Setup domain in Apache server on DigitalOcean Cloud

I am trying to set-up a domain in Apache on DigitalOcean and summarise this information after complete the task for my future reference. If this information helps other, it will be my pleasure to know that on a comment. 😉

BTW, You can host as many (multiple) domains as you want by following this steps.

 

#Step 1: go to by

cd /etc/apache2/sites-available

#Step 2: copy default configuration file, in my case I was configuring my site skpaul.me

sudo cp 000-default.conf skpaul.me.conf

#Step 3: Open the file skpaul.me.conf

sudo nano skpaul.me.conf

#Step 4: Update following information in the open file, you you can copy below configuration and update as you needed.

<VirtualHost *:80>

ServerAdmin hello@skpaul.me

DocumentRoot /var/www/html/skpaul
ServerName skpaul.me
ServerAlias http://www.skpaul.me

ErrorLog //var/www/html/skpaul/logs/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/www/html/skpaul/logs/access.log combined

</VirtualHost>

save the file

#Step 5: create a symlink to site-enable folder

sudo a2ensite skpaul.me.conf

#Step 6: restart the server

sudo service apache2 restart

You are done, now check your site from browser.

Advertisements

Inspire Me :)

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s