0

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

Dave Sherohman
  • 45,363
  • 14
  • 64
  • 102
sago
  • 717
  • 1
  • 5
  • 9

1 Answers1

2

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:

Community
  • 1
  • 1
Chankey Pathak
  • 21,187
  • 12
  • 85
  • 133
  • OP had mentioned `/data/web/apache/cgi-bin` so I assumed he is using Apache. – Chankey Pathak Aug 31 '16 at 07:05
  • In my system cgi-bin location is under following category(/var/www/cgi-bin).I want know here what kind of files will be saved@Chankey Pathak – sago Aug 31 '16 at 07:06
  • Please go through the links which I have posted at the bottom of my answer. Everything you ask for is mentioned there. – Chankey Pathak Aug 31 '16 at 07:07