8

I'm running my CentOS server on my Xserver and what happen is that when I want to upgrade my Wordpress escpecially for now to Wordpress 3.3.2 the problem is that I got

Warning: copy(/wp-admin/includes/update-core.php) [function.copy]: failed to open stream: Permission denied in /wp-admin/includes/class-wp-filesystem-direct.php on line 200

And I understand that this is a permission problem.

Because the owner:group of my wordpress is under apache

So I wish to know how can I add myself to the same group of apache or even in the same group with root using command line? [Terminal]

MORE INFO:

I have password root to do any kind of command that require root password.

3 Answers 3

8

Try the following (if you're in sudoers list) or under root:

 sudo adduser <username> apache

If you're not familiar with sudo, here is a short guide:

2
  • 2
    it said command not found?
    – Ali
    Apr 21, 2012 at 12:10
  • 1
    If I have multiple users on my server with different websites, does adding the users to the apache group pose any security risk?
    – MrMoxy
    Apr 1, 2021 at 15:59
23

for an existing user

sudo /usr/sbin/usermod -a -G apache <username>
12

If the user exists already, use

sudo usermod -g <groupname> <user>

If it is a new user,

sudo useradd -g <groupname> <user>
1
  • 2
    use -a -G for secondary group. Otherwise it's the primary group
    – Jeremy
    Dec 1, 2014 at 16:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.