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

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.

ApacheHost Multiple Domains on One Server/IP with Apache or Httpdhttpd
Comments (0)
Add Comment