Prerequisite
You have successfully installed apache web server with default configuration.
Deploy
Copy our CGI script to default directory.
$ cat /var/www/cgi-bin/hello.cgi
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print <<HTML;
<html>
<head>
<title>A Simple Perl CGI</title>
</head>
<body>
<h1>A Simple Perl CGI</h1>
<p>Hello World</p>
</body>
HTML
exit;
Set file permission
$ chown root:root /var/www/cgi-bin/hello.cgi
$ chmod 755 /var/www/cgi-bin/hello.cgi
Set SELinux
$ restorecon -RFv /var/www/cgi-bin/hello.cgi
Test
Open http://<your-host>/cgi-bin/hello.cgi
No comments:
Post a Comment