LiteSpeed Support Forums

LiteSpeed Support Forums (http://www.litespeedtech.com/support/forum/index.php)
-   CGI/Perl/Python (http://www.litespeedtech.com/support/forum/forumdisplay.php?f=22)
-   -   How can I assign all scripts in a directory to perl? (http://www.litespeedtech.com/support/forum/showthread.php?t=1290)

aenor 08-20-2007 06:52 AM

How can I assign all scripts in a directory to perl?
 
Hello,

I am using Litespeed for a week now, as a replacement for apache.
I am actually trying to get TWiki working, and because TWiki uses
one directory with perl scripts without the .pl suffix I wondered
weather it is possible to assign all script in that directory to perl?

I allready assigned the CGI-Context to that directory but that only works for .pl-files.

I'm trying to find a better solution than renaming all the files to *.pl for a couple of hours now ... but nothing I tried worked ...

I hope you can help me, thank you ;-)

mistwang 08-20-2007 11:08 AM

Define a script handler for "pl" at server level using CGI handler.
In that directory, add "ForceType application/x-httpd-pl" configuration in .htaccess under that directory.

aenor 08-20-2007 02:59 PM

Thank you for your fast answer,

but I still can't get it working ...
I added application/x-httpd-pl to the mimetypes and
added a .htacces file in the main directory with that content:
Code:

<Directory /bin>
  ForceType application/x-httpd-pl
</Directory>

and because that didn't work one in the directory bin
Code:

ForceType application/x-httpd-pl
and some slightly different things ..
AllowOveride is on .... the Log doesn't show anything strange ...
I am not shure whether LSWS reads the .htacces file in the Directory /bin.
I hope you can help me.

Thanks in advance!

mistwang 08-20-2007 03:12 PM

You must add a script handler for "pl" file using the CGI handler at server level using our web admin console, it will added MIME type application/x-httpd-pl behind the scene. If you explicitly added that MIME type some where, it is not going to work.

aenor 08-20-2007 03:40 PM

Okay,
I added the CGI handler before before in the virtual host, but the log said that the mime-type application/x-httpd-pl is not configure ...
Now I added the CGI handler at server level
and tried the two .htacces files shown above ... on in the directory itself and as this din't work one in the htdocs directory.

the main directory is showing "lscgid: execve(): Permission denied"
this error may be because i haven't configured twiki yet

and when i go into the bin directory and whant to execute the sript firefox wants to download it and says that its type is application/octet-stream

I have no idea whats the problem ...

mistwang 08-20-2007 04:04 PM

Make sure to make those scripts executable "chmod a+x *".
And you can try "ForceType application/x-httpd-cgi" as well, should have the same effect.

aenor 08-20-2007 04:30 PM

Its realy strange ...
I think it is a Browser related problem ...
I normaly use firefox and firefox everytime said that the file I want is a application/octet-stream,
but then I tried to open it whith IE and it worked.

[Edit]
*Arg* just a cache issue ...
after restarting firefox everything is fine ...
it worked with "ForceType application/x-httpd-cgi"

Thank you very much for your help!


All times are GMT -7. The time now is 10:14 PM.