Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 5th March 2009, 18:07
Shella Shella is offline
Junior Member
 
Join Date: May 2008
Posts: 28
Thanks: 4
Thanked 0 Times in 0 Posts
Default Change the user and group that PHP executes as

Hi all, i'm hardening a web server with apache.
PhpsecInfo suggest me to do this:

"Change the user and group that PHP executes as. If you're using the Apache module, you'll need to change what user Apache runs as with the User and Group directives"

How can I do it? On my server i got just root user and root group.
I can create new users and new group but how can I tell to system to use that user to execute PHP?
Thanks a lot.
Reply With Quote
Sponsored Links
  #2  
Old 6th March 2009, 13:54
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,715 Times in 2,557 Posts
Default

If you're using mod_php, you must change the User and Group directives in the apache configuration.

To create users and groups, take a look at
Code:
man groupadd
man useradd
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 6th March 2009, 14:55
Shella Shella is offline
Junior Member
 
Join Date: May 2008
Posts: 28
Thanks: 4
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by falko View Post
If you're using mod_php, you must change the User and Group directives in the apache configuration.

To create users and groups, take a look at
Code:
man groupadd
man useradd
Thanks Falko, the problem is that i don't know how to change the User and Group directives in the apache configuration. I know how to add users and group but where I can change? apache2.conf? Thanks.
Reply With Quote
  #4  
Old 7th March 2009, 15:03
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,715 Times in 2,557 Posts
 
Default

Depends on your distribution. For Debian/Ubuntu, it's /etc/apache2/apache2.conf, and for Fedora/CentOS, it's /etc/httpd/conf/httpd.conf.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
The Following User Says Thank You to falko For This Useful Post:
Shella (7th March 2009)
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Hacking attack (ubuntu 7.04 server + local root exploit on kernel) smoko General 4 15th September 2013 05:05
freebsd 7, samba 3, domain controller alexdimarco Suggest HOWTO 6 5th November 2010 16:54
chgrp error new user DKA General 15 28th July 2008 17:45
Ruby / FastCGI Problem Chad Server Operation 1 8th March 2008 20:38
How To Add user 'apache' into new group asyadiqin Installation/Configuration 4 16th November 2007 16:59


All times are GMT +2. The time now is 14:48.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.