September 20, 2021

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 Singh

Linux System Administrator | Entrepreneur | Founder Techmion. I have started my career as a Linux system Administrator after that quit my job to start something new that excites me and started a Tech Company in order to provide the best technology to my clients. My Company website link: https://www.techmion.com/ For Bulk, SMS-Marketing follows the link : https://www.pingsms.in/

View all posts by Vedant Singh →

Leave a Reply

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

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