User Directories On FreeBSD 8.0-RELEASE

Jerry McAllister jerrymc at msu.edu
Thu Feb 18 22:45:34 UTC 2010


On Thu, Feb 18, 2010 at 02:09:20PM -0600, Programmer In Training wrote:

> On 02/18/10 13:46, Chuck Swiger wrote:
> <snip>
> > Whether the path to user home directories is honored or whether
> > Apache goes somewhere else for HTTP requests for /~user/foo.html
> > depends on what you set UserDir to:
> > 
> > http://httpd.apache.org/docs/2.2/mod/mod_userdir.html
> > 
> > It's possible that using:
> > 
> > UserDir /usr/home/*/public_html
> > 
> > ....will do better, if that is the actual path being used.
> 
> That's what I have it set to and it isn't honoring that. That's part of
> what is bothering me (and what I suspect the issue might be).

Hmmm.  I haven't followed this thread much, so you may have dealt
with this already or specified some need I don't see here.  

Is it possible that you do not have the mod_UserDir installed?
It won't do any of this without that.   You can do:   'httpd -M'  to
list which modules are loaded.   (You may have to put the full path
on the httpd command - /usr/local/sbin/httpd  might be typical)

Is it possible that permissions somewhere along the path to the 
users' web site directories are getting in the way?  The files need
read permission and directories need read and execute permission. 


Secondly,  Although  'UserDir /usr/home/*/public_html'   appears to 
be listed as one possible syntax in that mod_userdir doc, but I never 
use it that way.

If you want Apache httpd to look in the passwd file, pull out the 
home directory string and append the value of  UserDir  on to it to 
get the path to the start of the web site then I would set UserDir
more simply, as follows.

I set it to something like:

  UserDir public_html

If you want  ~username/public_html  to be where that user's web site starts.   

Of course, the exact path spec depends on how you define the home directory. 
This assumes that /home/username  is what is entered in the /etc/passwd file.

Since the doc says the UserDir  /home/*/public_html  is an accepted 
syntax, probably the problem lies in getting the path names correct 
and getting the file and directory permissions set correctly. 

The simpler form I use would seem to me to introduce less confusion
getting the paths correct.

I think those other syntax forms are intended for use when the web 
sites are set up to start in some directory tree other than the users' 
own home directories.   This might be the case if you create space for 
a web site, but do not allow logins - so the users do not actually 
have home directories.   

Just some stabs in the dark,

////jerry



> 
> >> See, now that's helpful. Thank you. No one suggested that. Will add
> >> it and see if that changes anything.
> > 
> > I suspect you already have it, according to what you'd shown in the
> > prior mail.  Using FollowSymLinks instead might be necessary
> > depending on what you do with UserDir.
> 
> I did, but now I have both in the httpd-userdir.conf to no avail, same
> with main conf.
> 
> <snip>
> >> I rolled my own because I couldn't even get Apache from ports to
> >> start with the default http.conf file provided.
> > 
> > Hmm, unexpected.  What did apachectl configtest say?
> <snip>
> 
> I don't remember, but I was so frustrated I wasn't really paying that
> much attention (it's been a month since I tried ports Apache).
> 
> 
> Alright, here is the errors I'm getting (I set the loglevel to debug
> instead of just warn):
> 
> [Thu Feb 18 14:01:01 2010] [notice] Apache/2.2.14 (Unix) configured --
> resuming normal operations
> [Thu Feb 18 14:01:01 2010] [info] Server built: Feb 13 2010 06:46:20
> [Thu Feb 18 14:01:01 2010] [debug] prefork.c(1013): AcceptMutex: flock
> (default: flock) <--- not sure what that is all about
> [Thu Feb 18 14:01:08 2010] [error] [client 127.0.0.1] client denied by
> server configuration: /home/user1/public_html
> [Thu Feb 18 14:01:10 2010] [error] [client 127.0.0.1] client denied by
> server configuration: /home/user1/public_html
> 
> UserDir file configuration:
> 
> UserDir disabled
> UserDir enabled user1 user2
> ^^^^^<--- Those options as per the UserDir section in the manual, just
> added them not two minutes before typing this out
> UserDir public_html
> 
> #
> # Control access to UserDir directories.  The following is an example
> # for a site where these directories are restricted to read-only.
> #
> <Directory /usr/home/*/public_html>
>     AllowOverride FileInfo AuthConfig Limit Indexes
>     Options MultiViews Indexes FollowSymlinks SymLinksIfOwnerMatch
> IncludesNoExec
>     <Limit GET POST OPTIONS>
>         Order allow,deny
>         Allow from all
>     </Limit>
>     <LimitExcept GET POST OPTIONS>
>         Order deny,allow
>         Deny from all
>     </LimitExcept>
> </Directory>
> 
> 
> This really stinks. Is Apache 1.13 available? I don't remember having
> these problems with it.
> -- 
> Yours In Christ,
> 
> PIT
> Emails are not formal business letters, whatever businesses may want.
> 




More information about the freebsd-questions mailing list