You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by John Turner <jo...@gmail.com> on 2007/03/05 17:46:54 UTC

[users@httpd] DocumentRoot and UserDir conflict?

Hello -

I'm using Apache 2.0.47.  Due to site admin policies, I have limited
control of Apache's configuration, but am allowed to
supplement/override global config statements with the use of an
Include in httpd.conf.

I have a lot of Apache experience, but it is mostly virtual hosting
and mod_jk configuration on systems where I have total control. I've
read the documentation for DocumentRoot and UserDir, and have spent
the morning googling, but haven't found any previous discussions about
my specific issue, so I'm hoping folks here can help.

Goal: enable per-user directories so that developers can test code in
their own environments before pushing to a QA server.  This means HTML
as well as perl CGI in a conventional cgi-bin setup.

So far, I've got mod_userdir enabled, and the following directives configured:

UserDir disabled
UserDir /thishost/u/*/public_html
UserDir enabled john

<Directory /thishost/u/*/public_html>
    AllowOverride FileInfo AuthConfig Limit Indexes
    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
    <Limit GET POST OPTIONS PROPFIND>
        Order allow,deny
        Allow from all
    </Limit>
    <LimitExcept GET POST OPTIONS PROPFIND>
        Order deny,allow
        Deny from all
    </LimitExcept>
</Directory>
<Directory /thishost/u/*/public_html/cgi-bin/>
    Options ExecCGI
    SetHandler cgi-script
</Directory>

My problem:

When I try to browse to http://devhost/~john, Apache is not looking in
/thishost/u/~john/public_html as expected.

Instead, it is looking in /proj/site/www/~john, as shown by the error log:

[Mon Mar 05 16:09:06 2007] [error] [client 1.2.3.4] File does not
exist: /proj/site/www/~john

"/proj/site/www" is the document root for the entire server.  I don't
have permission to change this, nor can I get it changed by asking.

How can I override the global config or otherwise "persuade" Apache to
look in "/thishost/u/~john" instead of "/proj/site/www/~john"?
There's no mention in the UserDir documentation that the UserDir has
to be a subdirectory of DocumentRoot, so it looks like I'm missing
something.

I've tried various combinations of "disable" and "enable" with the
UserDir directive, and have also tried various position combinations
with the three UserDir directives shown above, such as putting
"disable" first, then the path, or the path first, then "disable"
second, etc.  No combination that I've tried gets me the ability to
serve pages and CGI out of my homedir.

Any and all help is appreciated...thank you in advance!

John

---------------------------------------------------------------------
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