Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just finished doing a LAMP install on a CentOS 6 x64 install.

I have had LAMP server before this one, and I would always ssh into the server as root but i'm trying to make a production environment and i would like to make a user that I can log in with that isn't root or has root privileges.

I noticed that in some of my PHP scripts that create files using the fopen() functions that it sets the user and group to apache.

What would i need to do is I wanted to have a user called optik and a group called nerv (just examples). Also when PHP makes new files and or folders how can i get it so that it too uses that same user and groups?

At this point I just have a fresh LAMP install from SoftLayer and nothing else other than MySQL server running on it as well. (no yum updates or anything of the sort yet)

share|improve this question
up vote 1 down vote accepted

suphp is what you need if you want to run php scripts as a specific user:

You should try to find a howto for your Centos distribution to set it up correctly.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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