# apache userdir permission denied

## cjubon

Sorry for this post, it's probably something that one should figure out oneself   :Embarassed: . Something in my brain seems to be blocked, though.

Whenever I try to access my localhost user directory, I get a 403 permission denied.

This is the relevant part of my httpd.conf: 

```
<IfDefine USERDIR>

LoadModule userdir_module modules/mod_userdir.so

</IfDefine>

...

Include /etc/apache2/modules.d/*.conf
```

And here's /etc/apache2/modules.d/00_mod_userdir.conf: 

```
<IfDefine USERDIR>

<IfModule userdir_module>

UserDir HTMLs

<Directory /home/*/HTMLs>

    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec

     AllowOverride FileInfo AuthConfig Indexes

        Order allow,deny

        Allow from all

        <Limit GET POST OPTIONS>

                Order allow,deny

                Allow from localhost

        </Limit>

        <LimitExcept GET POST OPTIONS>

                Order deny,allow

                Deny from all

        </LimitExcept>

</Directory>

<IfDefine SUEXEC>

<IfModule suexec_module>

<Directory /home/*/HTMLs/cgi-bin>

        Options ExecCGI

        SetHandler cgi-script

</Directory>

</IfModule>

</IfDefine>

</IfModule>

</IfDefine>
```

And yes, /etc/conf.d/apache2 does have "-D USERDIR" in APACHE2_OPTS.

Note that this does even happen when I change /etc/apache2/modules.d/00_default_settings.conf from: 

```
<Directory />

        Options FollowSymLinks

        AllowOverride None

        Order deny,allow

        Deny from all

</Directory>
```

 to 

```
<Directory />

        Options FollowSymLinks

        AllowOverride None

        Order allow,deny

        Allow from all

</Directory>
```

  :Question:   :Question: 

Thanks for your help.

----------

## pappy_mcfae

Start apache thusly:

```
/etc/init.d/apache2 start
```

The onlything you should need to do to your setup to get it running at a basic level is add your server name at the end of /etc/apache2/httpd.conf. Save the "fancy" file editing for after you get apache running.

Blessed be!

Pappy

----------

## cjubon

thanks for your answer, pappy_mcfae.

My apache is up and running when I get those "permission denied" errors. In fact, I can access everything under /var/www/localhost/htdocs, but not the userdirectories under /home/username/public_html (or .../HTMLs, in my case). I don't understand why.

----------

## pappy_mcfae

It's probably a virtual host problem and/or file permissions, but I can't say for certain. I play with apache a little bit. I don't know it in and out. I'm sure someone else will be along to help you out in that area.

Blessed be!

Pappy

----------

## cjubon

Any help?

I spent one more day trying to fix this, I can do what I want, e.g. changing "UserDir HTMLs" to "UserDir public_html" or even "UserDir http://another_machine/home/", each time creating the necessary directories, but no avail.

BTW, independent of what I do,  *tail /var/log/apache2/error_log wrote:*   

> [Mon May 05 17:40:58 2008] [notice] Apache/2.2.8 (Unix) mod_ssl/2.2.8 OpenSSL/0.9.8g PHP/5.2.5-pl1-gentoo configured -- resuming normal operations
> 
> [Mon May 05 17:41:01 2008] [error] [client 127.0.0.1] (13)Permission denied: access to /~cjubon/ denied

  whenever I try to access http://localhost/~cjubon/. This worked fine with earlier versions.

It seems to me that apache does not translate the path at all. Can this be a bug?

Once more, apart from that, apache works fine, but this one is really annoying.

I'd appreciate your help very much.

----------

## nbennett

I'm gonna agree with the above post.  What are the directory permissions?  Does the daemon have read access to it?

----------

