1828505 Members
3098 Online
109978 Solutions
New Discussion

Apache User Check

 
girishb
Frequent Advisor

Apache User Check

Hi,

We have Apache Web Server installed on Redhat Enterprise Linux, the web server is hosting our company website.

I'm new to web server services. I would like to know, how do we check on what user the web server is running.

Also how do I make it secure.

Thanks in advance for the responses.

Regards
Girish

8 REPLIES 8
Ivan Ferreira
Honored Contributor

Re: Apache User Check

You can use:

ps auxw |grep httpd

To identify the user that runs tha httpd process.

You can also check the httpd.conf for the options:

User
Group

Normally will be set to Apache.

There are a lot of books about how to secure apache. If you have lucky enough, you can find some ebooks for free.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Steven E. Protter
Exalted Contributor

Re: Apache User Check

Shalom Girish,

As noted apache is usually the owner of the httpd processes.

If you are thinking of changing it, note that the user id of the web server is defined in the /etc/httpd/conf/httpd.conf file.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Vitaly Karasik_1
Honored Contributor

Re: Apache User Check


And as for Apache hardening - it's not so trivial, if you take into account dynamic sites with PHP/DB and so on.
But for start:
RHEL manual http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/security-guide/

and
http://xianshield.org/guides/apache2.0guide.html
girishb
Frequent Advisor

Re: Apache User Check

Thanks folks for the response.

I found the webserver is being run by user "nobody" . I hope it to be safe.

Matti_Kurkela
Honored Contributor

Re: Apache User Check

Some basic points to making Apache secure:

* Most of Apache's functionality is split into different modules. Usually the default configuration includes modules you don't need in your specific situation. Disable the modules you don't need: it makes your configuration simpler to handle, and reducing the amount of running code will also reduce the possibility of security holes.

* Know where Apache (and the scripts and/or CGI programs) needs to be able to write. Then keep the file permissions strict, so that Apache can write to only those files and directories it is required to write, and nowhere else.

* If you create scripts to process input from users, *always* assume the user's input is designed with a hostile intent to cause malfunctions in your script until you have checked it for correctness.
MK
George Liu_4
Trusted Contributor

Re: Apache User Check

n typical operation, Apache is started by the root user, and it switches to the user defined by the User directive to serve hits.
girishb
Frequent Advisor

Re: Apache User Check

Thanks all for the reply.
girishb
Frequent Advisor

Re: Apache User Check

Thanks folks.