Reputation: 610
Can anybody help me? I'm using sphinx searcher, but i have many databases. I dynamically controll them (change the sphinx config file ), but after i add an index to the config file sphinx needs to be restarted. I have created an bash script for doing this (stop shpinx, start it, indexer --rotate --all ) and when i run the script from terminal it is ok, but when i run from apache server it is not working. How can i do this without changenig the owner of the apache server to root ( it will decrease the security of my server )?
Upvotes: 0
Views: 428
Reputation: 71
How can i do this without changenig the owner of the apache server to root
How about sudo? Put something like this in your sudoers...
apache ALL= NOPASSWD: /path/to/script command
The catch is to make sure that the script cannot be exploited... as it is running as root... ie is read-only + exec for apache, ensure that commands/switches you send to the script are sanity checked.
I hope that helps,
Kind Regards,
Nick
Upvotes: 1