I avoided the 'address already in use' errors by using port 8000 Still getting 404 - File not found
I found this in the lighttpd error log, which looks like it might have something to do with my problem 2010-02-19 12:44:40: (server.c.931) WARNING: unknown config-key: url.rewrite-once (ignored) Do I have a typo in this?: $SERVER["socket"] == "0.0.0.0:8000" { server.document-root="/home/james/web2py" url.rewrite-once = ( "^(/.+?/static/.+)$" => "/applications$1", "(^|/.*)$" => "/handler_web2py.fcgi$1", ) } On Feb 19, 9:22 am, raven <ravenspo...@yahoo.com> wrote: > John, > > Thank you for the suggestions. > > When I use the SERVER command, I get can't bind to port errors > > The other issues you mention all seem OK. > > r...@x:/etc/lighttpd# /etc/init.d/lighttpd restart > Syntax OK > * Stopping web server > lighttpd [ OK ] > Syntax OK > * Starting web server > lighttpd 2010-02-19 > 09:18:09: (network.c.300) can't bind to port: 0.0.0.0 80 Address > already in use > > [fail] > r...@x:/etc/lighttpd# pico lighttpd.conf > r...@x:/etc/lighttpd# /etc/init.d/lighttpd restart > Syntax OK > * Stopping web server > lighttpd [ OK ] > Syntax OK > * Starting web server > lighttpd 2010-02-19 > 09:18:53: (network.c.300) can't bind to port: 100.101.102.103 80 > Address already in use > > On Feb 18, 10:47 pm, John Heenan <johnmhee...@gmail.com> wrote: > > > Raven > > > $SERVER["socket"] == "0.0.0.0:80" { > > > will allow all IP interfaces. > > > John Heenan > > > On Feb 19, 11:42 am, John Heenan <johnmhee...@gmail.com> wrote: > > > > Raven, > > > > 1) Use > > > $SERVER["socket"] == "100.101.102.103" { > > > instead of > > > $HTTP["host"] == "100.101.102.103" { > > > > 2) Did you restart lighttpd with > > > /etc/init.d/lighttpd restart > > > and where there any problems when restarting? > > > > 3) Is "mod_fastcgi" included with server.modules in lighttpd.conf? > > > > 4) Is web2py actually running such as started with > > > cd /var/www/web2py && sudo -u www-data nohup python fcgihandler.py & > > > > You can see if the web2py process is alive with > > > ps ax | grep python > > > A line with fcgihandler.py should appear once. If appears more than > > > once then kill all fcgihandler.py python processes with > > > ps number > > > where number is the first number on each line of 'ps ax' that includes > > > fcgihandler.py. > > > > Restart web2py with > > > python fcgihandler.py & > > > or similar > > > > 5) Check file nohup.out in /var/www/web2py for errors > > > > John Heenan > > > > On Feb 19, 10:36 am, raven <ravenspo...@yahoo.com> wrote: > > > > > John, > > > > > Here is what I have placed in the file /etc/lighttpd/lighttpd.conf > > > > > $ > > > > > fastcgi.server = ( > > > > "/handler_web2py.fcgi" => ( > > > > "handler_web2py" => ( #name for logs > > > > "check-local" => "disable", > > > > "socket" => "/tmp/fcgi.sock", > > > > ) > > > > ) > > > > ) > > > > > $HTTP["host"] == "100.101.102.103" { > > > > server.document-root="/home/james/web2py" > > > > url.rewrite-once = ( > > > > "^(/.+?/static/.+)$" => "/applications$1", > > > > "(^|/.*)$" => "/handler_web2py.fcgi$1", > > > > ) > > > > > } > > > > > Can you tell me what I am doing wrong? > > > > > On Feb 18, 6:46 pm, John Heenan <johnmhee...@gmail.com> wrote: > > > > > > Hi Raven > > > > > > The name fcgihandler.py is just the name of a web2py start up file > > > > > passed to Python. > > > > > > The name fcgihandler.py should not or need not appear anywhere in the > > > > > lightttpd.conf file, since there is no need to give lighttpd the > > > > > responsibility to start up web2py as an independent process. > > > > > > What lighttpd needs to know is where the UNIX socket is that is > > > > > configured for use by web2py in fcgihandler.py. The name that > > > > > ligthttpd.conf uses to tell the rest of lighttpd.conf to use the UNIX > > > > > soscket is an arbitrary name. The suffix .fcgi does not need to appear > > > > > anywhere in lighttpd.conf, it is just a convention. > > > > > > Maybe I should provide a link to a complete lighttpd.conf file > > > > > inhttp://www.web2pyslices.com/main/slices/take_slice/57 > > > > > > It might be difficult to escape from an attitude that web servers are > > > > > essentially used as dumb pipes by Python frameworks and as such need > > > > > to stay 'out of the way' with minimal involvement. > > > > > > John Heenan > > > > > > On Feb 19, 5:10 am, raven <ravenspo...@yahoo.com> wrote: > > > > > > > Well, I gave this a try, and ended up with 404 errors. > > > > > > > fcgihandler.py suggests adding to lighttpd.conf > > > > > > > server.error-handler-404 = '/test.fcgi' > > > > > > > This does not help, nor does > > > > > > > server.error-handler-404 = "/error-handler.fcgi" > > > > > > > ( There no files on my system named *.fcgi, so I do not see how this > > > > > > could help ) > > > > > > > I suspect my problem might be with this line > > > > > > > $HTTP["host"] =~ "(^|\.)example\.com$" { > > > > > > > Since I am running on a VPS I only have an IP address. > > > > > > > I tried > > > > > > > $HTTP["host"] == "100.101.102.103" { > > > > > > > and > > > > > > > $HTTP["remoteip"] == "100.101.102.103" { > > > > > > > and > > > > > > > #SERVER["socket"] == "100.101.102.103" { > > > > > > > and some other variations on this, but nothing helps. -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.