You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Gergely Buday <gb...@gmail.com> on 2013/02/16 12:00:15 UTC
[users@httpd] AliasMatch and permission problem
Hi there,
I would like to access a wordpress installation in my home directory
on my Fedora box through Apache.
When I try to access its wp-admin dir, I get
You don't have permission to access /kolozsvar/wp-admin on this server.
I have an AliasMatch directive in /etc/httpd/conf/httpd.conf:
AliasMatch ^/kolozsvar/(.*)$ /home/gergoe/projects/kolozsvar/wordpress/$1
Following the Using Unix Groups section here:
http://wiki.apache.org/httpd/FileSystemPermissions
I created a 'web' group and put my user and apache into it, and gave
640 for the files and 750 for the dirs.
>From the above error message it seems that AliasMatch does work but
for some reasons the permission is not right.
$ ls -ld wp-admin/
drwxr-x--- 9 gergoe web 4096 Sep 7 08:54 wp-admin/
What do you suggest to fix this?
- Gergely
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] AliasMatch and permission problem
Posted by Gergely Buday <gb...@gmail.com>.
Pete Houston wrote:
> No, I was meaning the SELinux context. If SELinux is preventing access
> the details will be in the audit log. If you have just created this tree
> within your home directory, it probably won't have the context Apache
> expects and you might either need to change the contexts or set some
> SELinux booleans to allow them.
Upon advice I switched off selinux by setenforce 0, and restarted
apache. Still, the following happens:
this two directory have the same rights, owner and group:
drwxr-xr-x 5 apache gergoe 4096 Feb 18 10:48 kolozsvar
drwxr-xr-x 5 apache gergoe 4096 Jul 17 2012 wp
but pointing the browser to localhost gives one of them, wp, but not the other:
[DIR] k/ 08-Jan-2012 18:01 -
[TXT] l2.txt 16-Feb-2013 10:37 47K
[TXT] list.txt 18-Jul-2012 17:25 47K
[DIR] wordpress/ 08-Jan-2012 18:01 -
[DIR] wp/ 08-Jan-2012 18:01 -
What command would show the difference between the two dirs, after
selinux was switched off?
The apache error log says
[Mon Feb 18 10:58:51 2013] [error] [client ::1] (13)Permission denied:
access to /kolozsvar/ denied
[Mon Feb 18 10:59:10 2013] [error] [client ::1] (13)Permission denied:
access to /kolozsvar/wpdewd denied
Which shows that kolozsvar has some problem as wpdewd does not exist.
- Gergely
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] AliasMatch and permission problem
Posted by Pete Houston <ph...@openstrike.co.uk>.
On Sat, Feb 16, 2013 at 12:37:12PM +0100, Gergely Buday wrote:
> Pete Houston wrote:
> > If it still fails after that, check the audit log to make sure the
> > directory has the right context.
>
> Oops, could you explain what a context is? This one:
>
> http://httpd.apache.org/docs/2.2/mod/directive-dict.html#Context
>
> or something else?
No, I was meaning the SELinux context. If SELinux is preventing access
the details will be in the audit log. If you have just created this tree
within your home directory, it probably won't have the context Apache
expects and you might either need to change the contexts or set some
SELinux booleans to allow them.
Pete
--
Openstrike - improving business through open source
http://www.openstrike.co.uk/ or call 01722 770036 / 07092 020107
Re: [users@httpd] AliasMatch and permission problem
Posted by Gergely Buday <gb...@gmail.com>.
Pete Houston wrote:
> Also, check your various Allow and Deny settings to make sure access to
> that directory is permissible.
Would it be possible to make Apache write which rule made it to refuse
access? I have set the LogLevel to debug, but that did not help.
I checked the Deny rules and none of them seemed to be the hindrance,
but who knows.
> If it still fails after that, check the audit log to make sure the
> directory has the right context.
Oops, could you explain what a context is? This one:
http://httpd.apache.org/docs/2.2/mod/directive-dict.html#Context
or something else?
- Gergely
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] AliasMatch and permission problem
Posted by Pete Houston <ph...@openstrike.co.uk>.
On Sat, Feb 16, 2013 at 12:00:15PM +0100, Gergely Buday wrote:
>
> I created a 'web' group and put my user and apache into it, and gave
> 640 for the files and 750 for the dirs.
>
...
>
> $ ls -ld wp-admin/
> drwxr-x--- 9 gergoe web 4096 Sep 7 08:54 wp-admin/
>
> What do you suggest to fix this?
You will need to make your apache instance run as group "web" for that
to work. In your httpd.conf you should have a line like this:
Group web
Also, check your various Allow and Deny settings to make sure access to
that directory is permissible.
If it still fails after that, check the audit log to make sure the
directory has the right context.
Good luck,
Pete
--
Openstrike - improving business through open source
http://www.openstrike.co.uk/ or call 01722 770036 / 07092 020107