Apache server - path question (cgi-bin, htdocs)

screw3d

Diamond Member
Nov 6, 2001
6,906
1
76
So I have apache running... with cgi-bin in /apache/cgi-bin and htdocs in /apache/htdocs (all default config).

Now I have a html file in htdocs, and within that I am trying to call a perl document by using <form ... action="cgi-bin/xxx.pl">

However, if I do that, it would mean the cgi-bin directory would be relative to the htdocs dir (/apache/htdocs/cgi-bin) rather than accessing /apache/cgi-bin.

I tried using absolute path (probably not a good idea even if it works) and "../cgi-bin/xxx.pl".

So what should I put in <form ... action="...">? Or is there something that I can change in httpd.conf?
 

kt

Diamond Member
Apr 1, 2000
6,032
1,348
136
Leave your call as it is. And put this directive in your httpd.conf file:

ScriptAlias /cgi-bin/ /apache/cgi-bin/
 

screw3d

Diamond Member
Nov 6, 2001
6,906
1
76
:Q

That worked! Thanks!! :beer:

Edit: Hey wait.. it turns out that I'm stoopid.. :eek: I have already changed the default ScriptAlias-ed to something else and my html call was still /cgi-bin/. Your post made me see the error! :)