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.
You can run a python thread that listens to a stop/start request, and then this thread will stop/start the service. The thread should run as sudo, but it listens to tcp. The web server can send requests w/o any special permissions (SocketServer is a very simple out-of-the-box python tcp server).
You may want to add some security, e.g. hashing the request to this server with a secret, so only allowed services will be able to request the start/stop of the service, and apply iptables rules (requests from localhost where the web server is)
How to run python script which require sudoer