The CGI is acronym for Common Gateway Interface. It is a standard for interfacing external applications with Apache Web servers. A CGI program is executed in real-time, so that it can output dynamic information. It can be written in Perl, Php, Bash, C/C++ or other programming languages. But how do I find the url for my cgi-bin? It's not in my /var/www/ directory.
Apache web server use ScriptAlias directive defines cgi-bin directory that contain server scripts. You can use open Apache web server configuration file using text editor such as vi and look for ScriptAlias directive:
httpd.conf file location:
Debian Linux:
$ vi /etc/apache-perl/httpd.conf
Red Hat/ Fedora Core Linux:
$ vi /etc/httpd/conf/httpd.conf
FreeBSD:
$ vi /usr/local/etc/httpd.conf
You can also use grep command as follows to find out your cgi-bin directory:
$ grep 'ScriptAlias' /etc/httpd/conf/httpd.conf
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
/usr/lib/cgi-bin/ is cgi-bin directory. If you have public_htm directory then cgi-bin directory should be inside this directory. Once you located cgi-bin directory you can use it.
Default cgi-bin directory locations:
- Red Hat Linux: /var/www/cgi-bin/
- Fedora Linux: /var/www/cgi-bin/
- Debian Linux: /usr/lib/cgi-bin/
- FreeBSD: /usr/local/www/cgi-bin/
Finally your url location depends upon directory location. You can use http://ip-address/cgi-bin or http://ip-address/~yourname/cgi-bin (replace ip-address with your domain name)
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop












{ 0 comments… add one now }