473,805 Members | 2,027 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Attempting to get lighttpd, fastcgi & python working

Hi folks,

I'm trying to get lighttpd, fastcgi & python working on a 2.4.21.x i686
linux system. I tried following the steps in:

http://www.cleverdevil.org/computing...i-and-lighttpd
Some of the lighttpd.conf setting are slightly different from those in
that article - fixing some erros in the original and accounting for
some change in entry formats itself.

All components were built by 'root' and binaries run by 'root'. Python
files (.py(c)) were deployed to '..../site-packages' and run with
execute prop turned on.

I'm trying to run lighttpd on "dev-1686linux.my.or g:8090" with the
fastcgi server setup to listen on "127.0.0.1:8091 ". The problem I'm
having is that though lighttpd comes up and is able to serve static
content, it fails to bring up the WSGIServer and serve dynamic content
(simple "Hello World") generated by the py script (test.pcgi).

The errors I get are:
.....
[root@dev-i686linux myApp]# lighttpd -f ./lighttpd.conf

[root@dev-i686linux myApp]# Traceback (most recent call last):

File "/test/myApp/htdocs/test.fcgi", line 21, in ?
WSGIServer(myap p, bindAddress = ("127.0.0.1" , 8091)).run()

File "/usr/lib/python2.4/site-packages/fcgi.py", line 1064, in run
sock = self._setupSock et()
Traceback (most recent call last):

File "/test/myApp/htdocs/test.fcgi", line 21, in ?
WSGIServer(myap p, bindAddress = ("127.0.0.1" , 8091)).run()

File "/usr/lib/python2.4/site-packages/fcgi.py", line 1027, in
_setupSocket sock.bind(self. _bindAddress)

File "/usr/lib/python2.4/site-packages/fcgi.py", line 1064, in run
sock = self._setupSock et()

File "/usr/lib/python2.4/site-packages/fcgi.py", line 1027, in
_setupSocket sock.bind(self. _bindAddress)

File "<string>", line 1, in bind
socket.error: (98, 'Address already in use')

File "<string>", line 1, in bind
socket.error: (98, 'Address already in use')
....

It is unclear why it thinks the 127.0.0.1:8091 sock is already in use.
I ran this the first thing after a system reboot. No other apps are
using this port. I see this error no matter what port I choose, on the
server side. The browser sits there spinning and 'waiting' for the
response to url that incudes the .pcgi script.

The behviour is slightly different when I use UDSockets to listen on.
Again, I can see static content. When I try the py script, I see it
waiting indefinitely, but this time no errors are logged into the log
file. So no clue where it is hanging on the server side. The access
logs are not showing any "request" related entries even for the static
content that is being deliverd (albeit properly).

Can someone shed light on this. I thought if I can iron out this kink,
then I can get TurboGears (CherryPy ws) working with lighttpd and
fastcgi proxy-ing upfront.

Searched around quite a bit, but unable to find a clue. Would much
appreciate some pointers... Thanks a lot ...
/venkat
Following are the various config settings:

/test/myApp/lightpd.conf:
-------------------------
server.modules = (
"mod_rewrit e",
"mod_access ",
"mod_fastcg i",
"mod_access log" )
server.document-root = "/test/myApp/htdocs/"
server.errorlog = "/var/tmp/lighttpd.error. log"
index-file.names = ( "index.html ", "index.htm" )
server.port = 8090
server.bind = "dev-1686linux.my.or g"
server.error-handler-404 = "/test.fcgi"
fastcgi.server = ( ".fcgi" =>
(
(
"host" => "127.0.0.1" ,
"port" => 8091,
"bin-path" =>
"/test/myApp/htdocs/test.fcgi",
"min-procs" => 1
)
)
)

/test/myApp/htdocs/test.fcgi:
-----------------------------
#!/usr/bin/python2.4
# test.fcgi for myApp

from fcgi import WSGIServer

def myapp(environ, start_response) :

print 'got request: %s' % environ
start_response( '200 OK', [('Content-Type', 'text/plain')])
return ['Hello World!\n']

# use a tcp-socket based approach
WSGIServer(myap p, bindAddress = ("127.0.0.1" , 8091)).run()

/test/myApp/fcgi.py:
--------------------
The WSCGIServer (fcgi.py) authored by Saddi is from:
http://svn.saddi.com/py-lib/trunk/fcgi.py
No mods here.

Mar 24 '06 #1
0 2197

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
4170
by: Peter Otten | last post by:
Is there a way to limit both width and height of a canvas text item? My current workaround seems clumsy: import Tkinter as tk root = tk.Tk() canvas = tk.Canvas(root, width=400, height=200, bg="white") canvas.pack() # simulate a clipped text item - never transparent :-( s = "The long and winding road.."
0
2026
by: fmcarol | last post by:
In the course of playing with my new Lighttpd server, I ran into a problem with the PHP_SELF, PATH_INFO, and ORIG_PATH_INFO variables - specifically, Lighty doesn't provide them to my PHP install. Now, this isn't specifically a PHP issue, but so far no one in the Lighty community has come up with a good fix for this - short of doing without PATH_INFO. Even after applying all the fixes I could find:
7
25726
by: Vincent Delporte | last post by:
Hello I'm interested in hearing reflections by seasoned web app developpers about the different ways to write PHP apps, and especially how they compare in terms of performance, whether it's the PHP part or connections to MySQL. As far as I know, there are different ways to write a PHP application: - CGI, ie. the usual way : some PHP code in web pages, and the PHP interpreter is loaded each time a PHP page is called
2
2928
by: Sanders Kaufman | last post by:
I'm working on a webhost that seems to have an undocumented feature. I inadvertently coded a link to "mydomain.com//" - with TWO trailing slashes. When I clicked the link, Apache returned this error: -+-+-+-+-+-+ 403 Forbidden You don't have permission to access
4
2019
by: John Nagle | last post by:
What's the recommended FastCGI module for Python. There are at least five: The Robin Dunn / Total Control Software version: http://alldunn.com/python/fcgi.py Last revised in 1998. The "JonPy" version: http://jonpy.sourceforge.net/fcgi.html Last revised in 2004.
9
7096
by: Gilles Ganault | last post by:
Hello I was looking for a lighter web server than Apache, and installed Lighttpd on CentOS through yum. It works fine, but I now need to use SQLite from a PHP script. I seem to understand that it can either be access directly, or through the PDO interface. Can you confirm that the RPM that I used will only allow me to work through PDO, and not the SQLite library directly, and which is more recommended?
2
3172
by: Gilles Ganault | last post by:
Hello I have Lighttpd, PHP in FastCGI, and MySQL up and running on FreeBSD. Now, I'd like to find a tool to stress things, so I can check what happens when I try different things to improve performance (PHP cache, MySQL cache, using different queries, etc.) I haven't found anything on the subjet on www.lighttpd.net : Is there an equivalent to Apache's ab that I could use to simulate multiple, simultaneous connections from a client...
1
2115
by: Ivan Voras | last post by:
Hi, Is there a straightforward way to convert an XML-RPC server application (written for SimpleXMLRPCServer) to use WSGI so that it can be used as s fastcgi server? By "straightforward" I mean something simple, without using some external framework. Alternatively, I don't really care about WSGI, so something that makes it work as fastcgi directly will also be ok.
1
2731
by: Gilles Ganault | last post by:
Hello There's not much activity in the Lighttpd forum, so I figured maybe some people here use this web server instead of Apache, and would know the cause of the problem. PHP scripts can successfully read/write to an SQLite file when it's located either in Lighttpd's web directory (/usr/local/www/data/) or in /tmp, but it fails writing when the file is located elsewhere (such as /var).
0
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10604
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10361
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10103
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9179
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6874
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5536
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5676
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3839
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.