How to start/stop service with Apache2 on Ubuntu

Posted by user142512 on Server Fault See other posts from Server Fault or by user142512
Published on 2012-10-24T14:13:52Z Indexed on 2012/10/24 17:04 UTC
Read the original article Hit count: 495

Filed under:
|
|
|

Using Apache, I'd like to be able to start and stop a service on the same server. Essentially, I'm looking for a way to allow Apache (or some script called by Apache) to call sudo service XXXX start.

I realize there are severe security implications with this, and I'm looking to minimize the possible effects. There is only a single service that I need to do this for. I've seen some solutions that involve "hacking" the setuid (C/Perl wrapper), others involved editing the /etc/sudoers file.

Is there a better way?

many thanks, S.

© Server Fault or respective owner

Related posts about apache2

Related posts about ubuntu