LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > External Applications > CGI/Perl/Python > Ok, so how put django to work? I try early info.

Reply
 
Thread Tools Display Modes
  #1  
Old 02-15-2008, 01:58 PM
mamcx mamcx is offline
New Member
 
Join Date: Feb 2008
Posts: 7
Default 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?
Reply With Quote
  #2  
Old 02-15-2008, 02:03 PM
mamcx mamcx is offline
New Member
 
Join Date: Feb 2008
Posts: 7
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
Reply With Quote
  #3  
Old 02-15-2008, 02:17 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
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.
Reply With Quote
  #4  
Old 02-15-2008, 02:27 PM
mamcx mamcx is offline
New Member
 
Join Date: Feb 2008
Posts: 7
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)

Last edited by mamcx; 02-15-2008 at 02:31 PM..
Reply With Quote
  #5  
Old 02-15-2008, 02:48 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
sorry, should be
sudo -u www ...

Not sure about solaris, you can check sudo man page.
Reply With Quote
  #6  
Old 02-15-2008, 03:36 PM
mamcx mamcx is offline
New Member
 
Join Date: Feb 2008
Posts: 7
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.
Reply With Quote
  #7  
Old 02-16-2008, 11:15 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
You also need to check all the permission of parent directories holding the file.
Reply With Quote
  #8  
Old 02-16-2008, 11:24 AM
mamcx mamcx is offline
New Member
 
Join Date: Feb 2008
Posts: 7
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
Reply With Quote
  #9  
Old 02-16-2008, 11:49 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
The script uses
Code:
#!/usr/bin/python
if your python is installed to somewhere else, you should change that.
Reply With Quote
  #10  
Old 02-17-2008, 10:48 AM
mamcx mamcx is offline
New Member
 
Join Date: Feb 2008
Posts: 7
Default 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?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 03:38 AM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.