Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 32767 - Permission denied on vhosts in apache2
Summary: Permission denied on vhosts in apache2
Status: VERIFIED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Apache Team - Bugzilla Reports
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-04 21:03 UTC by Steven Wagner
Modified: 2005-04-23 19:40 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steven Wagner 2003-11-04 21:03:04 UTC
I setup vhosts in apache2  2.0.48

I create folders named /var/www/mydomains.com
and entered the proper entries into my vhosts.conf
I was getting a permission denied message until I found this setting in my commonapache2.conf

<Directory /var/www/localhost/htdocs>
which needed to be changed to
<Directory /var/www>
in order for apache to serve pages.  

if the intention is for users to create folders for their domains in /var/www , which is what I am assuming it is ... then this setting is an error and should be changed as I did.
Comment 1 SpanKY gentoo-dev 2003-11-04 23:02:38 UTC
no, do not change it to /var/www

add additional directory defines for each subdir ... 1 directory define per
vhost ...
Comment 2 Joakim 2003-11-05 03:58:34 UTC
Or you can also add them under ../htdocs, as I previously had my domains
under /home/httpd/htdocs/www/ I simply moved them to /var/www/localhost/htdocs/www/

You can still create specific directory rules for each domain, but you get
the advantage of have the basic default in one place.
Comment 3 Steven Wagner 2003-11-05 04:29:01 UTC
GLEP 11 defines the Document Root location as 
/var/www/<fully qualified domain name>/

If there is a reason someone can show for doing this in the "1 directory
define per vhost" way, then the vhost.conf template should be updated for
the user so that the vhost example works. How is the vhost-config tool planning
to manage this?
Comment 4 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-11-05 09:51:39 UTC
for you default rules, consider using DirectoryMatch blocks instead of Directory
blocks.

the actual last field of /var/www/$FQDN/ will be customizable as to how it
works, as single level splitting is a PITA when you have lots of vhosts.
I personally use /var/www/$DOMAIN/$HOST/ as my htdocs directory for each
vhost.
Comment 5 Chuck Short (RETIRED) gentoo-dev 2004-04-05 06:11:09 UTC
Should this bug be closed?
Comment 6 Stuart Herbert (RETIRED) gentoo-dev 2004-04-05 12:52:39 UTC
Please read the config files under /etc/apache2/conf/vhosts/ to see different ways to perform virtual hosting on a server.  There is also plenty of very clear documentation on the Apache web site on which configuration directives to use.

Although there's a lot we can do to improve our apache config files, what you're suggesting is not how Apache is meant to be configured.  Closing bug.

Best regards,
Stu
Comment 7 Elfyn McBratney (beu) (RETIRED) gentoo-dev 2005-04-23 19:40:56 UTC
Closing.