Run as sudo from web browser?
Hi!
Since I don't know what is causing the problem I have I was unsure in which forum to post in. Please move if in wrong. To my problem. I'm trying to run a script on my server from a web browser. The PHP-script I did for this looks like this (running on Apache): Code:
<?php Code:
echo "password" | sudo -u user -S /usr/bin/mongrel_rails cluster::restart -C /etc/mongrel_cluster/enviroment.yml Could that be the source to my problem and how do I solve it? Thanks! |
Maybe
su -c 'command' That also just executes one command, but it doesn't need sudo to be set up for the user. |
Quote:
|
Quote:
Code:
ps -ef|grep httpd |
The script was run as the user apache which had the SHELL-variable set to /sbin/nologin. I changed it to /bin/bash and it worked!
Thanks! |
Quote:
|
Quote:
|
All times are GMT -5. The time now is 07:08 AM. |