You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Anthony Abby <an...@aplusdata.com> on 2003/02/09 20:28:54 UTC

[users@httpd] Problem with Virtual Hosts

I'm having problems getting a name-based virtual host to work
correctly.  I'm running Apache 1.3.x on Mandrake Linux 9, so my main web
root is located at /var/www/html/, but my virtual host is located at
/var/www/vhosts/comicsnsuch/

My virtual host config (located at /etc/httpd/conf/vhosts/Vhosts.conf
looks like this:

<VirtualHost >
  ServerName www.comicsnsuch.com
  DocumentRoot /var/www/vhosts/comicsnsuch/
  ServerAlias comicsnsuch.com *.comicsnsuch.com
</VirtualHost>

But the documentation says it should say <VirtualHost *>.  The first
problem is that if I add the '*' there, then apachectl restart, I can
not browse either website hosted on my server.  I get a Forbidden, You
don't have permission to access / on this server error.  If I remove the
'*' I can browse both sites, but that leads to my second problem.

Right now I have both sites as mirrors of one another, but that's only
because I'm in the process of moving the content of my first site, to
the virtual host.  In a couple more weeks I intend to put up entirely
different content on the original site.  Right now though, irregardless
of which domain you type in, you are served the content from
/var/www/html/.

Anyone have any pointers?  Thanks!


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Problem with Virtual Hosts

Posted by Joshua Slive <jo...@slive.ca>.
On Sun, 9 Feb 2003, Anthony Abby wrote:

> > You still need to put the "*" back.  Then you need to find the reason for
> > the "forbidden" message.  To do that, start by checking the error log.  If
> > the error log doesn't say anything, then the problem is almost surely with
> > your unix permissions setting.
>
> I know the * needs to go back in, but if I put it in I get the forbidden
> error.  So I guess it is a permissions problem, but they look right to
> me.  They match the permissions I have set on my regular web root.....

Have you checked the error log?????

As far as unix permissions, you need to give at least global search
permission (chmod +x) to every directory in the tree leading up to the
document root, not just the document root itself.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Problem with Virtual Hosts

Posted by Anthony Abby <an...@aplusdata.com>.
> You still need to put the "*" back.  Then you need to find the reason for
> the "forbidden" message.  To do that, start by checking the error log.  If
> the error log doesn't say anything, then the problem is almost surely with
> your unix permissions setting.

I know the * needs to go back in, but if I put it in I get the forbidden
error.  So I guess it is a permissions problem, but they look right to
me.  They match the permissions I have set on my regular web root..... 


-- 
Anthony Abby - http://www.aplusdata.com
Comic Book Community News		|  Web Programming
Inventory Control, Auction, Management	|  Cold Fusion
					   PHP & ASP


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Problem with Virtual Hosts

Posted by Joshua Slive <jo...@slive.ca>.
On Sun, 9 Feb 2003, Anthony Abby wrote:

> > On Sun, 9 Feb 2003, Anthony Abby wrote:
> > > But the documentation says it should say <VirtualHost *>.  The first
> > > problem is that if I add the '*' there, then apachectl restart, I can
> > > not browse either website hosted on my server.  I get a Forbidden, You
> > > don't have permission to access / on this server error.  If I remove the
> > > '*' I can browse both sites, but that leads to my second problem.

> I'm sorry, I probably should have listed the full contents of my
> Vhosts.conf.

You still need to put the "*" back.  Then you need to find the reason for
the "forbidden" message.  To do that, start by checking the error log.  If
the error log doesn't say anything, then the problem is almost surely with
your unix permissions setting.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Problem with Virtual Hosts

Posted by Renato Salles <ma...@brturbo.com>.
Anthony,

This is not addressed to your actual configuration but intended to solve
few mistakes I'm doing in a server here, after a upgrade to v 2.0:

Replacing the directive ServerAlias by ServerName with a aliased
interface like eth0:1 and having in DNS a "A" rr pointed as:
www.VirtualDoamin.com	IN	A	192.168.0.2
mapped as "internal domain" ( notify no; ) could it be consistently be
"resolved" by Apache as a VirtualDomain?
In this case the internal LAN is completely hidden by the firewall
(iptables), and the other VirtualHosts made the same way (many of them).
What kind of errors could arise?
Is this correct?

Thanx,
RSalles









On Sun, 2003-02-09 at 17:56, Anthony Abby wrote:
> > On Sun, 9 Feb 2003, Anthony Abby wrote:
> > > But the documentation says it should say <VirtualHost *>.  The first
> > > problem is that if I add the '*' there, then apachectl restart, I can
> > > not browse either website hosted on my server.  I get a Forbidden, You
> > > don't have permission to access / on this server error.  If I remove the
> > > '*' I can browse both sites, but that leads to my second problem.
> > 
> > Follow the documentation and put the "*" back.  Also follow the
> > documentation and:
> > 
> > 1. Add a "NameVirtualHost *" line.
> > 2. Add a <VirtualHost *> with a Servername that matches your "default"
> > host and list it first.
> > 
> 
> I'm sorry, I probably should have listed the full contents of my
> Vhosts.conf.
> 
> 
> NameVirtualHost *
> <VirtualHost *>
>   ServerName www.aplusdata.com
>   DocumentRoot /var/www/html/
>   ServerAlias aplusdata.com *.aplusdata.com
> </VirtualHost>
> 
> # comicsnsuch.com
> <VirtualHost >
>   ServerName www.comicsnsuch.com
>   DocumentRoot /var/www/vhosts/comicsnsuch/
>   ServerAlias comicsnsuch.com *.comicsnsuch.com
> </VirtualHost>
> 
> 
> 
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 
-- 
---
====================<<<<<< * >>>>>>>====================
Q:.
I'm having problems with my Windows software. Will you 
help me?
A:.
Yes. Go to a DOS prompt and type "format c:". Any problems
you are experiencing will cease within a few minutes.
        "...From ESR in "How To Became a Hacker".
====================                ====================
===========  Renato Q. Salles UIN 143517540  ===========
===========  Linux Registered User nÂș 217696 ===========
====================<<<<<< * >>>>>>>====================



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Problem with Virtual Hosts

Posted by Anthony Abby <an...@aplusdata.com>.
> On Sun, 9 Feb 2003, Anthony Abby wrote:
> > But the documentation says it should say <VirtualHost *>.  The first
> > problem is that if I add the '*' there, then apachectl restart, I can
> > not browse either website hosted on my server.  I get a Forbidden, You
> > don't have permission to access / on this server error.  If I remove the
> > '*' I can browse both sites, but that leads to my second problem.
> 
> Follow the documentation and put the "*" back.  Also follow the
> documentation and:
> 
> 1. Add a "NameVirtualHost *" line.
> 2. Add a <VirtualHost *> with a Servername that matches your "default"
> host and list it first.
> 

I'm sorry, I probably should have listed the full contents of my
Vhosts.conf.


NameVirtualHost *
<VirtualHost *>
  ServerName www.aplusdata.com
  DocumentRoot /var/www/html/
  ServerAlias aplusdata.com *.aplusdata.com
</VirtualHost>

# comicsnsuch.com
<VirtualHost >
  ServerName www.comicsnsuch.com
  DocumentRoot /var/www/vhosts/comicsnsuch/
  ServerAlias comicsnsuch.com *.comicsnsuch.com
</VirtualHost>




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Problem with Virtual Hosts

Posted by Joshua Slive <jo...@slive.ca>.
On Sun, 9 Feb 2003, Anthony Abby wrote:
> But the documentation says it should say <VirtualHost *>.  The first
> problem is that if I add the '*' there, then apachectl restart, I can
> not browse either website hosted on my server.  I get a Forbidden, You
> don't have permission to access / on this server error.  If I remove the
> '*' I can browse both sites, but that leads to my second problem.

Follow the documentation and put the "*" back.  Also follow the
documentation and:

1. Add a "NameVirtualHost *" line.
2. Add a <VirtualHost *> with a Servername that matches your "default"
host and list it first.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org