Enable Perl/CGI Script2013/12/30 |
Enable Perl/CGI Script to use it.
|
|
[1] | Install Perl |
[root@www ~]# yum -y install perl perl-CGI
|
[2] | Configure it can execute CGI in any directory. |
[root@www ~]#
vi /etc/httpd/conf/httpd.conf # line 144: change ( add it and remove Indexes ) Options FollowSymLinks ExecCGI
# line 294: uncomment and add file-type that apache looks them CGI AddHandler cgi-script .cgi .pl
systemctl restart httpd.service |
[3] | Create a CGI test page and access to it with a web browser. It's OK if following page is shown. |
[root@www ~]#
vi /var/www/html/index.cgi #!/usr/bin/perl print "Content-type: text/html\n\n"; print "<html>\n<body>\n"; print "<div style=\"width: 100%; font-size: 40px; font-weight: bold; text-align: center;\">\n"; print "CGI Test Page"; print "\n</div>\n"; print "</body>\n</html>\n"; chmod 705 /var/www/html/index.cgi |
Sponsored Link |
|