LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-08-2004, 08:50 PM   #1
Cigar
LQ Newbie
 
Registered: Jun 2003
Posts: 19

Rep: Reputation: 0
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
 
Old 02-08-2004, 09:01 PM   #2
synaptical
Senior Member
 
Registered: Jun 2003
Distribution: Mint 13/15, CentOS 6.4
Posts: 2,020

Rep: Reputation: 48
do you have a

DocumentRoot ~

in the Main Server section?
 
Old 02-08-2004, 09:15 PM   #3
Cigar
LQ Newbie
 
Registered: Jun 2003
Posts: 19

Original Poster
Rep: Reputation: 0
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

Last edited by Cigar; 02-08-2004 at 09:26 PM.
 
Old 02-08-2004, 09:37 PM   #4
synaptical
Senior Member
 
Registered: Jun 2003
Distribution: Mint 13/15, CentOS 6.4
Posts: 2,020

Rep: Reputation: 48
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.
 
Old 02-08-2004, 10:14 PM   #5
Cigar
LQ Newbie
 
Registered: Jun 2003
Posts: 19

Original Poster
Rep: Reputation: 0
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
 
Old 02-08-2004, 10:39 PM   #6
synaptical
Senior Member
 
Registered: Jun 2003
Distribution: Mint 13/15, CentOS 6.4
Posts: 2,020

Rep: Reputation: 48
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
 
Old 02-08-2004, 11:10 PM   #7
Cigar
LQ Newbie
 
Registered: Jun 2003
Posts: 19

Original Poster
Rep: Reputation: 0
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
 
Old 02-08-2004, 11:26 PM   #8
synaptical
Senior Member
 
Registered: Jun 2003
Distribution: Mint 13/15, CentOS 6.4
Posts: 2,020

Rep: Reputation: 48
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.

Last edited by synaptical; 02-08-2004 at 11:43 PM.
 
Old 02-09-2004, 10:13 AM   #9
Cigar
LQ Newbie
 
Registered: Jun 2003
Posts: 19

Original Poster
Rep: Reputation: 0
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
 
Old 02-09-2004, 01:49 PM   #10
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
I think the easier solution would have been to uncomment some of this stuff:
Code:
#<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>
Then your users would only have to worry about setting the appropriate perms on their public_html directory itself. This will allow them to protect the contents of their home directory that are not located in public_html.

Last edited by stickman; 02-09-2004 at 01:53 PM.
 
Old 02-10-2004, 01:52 PM   #11
Cigar
LQ Newbie
 
Registered: Jun 2003
Posts: 19

Original Poster
Rep: Reputation: 0
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

Last edited by Cigar; 02-10-2004 at 01:59 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache UserDir ]SK[ Linux - Software 4 06-18-2005 12:10 PM
Apache userdir. collen Linux - Networking 1 01-28-2005 12:24 PM
Apache UserDir Abbaddon Slackware 12 09-15-2004 11:28 AM
apache userdir subdomains kodon Linux - Networking 7 08-09-2004 07:16 PM
Question about apache UserDir Gilion Linux - Software 4 10-10-2003 12:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration