Been bashing my head for the past two days on this... I'm nowhere near experienced to figure out how to do this from scratch so I've been searching for the past two days for this..
How can I restart a service (specially the squid service) via a PHP webpage? I know there are a lot of complications with permissions and commands - I'm not too fussed on the permission/security front, as this is a private project and won't be entering the real world
I've tried exec(service squid restart) but the error goes down to permissions there..
sudo allows a permitted user to execute a command as the superuser or another user, as specified in the
sudoers file. The real and effective uid and gid are set to match those of the target user as specified
in the passwd file (the group vector is also initialized when the target user is not root). By default,
sudo requires that users authenticate themselves with a password (NOTE: by default this is the user’s
password, not the root password). Once a user has been authenticated, a timestamp is updated and the
user may then use sudo without a password for a short period of time (5 minutes unless overridden in
sudoers).