Apache running as "Apache" rather than user - Can be Fixed?

5 posts / 0 new
Last post
#1 Tue, 03/05/2013 - 23:24
MTUser2012

Apache running as "Apache" rather than user - Can be Fixed?

A new WordPress site I installed won't update, it gives the ftp credential request. After Googling, I found an article that explains this occurs if Apache is not running as the user. After checking sites through the whoami command, I see that in the sites that work, Apache runs as the user for that site and on the site that does not work, Apache is running as apache.

Is this something I can fix, getting apache to run as the user? Or should I assume that I have messed something up horribly, delete the virtual server and start over again. I do have the WP files and database so this would not take too much time.

Wed, 03/06/2013 - 08:28
andreychek

Howdy,

Which distro are you using?

Apache itself should indeed be running as the "apache" or "www-date" user... it's the PHP processes that should be running as your Virtual Server owner.

In Virtualmin, if you go into Server Configuration -> Website Options, what is the "PHP Execution Mode" set to for this domain? It should be either FCGID or CGI.

Also, you may want to go into System Settings -> Re-Check Config to make sure it doesn't notice any problems.

-Eric

Wed, 03/06/2013 - 08:54
MTUser2012

Thank you for the help. Sorry, you are right of course, it is the php process for this particular virtual server that is running as apache not the virtual server owner. I used a simple script with the php whoami command to diagnose my error.

Distro is Centos 6, 32 bit, latest, and under website configuration, it says Apache Mod_PHP. I see my other virtual servers are running as FCGLD.

Can I fix my problem by using the radio button to switch to from Mod_PHP to FCGLD mode?

Wed, 03/06/2013 - 10:07
andreychek

Howdy,

Well, FCGID is the default... so I can't speak to why it was changed, or if anything in that particular domain is relying on mod_php.

But, mod_php by definition runs everything as the Apache user... so if you want the PHP code to run as the Virtual Server owner, you'd need to switch to FCGID or CGI.

-Eric

Fri, 06/16/2017 - 11:29
Satalink

I was having this issue as well. Fixed it by adding User and Group to the VirtualHost conf file(s). I keep my VirutalHosts separate from my httpd.conf file.

  User username
  Group usergroup
  <VirtualHost>
    ...
  </VirtualHost>
Topic locked