Solved

2 apache virtual hosting questions

Posted on 2000-03-16
10
252 Views
Last Modified: 2013-12-23
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.edu
    DocumentRoot /opt/local/wwwroot/httpdocs
    ServerName www.vetmed.auburn.edu
    ErrorLog /opt/local/wwwroot/logs/error.log
    CustomLog /opt/local/wwwroot/logs/error common
/VirtualHost>

<VirtualHost 131.204.136.14>
    ServerAdmin webmaster@vetmed.auburn.edu
    DocumentRoot /opt/local/wwwroot/virtual
    ServerName virtual.vetmed.auburn.edu
    ErrorLog /opt/local/wwwroot/logs/virtual.log
  CustomLog /opt/local/wwwroot/logs/virtual 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?
0
Comment
Question by:fordste
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
10 Comments
 
LVL 2

Expert Comment

by:mapc
ID: 2625645
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

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/httpdocs

Dealing with ports isn't needed as well.
0
 

Author Comment

by:fordste
ID: 2625693
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?
0
 
LVL 2

Expert Comment

by:mapc
ID: 2625708
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 :)
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

Author Comment

by:fordste
ID: 2625712
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 :-?
0
 
LVL 2

Expert Comment

by:mapc
ID: 2625718
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 :)
0
 

Author Comment

by:fordste
ID: 2625725
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 :-?
0
 
LVL 2

Expert Comment

by:mapc
ID: 2625727
ok, syntax? apachectl configtest ?
0
 

Author Comment

by:fordste
ID: 2625774
:-/  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.

0
 
LVL 2

Accepted Solution

by:
mapc earned 200 total points
ID: 2625786
prev answer and last comment :)
0
 

Author Comment

by:fordste
ID: 2625802
Thanks. *lowering my head in shame*
0

Featured Post

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to security, there are always trade-offs between security and convenience/ease of administration. This article examines some of the main pros and cons of using key authentication vs password authentication for hosting an SFTP server.
During and after that shift to cloud, one area that still poses a struggle for many organizations is what to do with their department file shares.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question