-rst- wrote:DougieLawson wrote:...UID=www-data GID=www-data and DO NOT have root privileges (and it's a very Bad Idea™ to give them root privileges). ...
I would assume this only applies if the computer running the web server is connected to internet (or 'intranet' with possibly malicious users) - or am I missing something else?
The problem with that assumption is that it may not be connected today, but in six months time the security exposure still exists when the OP opens his/her web server port for some other reason for some other project while forgetting that this is in place.
It's simply better to never open that can of worms. I think with a 4.1.7 (or higher) kernel and the gpiomem module it's going to be easier to wiggle GPIO pins from Apache2 (or Lighttpd or NGINX) without needing sudo or root privileges. I just have to find a way to set the environment variable that's needed by Gordon's WirringPi to run as a www-data CGI program.