Neo
asked on
CGI script error
Hello,
A cgi script that was functioning properly when accessed via IP address, is currently not working when accessed via domain name (now that the nameservers have propagated.)
Instead it is producing a message to open or save the cgi file.
I have checked the scripts in cgi-bin and the permissions are all correct 755.
Thanks for your help.
A cgi script that was functioning properly when accessed via IP address, is currently not working when accessed via domain name (now that the nameservers have propagated.)
Instead it is producing a message to open or save the cgi file.
I have checked the scripts in cgi-bin and the permissions are all correct 755.
Thanks for your help.
What web server are you using, Apache, IIS, etc...?
ASKER
Apache
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks i will pass this on to support
Centos7
Centos7
Hi netplus,
That open/save behaviour is what I get when I don't have this line in my .htaccess file:
I understand this can also be done at the (more global and probably more efficient) Apache config level, which is where I think Jim is suggesting you make his change.
But I have no idea why getting the domain name working would change this behaviour, so I could easily be wrong. Maybe the domain name was not the only thing that changed at that time?
Hi Jim,
It seems to have worked for netplus before the domain name was in place, so any ideas why it would have stopped working when the domain was put in place?
That open/save behaviour is what I get when I don't have this line in my .htaccess file:
AddHandler cgi-script .pl .cgi .pm
You probably don't need to list all those 3 extentions though. You can just list the one(s) which your CGI scripts use.I understand this can also be done at the (more global and probably more efficient) Apache config level, which is where I think Jim is suggesting you make his change.
But I have no idea why getting the domain name working would change this behaviour, so I could easily be wrong. Maybe the domain name was not the only thing that changed at that time?
Hi Jim,
It seems to have worked for netplus before the domain name was in place, so any ideas why it would have stopped working when the domain was put in place?
ASKER
Hi and thanks very much for your help Jim and tel2
The script started to work after commenting out the following line in /usr/local/apache/conf/mim e.types and restarting apache:
#application/cgi cgi
The script started to work after commenting out the following line in /usr/local/apache/conf/mim
#application/cgi cgi
The reason it may have worked before is that there is likely a different section in the conf file, or a different conf file altogether, that defines access by IP address rather than by name. It is not uncommon, as most people who host different sites on the same server would rather display a generic message like "Site not found" if someone tries to access the site by IP address.