unable to use /cgi-bin in URI

Web hosting discussion, programming, and shared and dedicated servers.
3 posts Page 1 of 1
by chongo » Sun Feb 09, 2014 5:25 pm
The URL:

http://www.isthe.com/cgi-bin/number.cgi

returns a 404 error and generates this error message in /var/log/custweb/error.log:

Code: Select all

[Sun Feb  9 HH:MM:SS 2014] [error] [client A.B.C.D] script not found or unable to stat: /nfs/www/httpd/cgi-bin/number.cgi
[Sun Feb  9 HH:MM:SS 2014] [error] [client A.B.C.D] File does not exist: /opt/apache/conf/IP/134/209.204.149.134/errors/404.shtml
On the other hand, the URL:

http://www.isthe.com/cgibin/number.cgi

works just fine.

Under my document root, /home/WWW_pages/chongo, I have my CGI file:
  • /home/WWW_pages/chongo/cgi-bin/number.cgi
For this test, I made the following symlink:
  • /home/WWW_pages/chongo/cgibin -> cgi-bin
which is why the http://www.isthe.com/cgibin/number.cgi link works.

I have a significant legacy of links depending on URIs such as http://www.isthe.com/cgi-bin/number.cgi. I.e., paths starting with /cgi-bin.

How can I use URIs such as http://www.isthe.com/cgi-bin/number.cgi?
by cdkeen » Tue Feb 11, 2014 5:00 pm
The directory /cgi-bin is rewritten on the server level to the directory specified here:
https://members.sonic.net/account/server_dirs/index.php
as cgi-bin

I copied all contents of your cgi-bin folder in your web root to that directory:
http://www.isthe.com/cgi-bin/chongo/number.cgi

I apologize if this configuration conflicts with the structure of your site. You can use a folder in your web root to store and access your scripts but it cannot be named cgi-bin.
cdkeen - Sonic.net System Operations
by chongo » Tue Feb 11, 2014 5:52 pm
Thanks for the clarification.
3 posts Page 1 of 1