sago sago - 3 months ago 22
Perl Question

Where to save perl CGI files?




Where to save the user created perl CGI files?

I have currently using the location /home/httpd/cgi-bin location to save the perl files.

I also came across saving some perl files in /data/web/apache/cgi-bin.

Query:

Is it mandatory to save the perl file under cgi-bin location

Answer

Query:

Is it mandatory to save the perl file under cgi-bin location

No. It's configurable.

You can put them in any directory just make sure they are readable+executable by Apache.

<Directory /usr/local/apache2/htdocs/somedir>
    Options +ExecCGI
</Directory>

The above directive tells Apache to permit the execution of CGI files. You will also need to tell the server what files are CGI files. The following AddHandler directive tells the server to treat all files with the cgi or pl extension as CGI programs:

AddHandler cgi-script .cgi .pl

See: