Link to home
Start Free TrialLog in
Avatar of serveradmin
serveradmin

asked on

i want to host more then 1 site on local centos mach.

i want to host more then 1 site on virtual. on my system with operating system centos 5. apache was installed with the installation of the centos. so all the files are on default location.
 how can i host test1.abc.com and test2.abc.com on a same vps so that i can test this site.
Avatar of Julian Parker
Julian Parker
Flag of United Kingdom of Great Britain and Northern Ireland image

you can edit the httpd.conf file  and create virtual host entries;

<VirtualHost *:80>
    ServerAdmin webmaster@mydomain.com
    DocumentRoot /var/www/html
    ServerName www.mydomain.com
    ErrorLog logs/mydomain-error_log
    CustomLog logs/mydomain-access_log common
</VirtualHost>
 
<VirtualHost *:80>
    ServerAdmin webmaster@otherdomain.com
    DocumentRoot /var/www/html/othersite
    ServerName www.otherdomain.com
    ErrorLog logs/otherdomain-error_log
    CustomLog logs/otherdomain-access_log common
</VirtualHost>

Open in new window

Avatar of serveradmin
serveradmin

ASKER

i am getting error when i restart the httpd after doing the configuration u told

starting httpd: [Fri May 01 09:54:54 2009] [Warn] _default_ VirtualHost overlap on port 80, the first as precedence
[Fri May 01 09:54:54 2009] [Warn] _default_ VirtualHost overlap on port 80, the first as precedence

but all the domains are openng to the default apache page rather then the index page i placed in the folder location.
they are warnings but it is a bit annoying...
can you post you complete config here?
in my /etc/hosts file i place following code
101.168.1.25  www.solutionsbeyond.local
101.168.1.25  forum.solutionsbeyond.local
101.168.1.25  forum2.solutionsbeyond.local

and in /etc/httpd/conf/httpd.conf

<VirtualHost *:80>
ServerAdmin  admin@solutionsbeyond.local
DocumentRoot  /home/httpd/sb
ServerName www.solutionsbeyond.local
</VirtualHost>

<VirtualHost *:80>
ServerAdmin  admin@solutionsbeyond.local
DocumentRoot  /home/httpd/test
ServerName forum2.solutionsbeyond.local
</VirtualHost>

<VirtualHost *:80>
ServerAdmin  admin@solutionsbeyond.local
DocumentRoot  /home/httpd/phpbb
ServerName forum.solutionsbeyond.local
</VirtualHost>

rest is default as it was
ASKER CERTIFIED SOLUTION
Avatar of Julian Parker
Julian Parker
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial