I want to restart the apache server using url.
I am using cgi-bin shell script to do so but I am not able to do it.
I have created a file apache and put it in /var/www/cgi-bin.
I have written following code in the file apache.
echo "Content-type: text/html"
service httpd restart
but when I execute the file in the browser using
it gives me following output on the web page
Stopping httpd: [FAILED] Starting httpd:
I have updated /etc/sudoers file and put following content in it
www-data ALL=NOPASSWD:/sbin/service httpd restart
but I am not able to restart apache using url.
I can execute only commands which do not require sudo.
I want to restart apache using web url. Please help me.
Thanks a lot !!!