Operating System - Linux
1753331 Members
5341 Online
108792 Solutions
New Discussion

Re: Change the path of the CGI programs

 
Zhidian Du
Occasional Contributor

Change the path of the CGI programs

I change the directory of CGI progrmas and how to let the web server to find that specific path?

Thanks.

Zhidian Du
1 REPLY 1
Tim Malnati
Honored Contributor

Re: Change the path of the CGI programs

For the moment I will assume that you are using Apache where most Linux people choose it. The directory location of your cgi files is specified in the httpd.conf file usually found in the /etc/httpd/conf directory of newer Apache distributions. There is a configurable in this config file named 'ScriptAlias'. Change this directory to where you want it located. There is also an entry usually right after the ScriptAlias parameter that defines some associated parameters; the directory path needs to be changed here as well. Scan the rest of the file for other references to the original directory path and change any as well (might be one there for ssh stuff). You will need to restart Apache after you are done.

This will usually work out just fine, but there may be some web based applications running on your machine that don't necessarily read this config file completely and may use the default cgi-bin directory under your web server directory location. If you seem to be having troubles it might be a good idea to reboot just to make sure everything goes through a complete startup sequence with the new parameter.