I have a bash script "Hello.sh" below in my remote server "A" which is running Apache.
#! /bin/bash
echo "Hello World" > Hello.txt
I want to execute this script in remote server "A" itself by calling it's Apache URL from server "B" like below.
Please note I have made the script available through URL by keeping it in Document root of Apache.
How can this be accomplished. Thanks.
To be able to run shell scripts directly from the browser, you should add this rule to your .htaccess file.
Options ExecCGI AddHandler cgi-script .sh
This tells the webserver to treat .sh files as CGI scripts.