You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Dennis Putnam <da...@bellsouth.net> on 2011/03/13 19:27:04 UTC

[users@httpd] Virtual Host Directory Permissions Problem

I am setting up a new virtual host and am having trouble with the root
directory. My new virtual host document root (/var/www/html/vhroot) is a
child directory of my primary host root (/var/www/html). Is it legal to
do that? When I try to access my new virtual host, I get the index from
the primary document root. TIA.

Here are my virtual host directives:

Primary

<VirtualHost *>
DocumentRoot /var/www/html
ServerName primary.mydomain.com:443
<Directory "/var/www/html">
allow from all
Options +Indexes
</Directory>
</VirtualHost>

New VH

<VirtualHost *>
DocumentRoot "/var/www/html/vhroot"
ServerName newvh.mydomain.com
<Directory "/var/www/html/vhroot">
allow from all
Options +Indexes
</Directory>
</VirtualHost>


Re: [users@httpd] Virtual Host Directory Permissions Problem

Posted by Dennis Putnam <da...@bellsouth.net>.
Thanks for the reply. I removed the 443 from that directive, since I'm
using standard ports, I don't think I need to specify anything. I
believe that may have been added automatically by Webmin at some point
when I was messing with it.

Here is the httpd -S output:

VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
_default_:443          primary.localdomain
(/etc/httpd/conf/vhosts.d/01_default_ssl_vhost.conf:13)
*:*                    primary.mydomain.com
(/etc/httpd/conf/httpd.conf:1116)
*:*                    newvh.mydomain.com (/etc/httpd/conf/httpd.conf:1127)
Syntax OK

I don't see anything there that hints at the document root for the
virtual hosts which is the crux of my problem. Howevwer, I did find an
error in the httpd log that is obviously related.

(13)Permission denied: /var/www/html/Scripts/Menu132/.htaccess
pcfg_openfile: unable to check htaccess file, ensure it is readable,
referer: http://newvh.mydomain.com/

I don't see why there is a permissions problem with that subdirectory
since it is not referenced in the page attempting to load. It must be
because it is loading the index.html from the primary document root.
Which it does successfully (that seems like a security issue to me) and
which also does not reference that menu directory.

On 3/13/2011 10:40 PM, Francois Gingras wrote:
> On Sun, Mar 13, 2011 at 4:59 PM, Hossy <ho...@hossy.com> wrote:
>> 1. What are you typing to access it?
>> 2. Try removing the ":443" from your primary ServerName entry.  I believe
>> the port is defined inside the <VirtualHost> tag.
>>
>> -----Original Message-----
>> From: Dennis Putnam [mailto:dap1@bellsouth.net]
>> Sent: Sunday, March 13, 2011 1:27 PM
>> To: users@httpd.apache.org
>> Subject: [users@httpd] Virtual Host Directory Permissions Problem
>>
>> I am setting up a new virtual host and am having trouble with the root
>> directory. My new virtual host document root (/var/www/html/vhroot) is a
>> child directory of my primary host root (/var/www/html). Is it legal to do
>> that? When I try to access my new virtual host, I get the index from the
>> primary document root. TIA.
>>
>> Here are my virtual host directives:
>>
>> Primary
>>
>> <VirtualHost *>
>> DocumentRoot /var/www/html
>> ServerName primary.mydomain.com:443
>> <Directory "/var/www/html">
>> allow from all
>> Options +Indexes
>> </Directory>
>> </VirtualHost>
>>
>> New VH
>>
>> <VirtualHost *>
>> DocumentRoot "/var/www/html/vhroot"
>> ServerName newvh.mydomain.com
>> <Directory "/var/www/html/vhroot">
>> allow from all
>> Options +Indexes
>> </Directory>
>> </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
>>
>>
> There are several issues with your vhosts:
>
> 1) Assuming you want those to work on any interface, use *:PORT
> instead of *. Port 80 is for HTTP, and 443 is for HTTPS, normally.
>
> 2) Let's see httpd -S or apache2ctl -S under debian to see the full
> extent of your virtual hosts configuration.
>
> Frank.
>
> ---------------------------------------------------------------------
> 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] Virtual Host Directory Permissions Problem

Posted by Francois Gingras <fr...@gmail.com>.
On Sun, Mar 13, 2011 at 4:59 PM, Hossy <ho...@hossy.com> wrote:
> 1. What are you typing to access it?
> 2. Try removing the ":443" from your primary ServerName entry.  I believe
> the port is defined inside the <VirtualHost> tag.
>
> -----Original Message-----
> From: Dennis Putnam [mailto:dap1@bellsouth.net]
> Sent: Sunday, March 13, 2011 1:27 PM
> To: users@httpd.apache.org
> Subject: [users@httpd] Virtual Host Directory Permissions Problem
>
> I am setting up a new virtual host and am having trouble with the root
> directory. My new virtual host document root (/var/www/html/vhroot) is a
> child directory of my primary host root (/var/www/html). Is it legal to do
> that? When I try to access my new virtual host, I get the index from the
> primary document root. TIA.
>
> Here are my virtual host directives:
>
> Primary
>
> <VirtualHost *>
> DocumentRoot /var/www/html
> ServerName primary.mydomain.com:443
> <Directory "/var/www/html">
> allow from all
> Options +Indexes
> </Directory>
> </VirtualHost>
>
> New VH
>
> <VirtualHost *>
> DocumentRoot "/var/www/html/vhroot"
> ServerName newvh.mydomain.com
> <Directory "/var/www/html/vhroot">
> allow from all
> Options +Indexes
> </Directory>
> </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
>
>

There are several issues with your vhosts:

1) Assuming you want those to work on any interface, use *:PORT
instead of *. Port 80 is for HTTP, and 443 is for HTTPS, normally.

2) Let's see httpd -S or apache2ctl -S under debian to see the full
extent of your virtual hosts configuration.

Frank.

---------------------------------------------------------------------
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] Virtual Host Directory Permissions Problem

Posted by Hossy <ho...@hossy.com>.
1. What are you typing to access it?
2. Try removing the ":443" from your primary ServerName entry.  I believe
the port is defined inside the <VirtualHost> tag.

-----Original Message-----
From: Dennis Putnam [mailto:dap1@bellsouth.net] 
Sent: Sunday, March 13, 2011 1:27 PM
To: users@httpd.apache.org
Subject: [users@httpd] Virtual Host Directory Permissions Problem

I am setting up a new virtual host and am having trouble with the root
directory. My new virtual host document root (/var/www/html/vhroot) is a
child directory of my primary host root (/var/www/html). Is it legal to do
that? When I try to access my new virtual host, I get the index from the
primary document root. TIA.

Here are my virtual host directives:

Primary

<VirtualHost *>
DocumentRoot /var/www/html
ServerName primary.mydomain.com:443
<Directory "/var/www/html">
allow from all
Options +Indexes
</Directory>
</VirtualHost>

New VH

<VirtualHost *>
DocumentRoot "/var/www/html/vhroot"
ServerName newvh.mydomain.com
<Directory "/var/www/html/vhroot">
allow from all
Options +Indexes
</Directory>
</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