Forum Moderators: phranque

Message Too Old, No Replies

newbie apache problem

ordinary apache problem

         

marsguy

2:09 pm on Mar 27, 2005 (gmt 0)

10+ Year Member



Hello ...

I have a strange problem, I think it will be quite easy for you to solve, but I really tried many things with it and I just couldn't figure out the solution.

first take a look at these 2 files

here's /etc/hosts (I don't have a DNS)

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
127.0.0.1 abbas.jackandmido.com abbas
127.0.0.1 happy.jackandmido.com happy

here's my /etc/httpd/conf/httpd.conf

<VirtualHost *>
ServerAdmin webmaster@mango.com
DocumentRoot /var/www/marsguy
ServerName abbas.jackandmido.com
ErrorLog logs/dummy-host.example.com-error_log
CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>

<VirtualHost *>
ServerAdmin webmaster@mango.com
DocumentRoot /var/www/html/mango
ServerName happy.jackandmido.com
ErrorLog logs/dummy-host.example.com-error_log
CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>

these domains are just for test, they don't really exist.

the problem is: when I type "abbas.jackandmido.com" or "happy.jackandmido.com" I get the same page which is located in "/var/www/marsguy" (the first in order)!

please help me!
thanks in advance

Birdman

3:57 pm on Mar 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The problem could be that you are missing the NameVirtualHost [httpd.apache.org] directive.

NameVirtualHost *
<VirtualHost *>
ServerAdmin webmaster@mango.com
DocumentRoot /var/www/marsguy
ServerName abbas.jackandmido.com
ErrorLog logs/dummy-host.example.com-error_log
CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>

<VirtualHost *>
ServerAdmin webmaster@mango.com
DocumentRoot /var/www/html/mango
ServerName happy.jackandmido.com
ErrorLog logs/dummy-host.example.com-error_log
CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>

Cheers

marsguy

8:36 am on Mar 28, 2005 (gmt 0)

10+ Year Member



Hello ...

Thank you Birdman for helping me :)

I found the solution, the solution is to assign your webserver's IP address to the NameVirtualHost directive. like so:

this is the new httpd.conf and it is working perfectly.

NameVirtualHost 127.0.0.1

<VirtualHost 127.0.0.1>
DocumentRoot /var/www/html/marsguy
ServerName abbas.jackandmido.com
</VirtualHost>

<VirtualHost 127.0.0.1>
DocumentRoot /var/www/html/mango
ServerName happy.jackandmido.com
</VirtualHost>

I had (*) assigned to the NameVirtualHost directive like you told me to do before but it didn't work! I don't know why?

Thanks again for helping me!