Posts

Showing posts from October, 2011

Configuring Apace Server to run PERL scripts

Follow following steps to run PERL script on Apace Server


Step 1:
Open <APACHE_HOME>/conf/httpd.conf file


httpd.conf - is the main configuration file for Apache HTTP Server


Step 2:
Search for "ScriptAlias /cgi-bin/" uncomment i.e. remove '#' if commented. You may need to adjust the path to run your script successfully


ScriptAlias - Provides the location for CGI programs. This should be two parts, separated by whitespace. The first part is the part used in URL that triggers execution of a CGI program; the second part is the path where those CGI programs are stored in the real filesystem


Step 3:
Search for "AddHandler cgi-script" in the document, uncomment it, if committed and append ".pl " after ".cgi"


Step 4:
Modify your PERL Script. If your script is Windows executable it does't means that it will run on Apache Server as well 'coz script relies on PERL interpreter, so we have to modify the hashbang or the shebang or  the first line …