SunQuest
           Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old October 24th, 2001, 12:21 AM
Banesh Banesh is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2001
Location: Singapore
Posts: 5 Banesh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Apache Startup-Shutdown problem

I am unable to start or stop apache as a different user other than root. I could able to do it when I login as root but when I login as a different user I can't able to start still I am not getting any error message.

The httpd.conf file is having the following specification

User nobody
Group banesh

When I login as banesh i should able to start and stop the apache web server. I have made necessary changes in permission for various directories and files. Actually the owner of apache is Banesh now.

what I observe is the parent process for httpd is not starting when I logged in as banesh.

Reply With Quote
  #2  
Old October 24th, 2001, 01:34 AM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
When a daemon is binding a port under 1024, it needs root priviledge to start/stop. That said, the User and Group you specify in httpd.conf is the user root will switch to after startup.

Reply With Quote
  #3  
Old October 24th, 2001, 02:28 AM
Banesh Banesh is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2001
Location: Singapore
Posts: 5 Banesh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanx

Hi,

Thanx for ur quick reply. As per ur idea it should switch off automatically so that the user Banesh should able to shutdown or atartup Apache once it is already started by root. Its not doing that... What is exactly the switch to user means? I am confused.

Banesh

Reply With Quote
  #4  
Old October 24th, 2001, 03:26 AM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Because the root user runs the parent process.

Try to run this:

ps aux | grep httpd

or whatever equivalent to aux that shows the USER.

Reply With Quote
  #5  
Old October 24th, 2001, 08:43 PM
Banesh Banesh is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2001
Location: Singapore
Posts: 5 Banesh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Chnaging the user to run the process

Thats true , the process is run by root. What I need is it should switch to user Banesh instead of root.

How can I make the parent process to be run by banesh instead of root when there is no chance to start apache from banesh?

How can I make apache to start by either root or by banesh?

Reply With Quote
  #6  
Old October 24th, 2001, 10:17 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Practically you can't. Technically, you can install Apache under /home/banesh then that's possible. You also need to run Apache on high port, not default port 80.

Now that I am wondering why must you start Apache as non-root user?

Maybe you are looking for something like this ->
http://forums.devshed.com/showthrea...23249&forumid=6

If not, go grab a UNIX administration for dummies book.

Reply With Quote
  #7  
Old October 24th, 2001, 11:24 PM
Banesh Banesh is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2001
Location: Singapore
Posts: 5 Banesh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Practically not?

HI ,

We installed apache on solaris in 2 different machines. In one machine there is no virtual host or anything where as in other one we have virtual hosting.

In one machine we could able to start apache by a non root user. Actually as per the specification earlier the user is nobody and group is banesh in both the machines. The owner and group of all related directories which apache may access are also the same. I don't understand what is the problem? In both the system is running in port 80.

Reply With Quote
  #8  
Old October 25th, 2001, 01:46 AM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Once again, listen. Ports < 1024 are reserved for user root to bind to. Non-root users can't. As simple as that.
If you run setuid root, that's a different story.

This is a security feature in UNIX. What's more do I have to repeat? Why don't you read the RFC.

Reply With Quote
  #9  
Old October 25th, 2001, 02:07 AM
Banesh Banesh is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2001
Location: Singapore
Posts: 5 Banesh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I know

I know that the port number must be >1023 than only we can do few operations. But what I am asking , is there any other alternative?

I don't understand the following line in httpd.conf

"If you wish httpd to run as a different user or group, you must run httpd as root initially and it will switch."

So if u feel comfortable than answer me otherwise no problem...

Many thanx

Reply With Quote
  #10  
Old October 25th, 2001, 03:28 AM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Take a look at this directive -> http://httpd.apache.org/docs/mod/core.html#startservers

Say you put StartServers 5 and User nobody. Then these 5 child processes will be running as nobody. The user of the initial parent process remains root.
That said, whatever User you set doesn't change the user's parent process, and that's for child process.

Let me give another example just so you can understand better. Say you have suEXEC enabled, you can then specify different user within <VirtualHost>. Now say you have 100 vhosts all specifying with different User and Group. Does that mean Apache is running with 100 different users? No.. The child process will be the default User you specify globally in httpd.conf. When executing a CGI script (not mod_php script), the default user will be switched to the particular vhost's user. User root is still running the parent processs, and at all time.

If you try my dns restart thru browser script (URL I provided previously), that's a different story. User root is then giving priviledge to other user to start/stop the deamon.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > Apache Startup-Shutdown problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway