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)
-   -   Ok, so how put django to work? I try early info. (http://www.litespeedtech.com/support/forum/showthread.php?t=1764)

mamcx 02-15-2008 01:58 PM

Ok, so how put django to work? I try early info.
 
I have the most recent trunk of django. I read the info on this forum and of the wiki.

However, I keep getting

503 Service Unavailable

And this is the error:

2008-02-15 21:51:21.670 ERROR execle() failed with errno=13, when try to start Fast CGI application: /home/d9a402a6/jhonWeb/paradondevamos/django-fcgi.py!
2008-02-15 21:51:21.778 INFO Remove pid: 3503
2008-02-15 21:51:21.778 INFO Pid: 3503 associated with [Paradonde]
2008-02-15 21:51:21.778 INFO [Paradonde] pid list size: 0, pid stop list size: 0
2008-02-15 21:51:21.778 NOTICE [Paradonde] stop worker processes
2008-02-15 21:51:21.779 INFO [Paradonde] 1 request being processed, kill external app later.

My settings are:

Name Paradonde
Address uds://tmp/paradonde.sock
Notes Not Set
Max Connections 1
Environment Not Set
Initial Request Timeout (secs) 10
Retry Timeout (secs) 5
Persistent Connection No
Connection Keepalive Timeout 30
Response Buffering No
Auto Start Yes
Command /home/d9a402a6/jhonWeb/paradondevamos/django-fcgi.py
Back Log 50
Instances 1

django-fcgi.py:

import sys, os
from settings_dev import BASE_DIR
BASE_DIR = os.path.abspath(os.path.dirname(__file__)+'/../')
sys.path.append(BASE_DIR)

os.chdir(BASE_DIR)
# Set the DJANGO_SETTINGS_MODULE environment variable.
os.environ['DJANGO_SETTINGS_MODULE'] = "paradondevamos.settings"

from django.core.servers.fastcgi import runfastcgi
runfastcgi(method="prefork", daemonize="false")

Also, I don't can acces this useing the uri '/'. I have a new vhost for this... I must delete the default one?

mamcx 02-15-2008 02:03 PM

Also, I get suere the django-fcgy was set to 755 and the owner was www:www the same of the webserver.

This is running on Joyent accelerator

mistwang 02-15-2008 02:17 PM

error 13 is permission denied. so it is a permission problem.
Please check the permission of parent directories as well.

try

sudo -s <user_name> /home/d9a402a6/jhonWeb/paradondevamos/django-fcgi.py

make sure it can be started.

Double check the Memrory Soft/Hard Limit and Process Soft/Hard Limit.

mamcx 02-15-2008 02:27 PM

I have nothing in limits.

I'm on solaris, when I run this:

sudo -s www /home/d9a402a6/jhonWeb/paradondevamos/django-fcgi.py

I get:

www: No such file or directory

-s is not found.

I run chown -R www:www jhonWeb (jhonWeb is the parent directory) and using my sftp client see is set ok.

LiteSpeed is running under: user(www) : group(www)

mistwang 02-15-2008 02:48 PM

sorry, should be
sudo -u www ...

Not sure about solaris, you can check sudo man page.

mamcx 02-15-2008 03:36 PM

That not work

I find this command for solaris:

ls -l

and get for all files on my dir:

-rw-r--r-- 1 www www 408 Feb 15 21:48 django-fcgi.py

So I confirm all files are set to www.

mistwang 02-16-2008 11:15 AM

You also need to check all the permission of parent directories holding the file.

mamcx 02-16-2008 11:24 AM

I try with this test script:

http://www.litespeedtech.com/support...ki:python_fcgi

But now I get:

execle() failed with errno=2, when try to start Fast CGI application: /home/d9a402a6/jhonWeb/paradondevamos/demoapp.py!

But the file is there. Also, the mypythonfcgi.sock is created and assigned to www:www

mistwang 02-16-2008 11:49 AM

The script uses
Code:

#!/usr/bin/python
if your python is installed to somewhere else, you should change that.

mamcx 02-17-2008 10:48 AM

Almost there!
 
Ok, you put me in the right track.

I change to the harcode python path and work ok (I have python2.4/2.5 both installed, so that must be).

Also, I change the command, so is now:

/opt/local/bin/python2.4 /home/d9a402a6/jhonWeb/paradondevamos/manage.py runfcgi method=prefork

Then I got:

unpack non-sequence

And stop when acces

request.path

on django.

I then imagine is because I put this on contect /para/. I move it to '/' but get 404.

I need to setup rewrite for this?


All times are GMT -7. The time now is 01:11 AM.