vernomcrp
vernomcrp

Reputation: 3589

How to config Apache & php run as superuser

i try to config apache & php for my project to create web-based for file config management to open vpn in bsd unix, but i can't run as superuser to start or stop service

Upvotes: 0

Views: 640

Answers (2)

RageZ
RageZ

Reputation: 27323

you can use a script with a setuid to do the actual command.

ie some bash script like this would do it

#!/bin/sh
/etc/init.d/openvpn $1

you shoud chmod +s yourscript.sh and use a system('yourscript.sh start') in PHP.

Note: You have to be really careful with that because it could make big security holes

Upvotes: 2

Funkatron
Funkatron

Reputation: 892

Do you have sudo access on the machine? That is, can you prefix your start/stop commands with "sudo" to run them as a superuser?

If not, I think you're out of luck. But there's almost no information here to work with.

Upvotes: 0

Related Questions