ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
#
# "/var/www/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
AllowOverride None
Options None
Order allow,deny
Allow from all
We can create a simple cgi script by following this site : http://www.elated.com/articles/your-first-cgi-script/ and upload the script in /var/www/cgi-bin
/var/www/cgi-bin/hello.cgi
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print <<END_HTML;
<html>
<head></head>
<body>Hello, World!</body>
</html>
END_HTML
Add an execution permission on hello.cgi
#chmod ugo+x /var/www/cgi-bin/hello.cgi
Test the cgi script
http://rhel02/cgi-bin/hello.cgi
No comments:
Post a Comment