I have a python program to control GPIO of raspberry pi. Webserver installed is apache2. But when accessing GPIO from the program I get an error to run the program as root since /dev/mem is not accessible.How to run the program as root since I have placed the python file in /var/www so that it is accessible as webpage?Security is not a concern.
I'm assuming that you are using cgi, in which case you need to set the owner of the script to root and set its suid bit. If python won't work with suid, you can use supper.