This is an old revision of the document!
Deploy A Basic CGI Application
General Information
Deploying a basic CGI application via a bash script.
Lab Setup
The following virtual machines will be used:
- server1.example.com (192.168.1.150) → Perform all connectivity tests from here
- server2.example.com (192.168.1.151) → Install Apache Web Server here
Create the Bash Script
Create a basic script
vim /var/www/cgi-bin/mytime.sh #!/bin/bash echo "Content-type: text" echo echo "This is the current time on the system: $(date)"
Make script executable
chmod +x /var/www/cgi-bin/mytime.sh
Find SELinux CGI boolean to ensure its on
getsebool -a | grep httpd_enable_cgi
If OFF, set it to ON
setsebool -P httpd_enable_cgi 1
Test CGI deployed script
elinks http://