Created
May 4, 2017 21:16
-
-
Save ArsSirek/1819aefff39730bfad8bbe38ba4639f9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$status = null; | |
$output = ""; | |
exec( "apachectl configtest", $output, $status ); | |
if ( $status === 0 ) { | |
// allow apache2 reload to needed user | |
// (add - "username ALL = (root) NOPASSWD: /etc/init.d/apache2" to /etc/sudoers) | |
// http://serverfault.com/questions/69847/linux-how-to-give-a-user-permission-to-restart-apache | |
exec( "sudo /etc/init.d/apache2 reload"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment