FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 09-29-2012, 09:59 PM
Allan Gottlieb
 
Default USERDIR problem with apache on new install (SOLVED)

On Sat, Sep 29 2012, Allan Gottlieb wrote:

> On my new install USERDIR is not working.
>
> When I try http://localhost/~gottlieb, firefox says
> "you don't have permission to access /~gottlieb"
> and the apache error log says
> "client denied by server configuration: /local/allan/gottlieb/public_html"
>
> The file permissions are ok since both
> file:///home/gottlieb/public_html/index.html and
> file:///home/gottlieb/public_html
> work fine.
>
> So I guess I screwed up the apache install, in particular USERDIR.
>
> eix shows userdir (see below)
>
> /etc/conf.d/apache2 has it (see below, diffs = with my working install)
>
> I have restarted apache, shutdown the machine overnight, reinstalled
> apache, but still no go.
>
> What step did I foolishly miss?
>
> thanks,
> allan

Finally! I have a filesystem mounted on /local for my local files
including my home directory /local/allan/gottlieb.
I put in a symlink /home -> /local/allan/gottlieb
so that programs looking in /home would be happy.
I had /etc/passwd say /local/allan/gottlieb since it is the real
directory.

apache doesn't like this. There is probably an option to let it do this
since it has several options on symlinks

However I simply changed /etc/passwd to say /home/gottlieb and apache
is happy.

allan
 
Old 09-29-2012, 10:14 PM
Michael Hampicke
 
Default USERDIR problem with apache on new install (SOLVED)

Am 29.09.2012 23:59, schrieb Allan Gottlieb:
> On Sat, Sep 29 2012, Allan Gottlieb wrote:
>
>> On my new install USERDIR is not working.
>>
>> When I try http://localhost/~gottlieb, firefox says
>> "you don't have permission to access /~gottlieb"
>> and the apache error log says
>> "client denied by server configuration: /local/allan/gottlieb/public_html"
>>
>> The file permissions are ok since both
>> file:///home/gottlieb/public_html/index.html and
>> file:///home/gottlieb/public_html
>> work fine.
>>
>> So I guess I screwed up the apache install, in particular USERDIR.
>>
>> eix shows userdir (see below)
>>
>> /etc/conf.d/apache2 has it (see below, diffs = with my working install)
>>
>> I have restarted apache, shutdown the machine overnight, reinstalled
>> apache, but still no go.
>>
>> What step did I foolishly miss?
>>
>> thanks,
>> allan
>
> Finally! I have a filesystem mounted on /local for my local files
> including my home directory /local/allan/gottlieb.
> I put in a symlink /home -> /local/allan/gottlieb
> so that programs looking in /home would be happy.
> I had /etc/passwd say /local/allan/gottlieb since it is the real
> directory.
>
> apache doesn't like this. There is probably an option to let it do this
> since it has several options on symlinks
>
> However I simply changed /etc/passwd to say /home/gottlieb and apache
> is happy.
>
> allan
>

There's an option called FollowSymlinks which you can set per directory
to allow apache to... yeah, follow symlinks

Look for FollowSymlinks on http://httpd.apache.org/docs/2.2/mod/core.html
 
Old 09-30-2012, 01:39 AM
Allan Gottlieb
 
Default USERDIR problem with apache on new install (SOLVED)

On Sat, Sep 29 2012, Michael Hampicke wrote:

> Am 29.09.2012 23:59, schrieb Allan Gottlieb:
>> On Sat, Sep 29 2012, Allan Gottlieb wrote:
>>
>>> On my new install USERDIR is not working.
>>>
>>> When I try http://localhost/~gottlieb, firefox says
>>> "you don't have permission to access /~gottlieb"
>>> and the apache error log says
>>> "client denied by server configuration: /local/allan/gottlieb/public_html"
>>>
>>> The file permissions are ok since both
>>> file:///home/gottlieb/public_html/index.html and
>>> file:///home/gottlieb/public_html
>>> work fine.
>>>
>>> So I guess I screwed up the apache install, in particular USERDIR.
>>>
>>> eix shows userdir (see below)
>>>
>>> /etc/conf.d/apache2 has it (see below, diffs = with my working install)
>>>
>>> I have restarted apache, shutdown the machine overnight, reinstalled
>>> apache, but still no go.
>>>
>>> What step did I foolishly miss?
>>>
>>> thanks,
>>> allan
>>
>> Finally! I have a filesystem mounted on /local for my local files
>> including my home directory /local/allan/gottlieb.
>> I put in a symlink /home -> /local/allan/gottlieb
>> so that programs looking in /home would be happy.
>> I had /etc/passwd say /local/allan/gottlieb since it is the real
>> directory.
>>
>> apache doesn't like this. There is probably an option to let it do this
>> since it has several options on symlinks
>>
>> However I simply changed /etc/passwd to say /home/gottlieb and apache
>> is happy.
>>
>> allan
>>
>
> There's an option called FollowSymlinks which you can set per directory
> to allow apache to... yeah, follow symlinks
>
> Look for FollowSymlinks on http://httpd.apache.org/docs/2.2/mod/core.html

Yes. It was seeing that option that trigger me to believe symlinks
could have been the problem. It was easier to eliminate the one from
the "official home dir" to the "real home dir" than to understand if the
option would help. My lack of confidence was because the place I found
the option, it was turned on.

# 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 Indexes
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>

It looked to me that I was the owner and the follower. But as I said it
seemed easier to eliminate the problematic symlink than to figure out
where and when to set the option. Perhaps just changing
SymLinksIfOwnerMatch to FollowSymlinks would have done it.

allan
 
Old 09-30-2012, 06:42 AM
Andrea Conti
 
Default USERDIR problem with apache on new install (SOLVED)

Hello,

> I put in a symlink /home -> /local/allan/gottlieb
> so that programs looking in /home would be happy.
> I had /etc/passwd say /local/allan/gottlieb since it is the real
> directory.
>
> apache doesn't like this. There is probably an option to let it do this
> since it has several options on symlinks

It's not about liking... mod_userdir automatically maps a URL in the
form ~/foo onto user foo's home dir, as it is recorded in the system's
user database. If you put /local/allan/gottlieb there, apache tries to
serve files directly from /local/allan/gottlieb.

The default mod_userdir configuration
(/etc/apache2/modules.d/00_mod_userdir.conf, of which you pasted an
excerpt in the other email) only sets an "Allow from all" for
directories in the form "/home/*/public_html", which does not include
anything under /local.

You can either change your home directory, or add

<Directory /local/allan/gottlieb>
Order allow,deny
Allow from all

[whatever other options you need]
</Directory>

in the apache config for the virtualhost you're using.

As for the "FollowSymlinks" and "SymlinksIfOwnerMatch" options, I'm not
sure they apply here: they should only affect whether the server follows
symlinks *within* the document root, not symlinks in the path *leading
to* the document root.

andrea
 
Old 09-30-2012, 04:36 PM
Allan Gottlieb
 
Default USERDIR problem with apache on new install (SOLVED)

On Sun, Sep 30 2012, Andrea Conti wrote:

> The default mod_userdir configuration
> (/etc/apache2/modules.d/00_mod_userdir.conf, of which you pasted an
> excerpt in the other email) only sets an "Allow from all" for
> directories in the form "/home/*/public_html", which does not include
> anything under /local.
>
> You can either change your home directory, or add
>
> <Directory /local/allan/gottlieb>
> Order allow,deny
> Allow from all
>
> [whatever other options you need]
> </Directory>

I see. I prefer changing my home directory as nothing needs to be done
with new apache releases.

> As for the "FollowSymlinks" and "SymlinksIfOwnerMatch" options, I'm not
> sure they apply here: they should only affect whether the server follows
> symlinks *within* the document root, not symlinks in the path *leading
> to* the document root.

OK.

thank you very much for the clear explanations.
allan
 

Thread Tools




All times are GMT. The time now is 12:15 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org