I have a a requirement to stop/start some service using sudo service  stop/start using python script. The script will be called by a webpage php code on server side running apache webserver.
One way I know is to give www-data sudoer permission to run the specific python script. 
Is there other way without giving www-data specific permission. Example will cgi or mod_python work in this case. If yes what is the best implementation to all python script execution in LAMP server. 
Thanks in advance.
I see no security issue with giving www-data the sudo right for a single restart command without any wildcards.
If you want to avoid using sudo at all, you can create a temporary file with php, and poll for this file from a shell script executed by root regularly.
But this may be more error prown, and leads to the same result.
How to run python script which require sudoer