We need well config & running a single server for hosting multiple websites.

I am using LINODE hosting for my all website & i have not facing any issue from this.

If you haven't hosting server or you mind to change your hosting provider, please refer below link.

Referral URL :

Referral Code : 74338d15b376adb3cf1e4d38f777fd7251d58d7d

For hosting we are going to user Name Based Virtual Hosting (NBVH).

NBVH is commonly used for host multiple websites on same IP address or same server.

To host two or more websites on a single server follow below steps :

Step 1 : Create a website directory

Create a directory for website :

Use below command for create new directory.

mkdir /var/www/

Step 2 : Put files in directory

Now put your code in this directory or create an index.html page with following command.

nano /var/www/

Step 3 : Change directory permission

Next, change the ownership of directory to www-data:

chown -R www-data:www-data /var/www/

Step 4 : Create a virtual host configuration file

Now, you will need to create an apache virtual host configuration file to run two or more websites.

Create a virtual host config file for

Below command will create new file & open for editing.

nano /etc/apache2/sites-available/

Add the following lines in opened file, Save and close after editing.

<VirtualHost *:80>
	ServerAdmin webmaster@localhost
	DocumentRoot /var/www/
	ErrorLog ${APACHE_LOG_DIR}/error.log
	CustomLog ${APACHE_LOG_DIR}/access.log combined
	<Directory /var/www/>
		AllowOverride All
	RewriteEngine on
	RewriteCond %{SERVER_NAME} [OR]
	RewriteCond %{SERVER_NAME}
	RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]

Step 5 : Enable new site config

Enable the new created virtual host configuration file with the following commands :


Step 6 : Restart apache server

Restart apache for new changes.

systemctl restart apache2

Step 7 : Run new website

Now, open your preferred browser and run URL

That's all done here.