UserDir question apache
Hi ppl,
first of all great forum :) I searched the net this forum and other sources without finding a match to my problem here it is. I would like to enable UserDir feature but can't get the thing to work here's the error message when accessing the site thru a browser Forbidden You don't have permission to access /~Cigar on this server. Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request. my UserDir section under httpd.conf looks like UserDir: The name of the directory that is appended onto a user's home # directory if a ~user request is received. # 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 /home/*/public_html> # AllowOverride FileInfo AuthConfig Limit # 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> hopelly someone could help permissions problem , config problem ?!? looking to become a hero here's your chance :) thx Cigar |
do you have a
DocumentRoot ~ in the Main Server section? |
nope i got
DocumentRoot "/www/bluescreenofdeath.org/public_html" i've tryied ~ but would ask me for directory name then i tested "~" and "/home" but it's still not working any other clue or directive btw i have vhost running but would like also to use UserDir to ease the config a bit you know thx for your help |
DocumentRoot needs to be set to the directory on your server that holds your www directories/files. so for example if you have a standalone web server and all the user accounts are in /home, you would make the DocumentRoot ~, and the users' home directories should then be accessible.
don't forget to run apachectl graceful as root after making config changes to httpd.conf. |
i'm so sorry but no luck putting ~ as DocumentRoot return me some error message saying must be directory then i tryied "~" or "/home" , "/home" it won't work
just to make sure of what the line should be # DocumentRoot: The directory out of which you will serve your # documents. By default, all requests are taken from this directory, but # symbolic links and aliases may be used to point to other locations. #DocumentRoot "/www/bluescreenofdeath.org/public_html" DocumentRoot ~ <--- this has mentionned above doing so return me some error messages. any other clue sorry and thx again |
i guess at this point it would be helpful to see your whole httpd.conf file. also, what do you get when you do apachectl configtest? thnks
|
read it somewhere else than under windows cause the format his all incorrect but I assume that u got acces to an *nix browser nor OS.
my httpd.conf file thx you again for your time |
okay, if your html files are in /home/Cigar, change your DocumentRoot to ~
DocumentRoot ~ then down below that, change the <Directory> to that also: # This should be changed to whatever you set DocumentRoot to. # <Directory "~"> then run apachectl graceful (or apachectl start, restart, etc.) if that doesn't work, try the absolute pathname, i.e., /home, but afaik, it should be okay to just use the ~. it looks like you aren't using port 80, but have bound apache to other ports. so don't forget to add those to the URL, for ex: http://www.bluescreenofdeath.org:666/~Cigar/index.html >edit: actually, i'm not sure if with the listen setting you have to use the port number in the url or not. try it both ways if it doesn't work with it added. -- edit2: it seems it's not needed. :) < i think the point of using the UserDir directive is so that you *don't* have to add public_html to the URL, but it will be appended by apache. iow, your users will have a place in their home directory to put files that doesn't have to show up in the URL. so in this case, you would add a public_html directory to your Cigar directory, and then for example put index.html in public_html. then when you called www.bluescreenofdeath.org/~Cigar/ index.html would be what showed up. i've never used it, but i think that's how it works. |
I finally manage to get the thing to work only problem is i need to chmod 755 each homedir (~) wich is not secure at all. Is there something that I might be missing
any <directory> argument i should try ? i've read == > this but it was no help maybe someone could think of something. thx again |
I think the easier solution would have been to uncomment some of this stuff:
Code:
#<Directory /home/*/public_html> |
thx for everyone's help here how i've fixed the problem
reading this section from an old httpd.conf was really helpful # UserDir: The name of the directory that is appended onto a user's home # directory if a ~user request is received. # # The path to the end user account 'public_html' directory must be # accessible to the webserver userid. This usually means that ~userid # must have permissions of 711, ~userid/public_html must have permissions # of 755, and documents contained therein must be world-readable. # Otherwise, the client will only receive a "403 Forbidden" message. # # See also: http://httpd.apache.org/docs/misc/FAQ.html#forbidden this only was the thing I needed to add no <directory> chmod and that was enough <IfModule mod_userdir.c> # # UserDir is disabled by default since it can confirm the presence # of a username on the system (depending on home directory # permissions). # # UserDir #UserDir enable username you like # # To enable requests to /~user/ to serve the user's public_html # directory, remove the "UserDir disable" line above, and uncomment # the following line instead: # UserDir public_html </IfModule> thx again for your help everyone |
All times are GMT -5. The time now is 10:24 AM. |