0

We have a 1and1 vps running centos which is behaving strangely when we try to post/get to the cgi-bin.

We have a directory called Monitor under the cgi-bin so to hit a perl script inside it we would call https://example.co.uk/cgi-bin/Monitor/perlscript.pl

however this returns an error as Apache looks for the file in cgi-binMonitor not cgi-bin/Monitor. If we create a directory called cgi-binMonitor and put the script in there it runs fine when called with the above url.

The httpd.conf file has the following:

ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

#
# "/var/www/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "/var/www/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>

The actual cgi-bin is not at /var/www/cgi-bin but /var/www/vhosts/default/cgi-bin

Any ideas whats causing this strange behaviour, whilst we have a poor solution of creating a cgi-binMonitor directory I'd rather fix it properly.

  • Why do you have quote marks around the actual path? And why does your posted content not match the path you say you're using? – Jenny D Jul 23 '15 at 9:42
  • Maybe try ScriptAliasMatch instead for more control over the replacement? httpd.apache.org/docs/2.2/mod/mod_alias.html#scriptaliasmatch – cxw Jul 23 '15 at 9:54
  • @JennyD mostly because I don't know what I'm doing! The quotes were not added by me but auto generated I guess. Regarding the path not matching I've tried with it matching the exact path but the result was the same, I've now set up another vhost (rather than using the default and now nothing works so I guess thats progress).. – Egg Vans Jul 23 '15 at 10:08
  • @cxw thanks for the suggestion I've managed to hose the whole thing at the moment I'll try it once I get the new vhost working – Egg Vans Jul 23 '15 at 10:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.