PDA

View Full Version : cgi


Dani
11-29-2005, 12:59 AM
Hi,

I'm converting from apache to litespeed all the way but having some troubles with cpanel.

I would like to convert:
>> ScriptAlias /cpanel /usr/local/cpanel/cgi-sys/redirect.cgi
into litespeed.

I've defined a CGI context the script alias like so:
URI /cpanel
Path /usr/local/cpanel/cgi-sys/redirect.cgi

and after I restart the server and goto /cpanel I get:

403 Forbidden
Access to this resource on the server is denied!

thanks

mistwang
11-29-2005, 07:53 AM
The best way to debug this is to turn on debug logging by setting "Debug level" to "HIGH", then check lsws/logs/error.log

Make sure that permission of the CGI script has been set properly, virutal host has not been restrained to its vhost root, script has been enabled.

mistwang
11-29-2005, 08:14 AM
If the server is in product, it is not recommended to turn on the debug logging though. Anyway, the error.log should log something helpful when 403 happened without debug logging.

Dani
11-29-2005, 12:55 PM
debug:

2005-11-29 21:53:38.370 [DEBUG] [myip:47010-0#www.mysite.com] New request:
Method=[GET], URI=[/cpanel],
QueryString=[]
Content Length=0
2005-11-29 21:53:38.370 [DEBUG] [myip:47010-0#www.mysite.com] Find context with URI: [/cpanel], location: [/usr/local/cpanel/cgi-sys/redirect.cgi]
2005-11-29 21:53:38.370 [DEBUG] [myip:47010-0#www.mysite.com] processContextPath() return 24
2005-11-29 21:53:38.370 [DEBUG] [myip:47010-0#www.mysite.com] processNewReq() return 24.
2005-11-29 21:53:38.370 [DEBUG] [myip:47010-0#www.mysite.com] readToHeaderBuf() return 24.
2005-11-29 21:53:38.370 [DEBUG] [myip:47010-0#www.mysite.com] HttpConnection::sendHttpError(),code=403 Forbidden
2005-11-29 21:53:38.370 [DEBUG] [myip:47010-0#www.mysite.com] HttpConnection::flush()!
2005-11-29 21:53:38.370 [DEBUG] [myip:47010-0#www.mysite.com] Written to client: 572


owner of the file is set to the one as in the lswl config...

mistwang
11-29-2005, 01:07 PM
Did you only dump the debug message?
there should be a "INFO" message shows the reason for "403".

Dani
11-29-2005, 01:22 PM
hmm INFO is set but nothing comes out.

Enable Script = Yes
CGI Chroot Mode = Same as server

mistwang
11-29-2005, 01:32 PM
Is "Restrained" set to "No"?

Dani
11-29-2005, 01:35 PM
it's set to 'yes'. should i change it..?

mistwang
11-29-2005, 01:39 PM
Should be set to "No", as you want allow that vhost access files beyond the vhost root.

Dani
11-29-2005, 01:45 PM
ok set it to no, still no NOTICE or INFO just a 403.. same with cpanel's /webmail and the other

mistwang
11-29-2005, 01:47 PM
If you don't mind, PM me the login information about your server, I can take a look, could save both of us sometime.

Dani
11-29-2005, 03:17 PM
for those who want to know what fixed the problem here it goes:

Change the setting "Follow Symbolic Link" from "No" to "Yes" and you're set to go with the cpanel features in litespeed!