Apache start issue


 
Thread Tools Search this Thread
Operating Systems Solaris Apache start issue
# 1  
Old 08-21-2008
Question Apache start issue

Hi group,

I need help to start apache in following scenario:

1) Say apache is installed on solaris OS by user 'root'.
2) An entry is there in httpd.conf that says to start apache process as user:
#User <RUN_AS_USER> is edited as
User user1
2) Now say user2 has logged and tries to start apache process. Now whosoever tries to start Apache, it should always gets start as user1.

We are only able to start apache as a 'root' user.

Thanks
rs266
# 2  
Old 08-21-2008
User2 cannot start a process as User1, this would be a security violation.

You have to start the process as either User1 or root.....
# 3  
Old 08-21-2008
That's correct. Only processes launched as the 'root' user may change the user to something else (Which is what Apache is trying to do with that configuration line.) In order to start Apache in such a way, you need to use something like the "sudo" package. In the sudoers configuration file, you might add a line like this:

Code:
user2   ALL=(user1) /opt/CSWApache/bin/apachectl

This says that user2 can now run (at the shell):
Code:
$ sudo -u user1 /opt/CSWApache/bin/apachectl start

# 4  
Old 08-21-2008
then what is the usage of
#User <RUN_AS_USER> in httpd.conf.

Please explain a bit details for this.
# 5  
Old 08-21-2008
That's the user apache will run Apache child processes under. This only works if 'root' starts the Apache process.
# 6  
Old 08-21-2008
The reason that directive exist, is that only the apache-processes that serve out pages run as a different user. Did you notice that one process always runs as root (when started as root)? The other child-processes run as a different user.
When there is a compromise of your system, the intruder will have the privileges of the apache-user and not root. Always make sure that your apache-user has no more rights than it needs...

Quote:
Originally Posted by rs266
then what is the usage of
#User <RUN_AS_USER> in httpd.conf.

Please explain a bit details for this.
# 7  
Old 08-21-2008
it might be a little easier to understand with this:
httpd.conf
Code:
#
# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.
#
# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
User www
Group www

now each child process is user www
Code:
# ps -eaf | grep httpd
     www  3903  3900   0   Aug 11 ?           0:00 /usr/local/apache2/bin/httpd -k start
     www  4520  3901   0   Aug 19 ?           0:52 /usr/local/apache2/bin/httpd -k start
     www  4519  3901   0   Aug 19 ?           0:59 /usr/local/apache2/bin/httpd -k start
     www  4597  3901   0 21:26:11 ?           0:11 /usr/local/apache2/bin/httpd -k start
     www  3909  3900   0   Aug 11 ?           0:00 /usr/local/apache2/bin/httpd -k start
     www  3911  3900   0   Aug 11 ?           0:00 /usr/local/apache2/bin/httpd -k start
    root  3901     1   0   Aug 11 ?           1:41 /usr/local/apache2/bin/httpd -k start
     www  4512  3901   0   Aug 19 ?           0:46 /usr/local/apache2/bin/httpd -k start

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Display status of instances in apache - Where to start

Hello, I know this is not a simple question so I just need to know where to start for below project: I am running under Ubuntu 18.04 What I'd like to see in apache page is to display status of particular process pids. ps aux | grep keywords.txt keywords.txt word1 word2 word3 word4... (9 Replies)
Discussion started by: baris35
9 Replies

2. Red Hat

Apache start error

I have a new server, installed everything and tried to get it all up and running. Got the following issue: # /usr/local/apache/bin/apachectl start httpd: Syntax error on line 54 of /usr/local/apache/conf/httpd.conf: Cannot load /usr/local/apache/modules/libphp5.so into server:... (0 Replies)
Discussion started by: Tommyk
0 Replies

3. UNIX for Advanced & Expert Users

Apache does not start

After i added this line to my apache httpd.conf it does not start. AuthUserFile /apps/apache22/conf/httpd.passwd and i see the below error. Syntax error on line 876 of /apps/apache22/conf/httpd.conf: AuthUserFile not allowed here Kindly help. (4 Replies)
Discussion started by: mohtashims
4 Replies

4. Red Hat

How to start the right instance of Apache on RedHat server

Hi, I have 2 apache instance on my machine (RedHat), and i need to start the "apache2" after any reboot but could not find the way ( searching into "httpd.conf" ), so i'am starting "apache2" manually. After a reboot, none of them starts and when i when doing : httpd -k start, i got "apache"... (14 Replies)
Discussion started by: mehdi1973
14 Replies

5. Solaris

apache cannot start

hi all i'm having a problem with apache on solaris 10 SPARC I'm trying to start httpd as root but it fails with the following error /usr/local/apache2/bin/httpd -k start httpd: Could not determine the server's fully qualified domain name, using 192.168.1.11 for ServerName (20014)Error... (16 Replies)
Discussion started by: h@foorsa.biz
16 Replies

6. Solaris

help me........... my apache can't start

help me please.................bro i was install apache2 and i have been configure httpd.conf on my solaris 10 machine n i already running my httd service but why my webserver couldn't run on my browser? some buddy help me.............:confused::confused::confused::confused::confused: (5 Replies)
Discussion started by: yatmianto
5 Replies

7. Solaris

Apache start problem

Hi, I have installed apache webserver on my solaris 10(x86). When I tried to start the server it gives following error, ld.so.1: /usr/local/apache2/bin/httpd: fatal: libssl.so.0.9.8: open failed: No such file or directory Killedld.so.1:: Too many arguments Can somebody please guide me how... (1 Reply)
Discussion started by: maheshsri
1 Replies

8. AIX

Start Stop Apache

I am in the process of reorging my Lawson db. I need to turn off the RMI server...not a problem. However my instructions also state that I must also shutdown my Servlet Container....I believe it is Apache. I have looked in /usr/apache/bin/apachectl What is the command for stopping and... (2 Replies)
Discussion started by: MILLERJ62
2 Replies

9. UNIX for Dummies Questions & Answers

Apache start (Was in:how can i?) [Split by LF]

I need to know, which script starts the apache web server on start up? If anyone could help me that would be great. I'm in deep trouble if I can't find the script. thanks very much dan donohd If you know my e-mail is donohd@sage.edu thanks:( (1 Reply)
Discussion started by: donohd
1 Replies

10. UNIX for Dummies Questions & Answers

Apache wont start

Hi, like a lot of people that post here, I am new at UNIX. The only UNIX I have ever messed with is my iBook running MacOSX (10.1). I have a grasp of the basic commands and understanding of the system but only to a point. I searched the archive and FreeBSD.org and apache.org but I couldn't find... (4 Replies)
Discussion started by: Alpha_Harblo
4 Replies
Login or Register to Ask a Question