[thelist] Apache virtual Host Problem
Ali Almutawa
aamutawa at batelco.com.bh
Thu Aug 28 17:28:32 CDT 2003
Hi,
I have managed to configure my apache httpd.conf file to show me the
default page on http://127.0.0.1 , as well manged to create a virtual
host called www.firsthost.com and its alias "first" which both work
fine. I have added another host which is called secondhost.com and its
alias "second", here where the problem appears. When going to
www.secondhost.com I got the index file of the www.firsthost.com, while
if I typed the alias name "second" it will show the coorect index file
for secondhost.com.
Would you pleae help me in sorting this problem ?
Below is the snapshots or the virtual host I have created, also the
output of the httpd -S command and the /etc/hosts files to do the
resolving for the site.
Thanks in advance,
Ali Almutawa
=============================
httpd.conf :
NameVirtualHost 127.0.0.1
<VirtualHost 127.0.0.1>
ServerAdmin aamutawa at batelco.com.bh
DocumentRoot /var/www/html/firsthost.com
ServerName firsthost.com
ServerAlias first
ErrorLog logs/fisrthost.com-error_log
CustomLog logs/firstlog.com-access_log common
</VirtualHost>
<VirtualHost 127.0.0.1>
ServerAdmin aamutawa at batelco.com.bh
DocumentRoot /var/www/html/secondhost.com
ServerName secondhost.com
ServerAlias second
ErrorLog logs/secondhost.com-error_log
CustomLog logs/secondhost.com-access_log common
</VirtualHost>
=================================================
[root at rh7 root]# httpd -S
VirtualHost configuration:
127.0.0.1:80 is a NameVirtualHost
default server firsthost.com
(/etc/httpd/conf/httpd.conf:1206)
port 80 namevhost firsthost.com
(/etc/httpd/conf/httpd.conf:1206)
port 80 namevhost secondhost.com
(/etc/httpd/conf/httpd.conf:1215)
=================================================
/etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 rh7.aamutawa.com localhost
127.0.0.1 www.firsthost.com first
127.0.0.1 www.secondhost.com second
==================================================
Regards,
Ali Almutawa [ XCI4 ]
MCSE CCNA CCSA CCSE SCSA SCNA
STC Systems Management
Office : 00973 883474 Mobile : 00973 9688797
Fax : 00973 9103474
More information about the thelist
mailing list