You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Robert Harrison <rh...@gmail.com> on 2009/10/29 16:57:05 UTC
[users@httpd] VirtualHost Directory Not Found
I have Apache 2.2.8 installed on a machine running openSuse.
I have set up mixed name-based and ip-based virtual hosting.
Listen.conf
Listen *:80
Listen *:443
default-server.conf
NameVirtualHost aaa.xxx.yyy.zzz:80
ServerName localhost
DocumentRoot and <Directory> have been removed.
A name-based virtual host config
<VirtualHost aaa.xxx.yyy.zzz:80> (same ip as namevirtualhost directive)
ServerName www.digestive-medicine.com
ServerAlias digestive-medicine.com
DocumentRoot "/usr/local/tomcat/webapps5/ROOT"
ErrorLog "/var/log/apache2/digestive.com-error_log"
CustomLog "/var/log/apache2/digestive-access_log" combined
HostnameLookups Off
UseCanonicalName Off
ServerSignature On
<Directory /usr/local/tomcat/webapps5/ROOT>
Options -Indexes +FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
When I try to access this site (for example), the browser gets an
"Access Denied" 403 error and the error.log says " client denied by
server configuration: /srv/www/htdocs/". This is the compiled path
which I interpret to mean that the virtualhost directory is not being
seen or read and no path is given in default-server config.
Permissions are okay because, as user "nobody" I can move the the
directory specified in virtualhost or the one ending in htdocs and
read files there.
I would appreciate any suggestions.
Bob
---------------------------------------------------------------------
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] VirtualHost Directory Not Found
Posted by Robert Harrison <rh...@gmail.com>.
Okay.
I copied a fresh default-server.conf into /etc/apache2. It has the
DocumentRoot and <Directory> stanzas. I added NameVirtualHost
aaa.xxx.yyy.zzz:80 to it.
Here is a fresh copy of the VirtualHost configuration. I turned
CanonicalNames on and removed the Options and AllowOverride lines from
the <Directory> statments. Here's what the revised VirualHost config
looks like.
<VirtualHost aaa.xxx.yyy.zzz80>
ServerAdmin rharri@domain.com
ServerName www.domain.com
ServerAlias domain.com
DocumentRoot "/usr/local/tomcat/webapps5/ROOT"
ErrorLog "/var/log/apache2/-error_log"
CustomLog "/var/log/apache2/access_log" combined
HostnameLookups Off
UseCanonicalName On
ServerSignature On
<Directory "/usr/local/tomcat/webapps5/ROOT">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
The sites using Tomcat are on different IPs (not NamedVirtualHost)
and have the following added to their configuration:
<Location "/WEB-INF/">
AllowOverride None
Order deny,allow
deny from all
</Location>
apachectl -S is without error and recognizes the NamedVirtualHosts
(what does the ":2" at the end of "conf" indicate?).
:
Yet, when any of the sites are accessed, the DocumentRoot used is
"/srv/www/htdocs" (from default-server.conf).
Any suggestions? Is this an Apache problem?
Bob
On Fri, Oct 30, 2009 at 3:30 AM, André Warnier <aw...@ice-sa.com> wrote:
> Igor Cicimov wrote:
>>
>> "
>> <Directory /usr/local/tomcat/webapps5/ROOT>
>
> Which is usually a Bad Idea.
> Tomcat knows that it should not serve, e.g., the contents of a WEB-INF
> directory.
> Apache httpd does not know that.
> So unless you proxy *everything* to Tomcat (which would then raise the
> question of why you have Apache), Apache will happily serve your
> WEB-INF/web.xml for instance (and anything else in there you thought was
> private).
>
>
>
> ---------------------------------------------------------------------
> 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
>
>
---------------------------------------------------------------------
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] VirtualHost Directory Not Found
Posted by André Warnier <aw...@ice-sa.com>.
Igor Cicimov wrote:
> "
> <Directory /usr/local/tomcat/webapps5/ROOT>
Which is usually a Bad Idea.
Tomcat knows that it should not serve, e.g., the contents of a WEB-INF
directory.
Apache httpd does not know that.
So unless you proxy *everything* to Tomcat (which would then raise the
question of why you have Apache), Apache will happily serve your
WEB-INF/web.xml for instance (and anything else in there you thought was
private).
---------------------------------------------------------------------
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] VirtualHost Directory Not Found
Posted by Robert Harrison <rh...@gmail.com>.
Igor,
Thanks very much for your questions.
I removed the DocumentRoot and Directory stanzas from
default-serverl.conf just to simplify things where I could.
The path in the Directory stanza is the same as DocumentRoot. It was
my understanding that an Alias would only be needed if the files were
in a different location.
Again, thanks for the questions.
Bob
"When you find a big kettle of crazy, its best not to stir it." - Dilbert
On Thu, Oct 29, 2009 at 9:22 PM, Igor Cicimov <ic...@gmail.com> wrote:
> Couple of questions
>
> "DocumentRoot and <Directory> have been removed."
>
> Why did you do that?
>
> "
> <Directory /usr/local/tomcat/webapps5/ROOT>
> Options -Indexes +FollowSymLinks
> AllowOverride All
> Order allow,deny
> Allow from all
> </Directory>
> "
>
> I think you need Alias directive here in front of the <Directory> to
> bring that directory into apache document root.
>
> "AllowOverride All"
>
> Do you have .htaccess file in that directory?
>
> Cheers,
>
> Igor
>
> ---------------------------------------------------------------------
> 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
>
>
---------------------------------------------------------------------
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] VirtualHost Directory Not Found
Posted by Igor Cicimov <ic...@gmail.com>.
Couple of questions
"DocumentRoot and <Directory> have been removed."
Why did you do that?
"
<Directory /usr/local/tomcat/webapps5/ROOT>
Options -Indexes +FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
"
I think you need Alias directive here in front of the <Directory> to
bring that directory into apache document root.
"AllowOverride All"
Do you have .htaccess file in that directory?
Cheers,
Igor
---------------------------------------------------------------------
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