Setup domain in Apache server on AWS EC2 and DigitalOcean Cloud

Setup domain in Apache server on AWS EC2 and DigitalOcean Cloud

I am trying to set-up domains in the Apache server on AWS EC2 and DigitalOcean cloud’s Ubuntu instances and summarize this information after completing the task for my future reference. If this information helps you also, it will be my pleasure and you can let me know that in a comment below. 🙂

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


#Step 1: Navigate to the sites-available directory by following the command

cd /etc/apache2/sites-available

#Step 2: Copy default configuration file, in my case I was configuring my site

sudo cp 000-default.conf

#Step 3: Open the file

sudo nano

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

<VirtualHost *:80>


DocumentRoot /var/www/html/skpaul

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


save the file

#Step 5: Create a symlink to the site-enable folder

sudo a2ensite

#Step 6: Restart the server

sudo service apache2 restart

You are done, now check your site from the browser. And let me know what do you want in the next article in the comment below?


N.B.: I really appreciate your support if you share this information with the community.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.