Configure Apache CGI Scripts in Rhel5 httpd.conf file

system1: How to config Apache CGI script in Rhel5
Step 1:
enable the cgibin
entries in httpd.conf file
#vim /etc/httpd/conf/httpd.conf
Line no:563
ScriptAlias /cgibin/
“/var/www/cgibin”
Step 2: Red Hat configuration
create cgi bin script
#vim /var/www/cgibin/
sample.sh
#!/bin/bash
echo ContentType:
text/html
echo
echo “<pre>”
echo My User name is
who am i
echo
echo My id is
id
echo
echo My shell settings are
set
echo
echo “</pre>”
Step 3:
change permissions of the cgi script
#chmod 777 /var/www/cgibin/
sample.sh
restart the http service
#service httpd restart
sys1:
Step 4:
open firefox and type the following line in address bar
http://system1.leena.com/cgibin/
sample.sh
CGI Script Apache web server in Rhel5 Config successfully. Red hat Linux

Related post