Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
07-12-2007, 09:04 AM #1
- Join Date
- Mar 2007
- Thanked 0 Times in 0 Posts
Executing linux shell script on the webserver
I have devoloped a script to append data to a text file for my linux squid proxy server. The trouble I am now having is that I want to be able to run a shell script via a web browser that will reload the squid proxy service on the same server.
The shell script has the command to reload the squid proxy service using the following commands:
echo Reloading External Lists Please Wait...
service squid reload
echo Reload Complete
echo Proxy Ready
Is there any way to call this script and execute the shell script through PHP or is there a more suitable way, such as commands like system or exec??
07-12-2007, 12:17 PM #2
- Join Date
- May 2002
- Perth Australia
- Thanked 92 Times in 90 Posts
more suitable would be a CRON job where you can run the script as root or whoever you wish.
assuming that you need to give the script elevated privileges then that means either running the webserver as a privileged user (not recommended) or adding PHP to sudoers or some SUID solution .. all messyresistance is...
MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)