Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Apache: Users

VirtualHost Directory Not Found

 

 

Apache users RSS feed   Index | Next | Previous | View Threaded


rharri at gmail

Oct 29, 2009, 8:57 AM

Post #1 of 5 (256 views)
Permalink
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[at]httpd.apache.org
" from the digest: users-digest-unsubscribe[at]httpd.apache.org
For additional commands, e-mail: users-help[at]httpd.apache.org


icicimov at gmail

Oct 29, 2009, 6:22 PM

Post #2 of 5 (229 views)
Permalink
Re: VirtualHost Directory Not Found [In reply to]

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[at]httpd.apache.org
" from the digest: users-digest-unsubscribe[at]httpd.apache.org
For additional commands, e-mail: users-help[at]httpd.apache.org


rharri at gmail

Oct 29, 2009, 6:44 PM

Post #3 of 5 (229 views)
Permalink
Re: VirtualHost Directory Not Found [In reply to]

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 <icicimov[at]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[at]httpd.apache.org
>   "   from the digest: users-digest-unsubscribe[at]httpd.apache.org
> For additional commands, e-mail: users-help[at]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[at]httpd.apache.org
" from the digest: users-digest-unsubscribe[at]httpd.apache.org
For additional commands, e-mail: users-help[at]httpd.apache.org


aw at ice-sa

Oct 30, 2009, 12:30 AM

Post #4 of 5 (228 views)
Permalink
Re: VirtualHost Directory Not Found [In reply to]

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[at]httpd.apache.org
" from the digest: users-digest-unsubscribe[at]httpd.apache.org
For additional commands, e-mail: users-help[at]httpd.apache.org


rharri at gmail

Nov 4, 2009, 10:38 AM

Post #5 of 5 (170 views)
Permalink
Re: VirtualHost Directory Not Found [In reply to]

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[at]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[at]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[at]httpd.apache.org
>  "   from the digest: users-digest-unsubscribe[at]httpd.apache.org
> For additional commands, e-mail: users-help[at]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[at]httpd.apache.org
" from the digest: users-digest-unsubscribe[at]httpd.apache.org
For additional commands, e-mail: users-help[at]httpd.apache.org

Apache users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.