fordste
asked on
2 apache virtual hosting questions
Ok, I am trying to show that I can run 2 different
websites off the same machine and server.
However, when I use the following configuration,
I will only get the virtual host site.
NameVirtualHost 131.204.136.14
<VirtualHost 131.204.136.14>
ServerAdmin webmaster@vetmed.auburn.ed u
DocumentRoot /opt/local/wwwroot/httpdoc s
ServerName www.vetmed.auburn.edu
ErrorLog /opt/local/wwwroot/logs/er ror.log
CustomLog /opt/local/wwwroot/logs/er ror common
/VirtualHost>
<VirtualHost 131.204.136.14>
ServerAdmin webmaster@vetmed.auburn.ed u
DocumentRoot /opt/local/wwwroot/virtual
ServerName virtual.vetmed.auburn.edu
ErrorLog /opt/local/wwwroot/logs/vi rtual.log
CustomLog /opt/local/wwwroot/logs/vi rtual common
</VirtualHost>
Is there a problem with me setting these to the
default port? I've added virtual to our DNS so it
points at the server machine. Not that it matters,
but I thought I would mention it.
If I set the VirtualHostName to 131.204.136.14:8000, port 80 no longer responds.
Same when I add Listen 8000, I thought I could
have the server listen to multiple ports at the
same time? I had Bind set to *.
What am I doing wrong?
websites off the same machine and server.
However, when I use the following configuration,
I will only get the virtual host site.
NameVirtualHost 131.204.136.14
<VirtualHost 131.204.136.14>
ServerAdmin webmaster@vetmed.auburn.ed
DocumentRoot /opt/local/wwwroot/httpdoc
ServerName www.vetmed.auburn.edu
ErrorLog /opt/local/wwwroot/logs/er
CustomLog /opt/local/wwwroot/logs/er
/VirtualHost>
<VirtualHost 131.204.136.14>
ServerAdmin webmaster@vetmed.auburn.ed
DocumentRoot /opt/local/wwwroot/virtual
ServerName virtual.vetmed.auburn.edu
ErrorLog /opt/local/wwwroot/logs/vi
CustomLog /opt/local/wwwroot/logs/vi
</VirtualHost>
Is there a problem with me setting these to the
default port? I've added virtual to our DNS so it
points at the server machine. Not that it matters,
but I thought I would mention it.
If I set the VirtualHostName to 131.204.136.14:8000, port 80 no longer responds.
Same when I add Listen 8000, I thought I could
have the server listen to multiple ports at the
same time? I had Bind set to *.
What am I doing wrong?
ASKER
mpac,
Thanks for the fast response but I think you may
have copy and pasted incorrtly because they
appear to be the same lines, unless I am tired :-)
>First, if I were you, I would check why the query gives two responses:
> alchemy:/home/mapc% host www.vetmed.auburn.edu
> www.vetmed.auburn.edu is a nickname for franklin.vetmed.auburn.edu
> franklin.vetmed.auburn.edu has address 131.204.136.14
> franklin.vetmed.auburn.edu has address 131.204.136.14
Also, I have been using http://www.vetmed.auburn.edu and
http://virtual.vetmed.auburn.edu when I try and
get to the sights.
Could you tell me again what is giving two different responses?
Thanks for the fast response but I think you may
have copy and pasted incorrtly because they
appear to be the same lines, unless I am tired :-)
>First, if I were you, I would check why the query gives two responses:
> alchemy:/home/mapc% host www.vetmed.auburn.edu
> www.vetmed.auburn.edu is a nickname for franklin.vetmed.auburn.edu
> franklin.vetmed.auburn.edu
> franklin.vetmed.auburn.edu
Also, I have been using http://www.vetmed.auburn.edu and
http://virtual.vetmed.auburn.edu when I try and
get to the sights.
Could you tell me again what is giving two different responses?
yes. running `host' command gives the answer twice.
I have no idea why though.
So.. perhaps you're missing something since it works for me :)
I have no idea why though.
So.. perhaps you're missing something since it works for me :)
ASKER
I lied. When I use the above settings, http://www.vetmed.auburn.edu
breaks! I get an error telling me the server is not responding. However,
if I put in http://virtual.vetmed.auburn.edu, I get the right page :-?
breaks! I get an error telling me the server is not responding. However,
if I put in http://virtual.vetmed.auburn.edu, I get the right page :-?
yes. running `host' command gives the answer twice.
I have no idea why though.
So.. perhaps you're missing something since it works for me :)
I have no idea why though.
So.. perhaps you're missing something since it works for me :)
ASKER
I lied. When I use the above settings, http://www.vetmed.auburn.edu
breaks! I get an error telling me the server is not responding. However,
if I put in http://virtual.vetmed.auburn.edu, I get the right page :-?
breaks! I get an error telling me the server is not responding. However,
if I put in http://virtual.vetmed.auburn.edu, I get the right page :-?
ok, syntax? apachectl configtest ?
ASKER
:-/ Ok, I am an idiot, it is htdocs, not httpdocs in the server path. Thanks
mapc, can you send another answer so I can give you the points.
mapc, can you send another answer so I can give you the points.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks. *lowering my head in shame*
alchemy:/home/mapc% host www.vetmed.auburn.edu
www.vetmed.auburn.edu is a nickname for franklin.vetmed.auburn.edu
franklin.vetmed.auburn.edu
franklin.vetmed.auburn.edu
Looking at your zone file, I haven't seen a problem, that might indicate that either I'm tired or your dns server software does it.
Secondly,
you must be sure that you call your server by the complete name, e.g.
in netscape:
http://www.vetmed.auburn.edu
giving the name www.vetmed is not enough.
if you wish to have it as an option, add in the first virtualhost
ServerAlias www www.vetmed
or similar.
Bind address is good for other things, not in your case, comment it out.
And, as funy as it is, check that:
/opt/local/wwwroot/virtual
is not the same as:
/opt/local/wwwroot/httpdoc
Dealing with ports isn't needed as well.