View previous topic :: View next topic |
Author |
Message |
Flux- n00b
Joined: 22 Nov 2003 Posts: 22 Location: Helsinki, Finland
|
Posted: Sun Nov 23, 2003 5:59 pm Post subject: Apache2 user directories don't work |
|
|
I just installed Apache 2. It shows fine my documenroot, but when I try to access an user directory I got a 403 Forbidden error.
I think the problem is in these parts of commonapache2.conf
Code: |
<Directory />
Options Indexes FollowSymLinks Multiviews
AllowOverride None
<IfModule mod_access.c>
Order deny,allow
Deny from all
</IfModule>
|
Code: |
<Directory /home/*/public_html>
AllowOverride All
Options MultiViews Indexes Includes FollowSymLinks
<IfModule mod_access.c>
Order allow,deny
Allow from all
</IfModule>
</Directory>
|
But I don't have any idea how to solve it.
I have tried many different permissions for public_html directory, but it hasn't help. |
|
Back to top |
|
|
ckdake l33t
Joined: 10 Apr 2003 Posts: 889 Location: Atlanta, GA
|
Posted: Sun Nov 23, 2003 6:37 pm Post subject: |
|
|
post the permissions for your user folder and your public_html folder.
i have :
Code: |
<Directory /home/*/public_html>
AllowOverride All
Options MultiViews +Indexes Includes FollowSymLinks
<IfModule mod_access.c>
Order allow,deny
Allow from all
</IfModule>
</Directory>
|
in my commonapache2.conf
and:
Code: |
ckdake@zion ckdake $ ls -al
total 60
drwx--x--x 7 ckdake users 4096 Nov 22 12:15 .
drwxr-xr-x 19 root root 4096 Nov 21 23:54 ..
...
drwxr-xr-x 11 ckdake users 4096 Nov 22 18:09 public_html
ckdake@zion ckdake $ cd public_html/
ckdake@zion public_html $ ls -al
total 72
drwxr-xr-x 11 ckdake users 4096 Nov 22 18:09 .
drwx--x--x 7 ckdake users 4096 Nov 22 12:15 ..
...
drwxr-xr-x 5 ckdake users 4096 Nov 22 18:09 gentoo
...
-rwxr--r-- 1 ckdake users 1073 Nov 17 21:37 index.php
...
|
and everything seems to work just fine on my server.
post the coresponding entry in /var/log/apache2/error_log _________________ http://ckdake.com/ |
|
Back to top |
|
|
Flux- n00b
Joined: 22 Nov 2003 Posts: 22 Location: Helsinki, Finland
|
Posted: Sun Nov 23, 2003 6:54 pm Post subject: |
|
|
Permissions for userfolder:
Code: |
flux@yume flux $ ls -al
total 48
drwx------ 9 flux users 4096 Nov 23 14:45 .
drwxr-xr-x 4 root root 4096 Nov 16 23:56 ..
drwxr-xr-x 2 flux users 4096 Nov 23 18:03 public_html
|
public_html:
Code: |
flux@yume flux $ cd public_html/
flux@yume public_html $ ls -al
total 12
drwxr-xr-x 2 flux users 4096 Nov 23 18:03 .
drwx------ 9 flux users 4096 Nov 23 14:45 ..
-rwxr-xr-x 1 flux users 52 Nov 23 18:03 index.html
|
And the commonapache2.conf:
Code: |
<Directory /home/*/public_html>
AllowOverride All
Options MultiViews Indexes Includes FollowSymLinks
<IfModule mod_access.c>
Order allow,deny
Allow from all
</IfModule>
</Directory>
|
|
|
Back to top |
|
|
ckdake l33t
Joined: 10 Apr 2003 Posts: 889 Location: Atlanta, GA
|
Posted: Sun Nov 23, 2003 7:07 pm Post subject: |
|
|
All of that looks fine.
post the lines from /var/log/apache2/error_log that give the specific error when you try to access the page. _________________ http://ckdake.com/ |
|
Back to top |
|
|
Flux- n00b
Joined: 22 Nov 2003 Posts: 22 Location: Helsinki, Finland
|
Posted: Sun Nov 23, 2003 7:11 pm Post subject: |
|
|
From the error_log:
Code: |
[Sun Nov 23 21:08:27 2003] [error] [client 80.186.34.96] (13)Permission denied: access to /~flux denied
|
It says the same for all users I try. So there must be still something that limits the permissions. |
|
Back to top |
|
|
ckdake l33t
Joined: 10 Apr 2003 Posts: 889 Location: Atlanta, GA
|
Posted: Sun Nov 23, 2003 7:26 pm Post subject: |
|
|
try putting a / on the end of the url, and try typing in the full url to the index.html file and post those error logs. Looking through my error_log, the only problems beginning with "(13)Permisison denied" are when one of my users set up his phblic_html and didn't set his permissions properly.
are you restarting apache2 each time you change the configuration file?
also, may help to post the relevant access_log entries for your tests that give you the error... _________________ http://ckdake.com/ |
|
Back to top |
|
|
Flux- n00b
Joined: 22 Nov 2003 Posts: 22 Location: Helsinki, Finland
|
Posted: Sun Nov 23, 2003 7:36 pm Post subject: |
|
|
error_log:
Code: |
[Sun Nov 23 21:18:11 2003] [error] [client 80.186.34.96] (13)Permission denied: access to /~flux denied
[Sun Nov 23 21:28:44 2003] [error] [client 80.186.34.96] (13)Permission denied: access to /~flux/ denied
[Sun Nov 23 21:28:48 2003] [error] [client 80.186.34.96] (13)Permission denied: access to /~flux/index.html denied
|
access_log:
Code: |
80.186.34.96 - - [23/Nov/2003:21:18:11 +0200] "GET /~flux HTTP/1.1" 403 421 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5b) Gecko/20030827"
80.186.34.96 - - [23/Nov/2003:21:28:44 +0200] "GET /~flux/ HTTP/1.1" 403 422 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5b) Gecko/20030827"
80.186.34.96 - - [23/Nov/2003:21:28:48 +0200] "GET /~flux/index.html HTTP/1.1" 403 432 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5b) Gecko/20030827"
|
I have restarted apache2 every time of course.
Here are the both conf-files too, if they are necessary:
http://yume.ath.cx/apache2.conf
http://yume.ath.cx/commonapache2.conf |
|
Back to top |
|
|
ckdake l33t
Joined: 10 Apr 2003 Posts: 889 Location: Atlanta, GA
|
Posted: Sun Nov 23, 2003 7:55 pm Post subject: |
|
|
hmm.. thats kinda weird. since you have "Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request." on your error page, it leads me to think that the problem is not with the user directory part of your setup, but something else.
I seem to remember someone with a simliar problem and i think it was because of symbolic links.
looking through you commonapache2.conf :
Code: |
<IfModule mod_userdir.c>
UserDir public_html
UserDir enabled flux linnea
UserDir disabled root
</IfModule> |
I don't know the specifics of the UserDir directive, but try taking out the second two lines. mine is:
Code: |
<IfModule mod_userdir.c>
UserDir public_html
</IfModule> |
My guess is userdir specifies the directory to use so you are telling it to use the directory "disabled" or "root".
Try that and post back what happens, other than that your conf files look good to me.. _________________ http://ckdake.com/ |
|
Back to top |
|
|
Flux- n00b
Joined: 22 Nov 2003 Posts: 22 Location: Helsinki, Finland
|
Posted: Sun Nov 23, 2003 9:23 pm Post subject: |
|
|
Oh, I actually totally forgot those. I removed them, but it didn't help :(
Still the same error in error_log. This is just too strange :/ |
|
Back to top |
|
|
ckdake l33t
Joined: 10 Apr 2003 Posts: 889 Location: Atlanta, GA
|
|
Back to top |
|
|
Flux- n00b
Joined: 22 Nov 2003 Posts: 22 Location: Helsinki, Finland
|
Posted: Mon Nov 24, 2003 8:24 am Post subject: |
|
|
I made the changes in my conf files (ok, not the servername and commented etc. ;) and restarted apache2. Still I got the same error. I guess the problem isn't then in apache2 conf files or in folder permissions. Are there any possibilites left anymore?
I want to get those user folders to work :) |
|
Back to top |
|
|
fleed l33t
Joined: 28 Aug 2002 Posts: 756 Location: London
|
Posted: Mon Nov 24, 2003 9:34 am Post subject: |
|
|
Your user directory must have eXecute permissions for others in order for the apache user to be able to chdir to public_html.
So it should look like (from your message below):
Code: | flux@yume flux $ ls -al
total 48
drwx-----x 9 flux users 4096 Nov 23 14:45 .
drwxr-xr-x 4 root root 4096 Nov 16 23:56 ..
drwxr-xr-x 2 flux users 4096 Nov 23 18:03 public_html |
instead of
Code: | flux@yume flux $ ls -al
total 48
drwx------ 9 flux users 4096 Nov 23 14:45 .
drwxr-xr-x 4 root root 4096 Nov 16 23:56 ..
drwxr-xr-x 2 flux users 4096 Nov 23 18:03 public_html |
(note the extra x at the end of the first line.)
You prolly know this but just do Code: | chmod a+x /home/flux | to fix it. |
|
Back to top |
|
|
Flux- n00b
Joined: 22 Nov 2003 Posts: 22 Location: Helsinki, Finland
|
Posted: Mon Nov 24, 2003 10:47 am Post subject: |
|
|
Wow, it works now. Thank you :) |
|
Back to top |
|
|
|