I am using Ubuntu server 12.04 to run Apache2 web server.
I am hosting several webpages, and most are working fine.
One page is running a cgi script which mostly works (I have the python code working outside Apache building the html code nicely.)
However, I am calling a home automation program (heyu) and it is returning different answers then when I run it in my user account.
Is there a way I can...
1 call the heyu program from my python script as a specific user, (me) and leave the rest of the python code and cgi code alone?
2, configure apache2 to run the cgi code, as a whole, as me? I would like to leave all the other pages unchanged. Maybe using the sites_available part.
3, at least determine which user is running the cgi code so maybe I can get heyu to be OK with that user.
Thanks, Mark.
It looks like I could use suEXEC.
It is an Apache module that is not installed at default because they really don't want you to use it. It can be installed using the apt-get scheme.
That said, I found the real answer to my issue, heyu uses the serial ports to do it's work. I needed to add www-data to the dialout group then reboot.
This circumvented the need to run my code as me (as I had already add me to the dialout group a long time ago) in favor of properly changing the permissions.
Thanks.
Apache2 server run script as specific user