context for CGI script always says "access denied"

#1
When I have context configured as:
Code:
    <context>
      <type>cgi</type>
      <uri>/path/</uri>
      <location>/usr/local/lsws/fcgi-bin/</location>
      <accessControl>
      </accessControl>
      <addDefaultCharset>off</addDefaultCharset>
      <rewrite>
      </rewrite>
    </context>
And if I hit for http://192.168.0.1/path/script.pl it will give me the file correctly. Good.

But if I create a context direct to the script, like this:
Code:
    <context>
      <type>cgi</type>
      <uri>/script.pl</uri>
      <location>/usr/local/lsws/fcgi-bin/script.pl</location>
      <accessControl>
      </accessControl>
      <addDefaultCharset>off</addDefaultCharset>
      <rewrite>
      </rewrite>
    </context>
And if I hit for http://192.168.0.1/script.pl, it will always reply with a "403 Forbidden - Access to this resource on the server is denied!" error.

Documentation says
If only a specific script is needed in that directory, it is recommended to create a CGI context for that script only. In this case, path and URI need not be a directory. For e.g., path can be ~/myapp/myscript.pl, URI can be /myapp/myscript.pl. All other files will not be served as CGI.
Hmm.. I've spent a long time trying to figure this out, and even tried other ways to do this, but I got no success. Log with DEBUG set as HIGH doesn't give me anything useful. Please help... :roll:
 

mistwang

LiteSpeed Staff
#2
There should not be any problem with this. I tried it with different configurations, all works.

Have you tried using URI: /path/script.pl ? If URI=/path/ works, and script.pl pointing to the same file, I don't see any reason why it won't work. :)
 
Top