Debian, Apache2, CGI: paths issue
- by Bubnoff
I have a perl form email script on the servers cgi-bin directory ( /usr/lib/cgi-bin ).
/etc/apache2/sites-enabled/000-default
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
AddHandler cgi-script cgi pl
Order allow,deny
Allow from all
</Directory>
The issue is with paths.
html calls script here:
<form name="Request" method="post" action="http://server-test.local/cgi-bin/formprocessorpro.pl" onsubmit="return checkWholeForm49874(this)">
The directory with the templates and configs is passed here:
<input type="hidden" name="base_path" value="../contact" />
The path to this form is:
http://server-test.local/formstest/contact.htm
No matter what variation I try for the base_path I get an error from the formprocessor
script that it can't find the directory:
An error occurred when opening the Form Configuration File (../contact/form.cfg): No such file or directory.
I need to move this script from an old server, configured by a previous sysadmin, to a new server.
Since cgi-bin is automatically linked to /usr/lib/cgi-bin and linked such that the script resides:
http://server-test.local/cgi-bin/formprocessorpro.pl
I would imagine that, given that the templates are in the webroot in a directory called contact, the correct path would be:
../contact
Any ideas? It's been awhile since I've messed with CGI.
Bubnoff