June 13, 2024

Host Multiple Domains on One Server/IP with Apache or Httpd

If you have a vps or dedicated-server and you are planning to host multiple domains on your server yes you can. Here are the step as follows:-

Step 1:- First map your ip/nameserver from where you bought your domain

Step 2:- Login to your Server

Step 3:- Go to apache conf location (/etc/httpd/conf/httpd.conf).

Step 4:- Open httpd.conf and go all way down to httpd conf file and write the following VirtualHost configuration:-

<VirtualHost *:80>

DocumentRoot /var/www/html/

</VirtualHost>

<VirtualHost *:80>

ServerName abcd.co.in

ServerAlias www.abcd.co.in

DocumentRoot /var/www/html/directoryname/

AllowOverride All

ErrorLog logs/name.in-error_log

CustomLog logs/name.in-access_log common

</VirtualHost >

Note: Change the value for DocumentRoot, ServerName, ErrorLog, CustomLog based on your requirement.

Vedant Kumar

Currently I'm working as an Implementation Engineer, Started my career as an System Administrator - Linux. Additionally loves to explore new technologies and research about new open-source software that ease the development cycle.

View all posts by Vedant Kumar →

Leave a Reply

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


The reCAPTCHA verification period has expired. Please reload the page.

close

Ad Blocker Detected!

VEDANT EXPLAINS
We've noticed that you are using an ad blocker. Advertising helps fund our server cost and keep it truly independent. It helps to build our content creator team. So please disable your ad blocker, and help us to keep providing you with free- great content - for free. Thank you for your support.

Refresh