Web Servers on Unix and Linux - "public_html" for each user don"t work.

This is Interesting: Free IT Magazines  
Home > Archive > Web Servers on Unix and Linux > July 2006 > "public_html" for each user don"t work.





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author "public_html" for each user don"t work.
pom2001

2006-06-27, 1:17 pm

Dear Sir,
I used Apache/2.0.52 that come with Fedora Core 3. I want to config
"public_html" for each user in file "httpd.conf" but don"t work.
I config httpd.conf below.
#UserDir disable
UserDir public_html

#<Directory /home/*/public_html>
# AllowOverride FileInfo AuthConfig Limit
# Options MultiViews Indexes 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>

When used IE browser to access "http://x.x.x.x/~manuser",
it has error message in "error_log" show below.

[Tue Jun 27 18:55:55 2006] [error] [client 250.168.180.156] (13)
Permission denied: access to /~manuser/ denied

And error message in IE browser show below.

Forbidden
You don't have permission to access /~manuser/ on this server.
Additionally, a 403 Forbidden error was encountered while trying
to use an ErrorDocument to handle the request.

More detail about permission in home directory show below.
# ls -ld /home
drwx--x--x 7 root root 4096 Jun 26 15:17 /home
# ls -ld /home/manuser/
drwx--x--x 6 manuser manuser 4096 Jun 27 17:23 /home/manuser/
# ls -ld /home/manuser/public_html/
drwxr-xr-x 2 manuser manuser 4096 Jun 27 17:23
/home/manuser/public_html/

Please let me know how to solve this problem.
Thanks & Best Regards,
Tom.

Werner Flamme

2006-06-27, 1:17 pm

pom2001 schrieb am 27.06.2006 14:26:
> Dear Sir,
> I used Apache/2.0.52 that come with Fedora Core 3. I want to config
> "public_html" for each user in file "httpd.conf" but don"t work.
> I config httpd.conf below.
> #UserDir disable
> UserDir public_html
>
> #<Directory /home/*/public_html>
> # AllowOverride FileInfo AuthConfig Limit
> # Options MultiViews Indexes 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>
>
> When used IE browser to access "http://x.x.x.x/~manuser",
> it has error message in "error_log" show below.
>
> [Tue Jun 27 18:55:55 2006] [error] [client 250.168.180.156] (13)
> Permission denied: access to /~manuser/ denied
>
> And error message in IE browser show below.
>
> Forbidden
> You don't have permission to access /~manuser/ on this server.
> Additionally, a 403 Forbidden error was encountered while trying
> to use an ErrorDocument to handle the request.
>
> More detail about permission in home directory show below.
> # ls -ld /home
> drwx--x--x 7 root root 4096 Jun 26 15:17 /home
> # ls -ld /home/manuser/
> drwx--x--x 6 manuser manuser 4096 Jun 27 17:23 /home/manuser/
> # ls -ld /home/manuser/public_html/
> drwxr-xr-x 2 manuser manuser 4096 Jun 27 17:23
> /home/manuser/public_html/
>
> Please let me know how to solve this problem.
> Thanks & Best Regards,
> Tom.
>

Tom,

because you did not uncomment the <Directory /home/*/public_html> section,
those public_html directories inherit their (access) rigthts from / - and
this is "deny from all". You should uncomment the lines in this section,
restart apache and see what happens.

HTH,
Werner
pom2001

2006-06-27, 1:17 pm

I config again that show below but still problem.

<Directory /home/*/public_html>
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes 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>

How to solve ?
Thanks & Best Regards,
Tom.

Werner Flamme wrote:
> pom2001 schrieb am 27.06.2006 14:26:
> Tom,
>
> because you did not uncomment the <Directory /home/*/public_html> section,
> those public_html directories inherit their (access) rigthts from / - and
> this is "deny from all". You should uncomment the lines in this section,
> restart apache and see what happens.
>
> HTH,
> Werner


faxe

2006-06-27, 7:16 pm

pom2001 napisał(a):
> I config again that show below but still problem.
>
> <Directory /home/*/public_html>


you mean: <Directory ~"/home/[^/]+/public_html">

Check for documentation:
http://httpd.apache.org/docs/2.0/mo....html#directory

> AllowOverride FileInfo AuthConfig Limit
> Options MultiViews Indexes 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>
>
> How to solve ?


Does your Apache has the right to access 'public_html' folders? Check,
if users' homedirectories have at least 0711 mode. And another thing:

http://httpd.apache.org/docs/2.0/mo...l#allowoverride
"Only available in <Directory> sections
AllowOverride is valid only in <Directory> sections specified without
regular expressions, not in <Location>, <DirectoryMatch> or <Files>
sections."

So you'll have to put something like:

<Directory /home>
AllowOverride FileInfo AuthConfig Limit
</Directory>

either.
pom2001

2006-06-28, 7:22 am

I"m still problem.
Can not access "http://xxx.xxx.xxx.xxx/~manuser" on
Fedora Core 3 with Apache/2.0.52.
It has error in "error_log" show below,

[Wed Jun 28 18:31:08 2006] [error] [client 210.168.195.131]
(13)Permission
denied: access to /~manuser denied

My "httpd.conf" show below.
http://203.121.168.10/httpd.conf.txt

Other information on my Linux Server show below.
# grep manuser /etc/passwd
manuser:x:500:500:Man USER:/home/manuser:/bin/bash

# ls -ld /home
drwxr-xr-x 7 root root 4096 Jun 28 09:53 /home

# ls -ld /home/manuser/
drwxr-xr-x 6 manuser manuser 4096 Jun 27 17:23 /home/manuser/

# ls -ld /home/manuser/public_html/
drwxr-xr-x 2 manuser manuser 4096 Jun 27 17:23
/home/manuser/public_html/

Have any idea ?
Tom.

faxe wrote:
> pom2001 napisa=B3(a):
>
> you mean: <Directory ~"/home/[^/]+/public_html">
>
> Check for documentation:
> http://httpd.apache.org/docs/2.0/mo....html#directory
>
>
> Does your Apache has the right to access 'public_html' folders? Check,
> if users' homedirectories have at least 0711 mode. And another thing:
>
> http://httpd.apache.org/docs/2.0/mo...l#allowoverride
> "Only available in <Directory> sections
> AllowOverride is valid only in <Directory> sections specified without
> regular expressions, not in <Location>, <DirectoryMatch> or <Files>
> sections."
>
> So you'll have to put something like:
>
> <Directory /home>
> AllowOverride FileInfo AuthConfig Limit
> </Directory>
>=20
> either.


Mitto

2006-06-28, 1:20 pm

Hi Tom,

I have seen that you have not configured any virtual host on your
apache. I think if you tried below code, it may be useful for you:

-------------------
<VirtualHost xx.xx.xx.xx>
ServerAlias domainname.com
ServerAdmin webmaster@domainname.com
DocumentRoot /home/hoemdir/public_html
BytesLog /your/log/path
ServerName www.domainname.com

User username
Group groupname

CustomLog /your/log/path combined

</VirtualHost>
----------------

Change your domainname.com with your domain name and username with the
correct username I think in this case it may be manuser and homedir
with your user's home directory that path may like:
/home/manuser/public_html/

Have a try from your end.

Regards,

Manuel S.
--------------------



pom2001 wrote:[vbcol=seagreen]
> I"m still problem.
> Can not access "http://xxx.xxx.xxx.xxx/~manuser" on
> Fedora Core 3 with Apache/2.0.52.
> It has error in "error_log" show below,
>
> [Wed Jun 28 18:31:08 2006] [error] [client 210.168.195.131]
> (13)Permission
> denied: access to /~manuser denied
>
> My "httpd.conf" show below.
> http://203.121.168.10/httpd.conf.txt
>
> Other information on my Linux Server show below.
> # grep manuser /etc/passwd
> manuser:x:500:500:Man USER:/home/manuser:/bin/bash
>
> # ls -ld /home
> drwxr-xr-x 7 root root 4096 Jun 28 09:53 /home
>
> # ls -ld /home/manuser/
> drwxr-xr-x 6 manuser manuser 4096 Jun 27 17:23 /home/manuser/
>
> # ls -ld /home/manuser/public_html/
> drwxr-xr-x 2 manuser manuser 4096 Jun 27 17:23
> /home/manuser/public_html/
>
> Have any idea ?
> Tom.
>
> faxe wrote:

faxe

2006-06-28, 1:20 pm

pom2001 wrote:

> # ls -ld /home
> drwxr-xr-x 7 root root 4096 Jun 28 09:53 /home
>
> # ls -ld /home/manuser/
> drwxr-xr-x 6 manuser manuser 4096 Jun 27 17:23 /home/manuser/
>
> # ls -ld /home/manuser/public_html/
> drwxr-xr-x 2 manuser manuser 4096 Jun 27 17:23
> /home/manuser/public_html/
>
> Have any idea ?


I copied your httpd.conf, run Apache with it and it worked fine. I've
got the same access permissions for /home, ~ and ~/public_html. My last
guess is that index.html inside the public_html/ directory isn't
readable by "apache" system user. In that case I get:

[error] [client 127.0.0.1] (13)Permission denied: file permissions deny
server access: /home/faxe/public_html/index.html

in my error_log (Apache 2.2 adds additional info about source of the
error). This should fix the problem:

$ chmod -R 744 /home/manuser/public_html
[vbcol=seagreen]

Err, that wasn't quite true - your UNIX-like wildcard path was correct
and you can legally use AllowOverride inside such <Directory> block.

--
Pawel Zdziarski
pom2001

2006-06-30, 1:18 pm

faxe wrote:
> pom2001 wrote:
>
>
> I copied your httpd.conf, run Apache with it and it worked fine. I've
> got the same access permissions for /home, ~ and ~/public_html. My last
> guess is that index.html inside the public_html/ directory isn't
> readable by "apache" system user. In that case I get:
>
> [error] [client 127.0.0.1] (13)Permission denied: file permissions deny
> server access: /home/faxe/public_html/index.html
>
> in my error_log (Apache 2.2 adds additional info about source of the
> error). This should fix the problem:
>
> $ chmod -R 744 /home/manuser/public_html
>
>
> Err, that wasn't quite true - your UNIX-like wildcard path was correct
> and you can legally use AllowOverride inside such <Directory> block.
>
> --
> Pawel Zdziarski


Now user that have home directory under "/home" is working well,
but user that have home directory under "/office" don"t work.

When access "http://xxx.xxx.xxx.xxx/~supply ", in "error_log"
show below.

[Fri Jun 30 20:56:26 2006] [error] [client 226.168.151.53]
(13)Permission
denied: access to /~supply denied

My "httpd.conf" show below
http://203.121.168.10/httpd.conf.txt

My information about user "supply" show below.
http://203.121.168.10/supply-user.txt

Have any idea ?

Tom.

faxe

2006-06-30, 7:17 pm

pom2001 napisał(a):

> [Fri Jun 30 20:56:26 2006] [error] [client 226.168.151.53]
> (13)Permission
> denied: access to /~supply denied


Again, I've copied your directives, created the same hierarchy of
directories, added new user, created public_html and chmoded it... and
it works correctly. At first moment I forgot to add "Options
FollowSymlinks" to <Directory /> block and thought that was the problem
- but after doing so there was no problem at all... creepy.

Here's my environment: http://p-zet.webpark.pl/env.txt

Forgotten .htaccess left somewhere, maybe?

--
Pozdrawiam / Best regards
Pawel Zdziarski
gmail: faxepl
pom2001

2006-07-01, 1:21 am

faxe =E0=B9=80=E0=B8=82=E0=B8=B5=E0=B8=A2=E0=
B8=99:
> pom2001 napisa=C2=B3(a):
>
>
> Again, I've copied your directives, created the same hierarchy of
> directories, added new user, created public_html and chmoded it... and
> it works correctly. At first moment I forgot to add "Options
> FollowSymlinks" to <Directory /> block and thought that was the problem
> - but after doing so there was no problem at all... creepy.
>
> Here's my environment: http://p-zet.webpark.pl/env.txt
>
> Forgotten .htaccess left somewhere, maybe?
>

I don"t understand. How about .htaccess and do you mean to
config "httpf.conf" below.

<Directory />
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
FollowSymlinks
<Limit GET POST OPTIONS>
Order allow,deny
Allow from all
</Limit>
</Directory>

Please tell me more detail because the first time for me to config
Apache 2.x.
Hope you can help me.
Best Regards,
Tom.

pom2001

2006-07-01, 1:21 am

> Again, I've copied your directives, created the same hierarchy of
> directories, added new user, created public_html and chmoded it... and
> it works correctly. At first moment I forgot to add "Options
> FollowSymlinks" to <Directory /> block and thought that was the problem
> - but after doing so there was no problem at all... creepy.
>
> Here's my environment: http://p-zet.webpark.pl/env.txt
>
> Forgotten .htaccess left somewhere, maybe?
>


Can you show "httpd.conf" and ".htaccess" to me ?

pom2001

2006-07-02, 1:35 pm

I create "testing" user for tesing "public_html".
At first time "testing" user have home directory under
"/export3/home3/office3" is
working well. More detail below.

# grep testing /etc/passwd
testing:x:30000:100::/export3/home3/office3/testing:/bin/bash

And httpd.conf below.
<Directory /export3/home3/office3/*/public_html>
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
Order allow,deny
Allow from all
</Directory>

But later if I used "usermod" command to change home directory
under "/export3/home3/office3" to under "/office3", it don"t work.
***Note*** "office3" is link file.
More detail below.

# usermod -d /office3/testing -m testing

# grep testing /etc/passwd
testing:x:30000:100::/office3/testing:/bin/bash

# ls -ld /office3
lrwxrwxrwx 1 root root 22 Jul 2 18:48 /office3 ->
/export3/home3/office3

And config httpd.conf again below.

<Directory /office3/*/public_html>
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
Order allow,deny
Allow from all
</Directory>

But can"t access "public_html".
Is Apache 2.x support link file ? (/office3)
I must used link file for use short path.
How I do ?

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com