Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] File permission problem with apache2
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
boblu
n00b
n00b


Joined: 12 Oct 2006
Posts: 40

PostPosted: Fri May 23, 2008 4:21 am    Post subject: [Solved] File permission problem with apache2 Reply with quote

I am running wordpress with apache2 on my gentoo box.
When I tried using the built-in theme editor of WP, I met the following problem of file permission.

my www root directory was changed to /home/boblu/www_root
and my WP root directory is /home/boblu/www_root/wordpress
and the ownership of all files under www_root is boblu:boblu

Because in gentoo, the user of apache2 is apache
so in order to let the browser have the permission to write files in /home/boblu/www_root/wordpress/wp-content/theme/k2
I did the following two things.
First, add apache user to boblu group
Code:
root# usermod -a -G boblu apache

Second, make the k2 directory writable by group users
Code:
boblu$ chmod -R g+w /home/boblu/www_root/wordpress/wp-content/theme/k2


But the problem is, after doing these, I still can not get the write permission by using browser.

Anyway, if I change the permission of k2 directory public writable, the files become writable by using browser.
Code:
boblu$ chmod -R go+w /home/boblu/www_root/wordpress/wp-content/theme/k2


Also, I found if I change the ownership of k2 directory to boblu:apache, and give them group writable permission, the files become writable by using browser too.
Code:

root# chown -R boblu:apache /home/boblu/www_root/wordpress/wp-content/theme/k2
boblu$ chmod -R g+w /home/boblu/www_root/wordpress/wp-content/theme/k2


This is strange!
Dose this mean that Apache2 run as a user other than 'apache' but this user is still in 'apache' group?
Can anybody explain this?
_________________
I like my G!


Last edited by boblu on Sun May 25, 2008 2:31 am; edited 1 time in total
Back to top
View user's profile Send private message
aceFruchtsaft
Guru
Guru


Joined: 16 May 2004
Posts: 438
Location: Vienna, Austria

PostPosted: Sat May 24, 2008 6:16 pm    Post subject: Reply with quote

Did you restart apache after adding it to the boblu group? When adding real users to groups you have to login again for the changes to become effective, so maybe it's the same with the apache process.

BTW, you can easily determinde the effective user and group of apache with something like
Code:

ps -C apache2 -o euser,egroup,cmd
Back to top
View user's profile Send private message
boblu
n00b
n00b


Joined: 12 Oct 2006
Posts: 40

PostPosted: Sun May 25, 2008 2:31 am    Post subject: Reply with quote

yeah, I should have re-loggin and restart apache to test the result.
This is working.
Thank you very much for your advices.
_________________
I like my G!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum