durusmail: quixote-users: Trouble with next step after demo
Trouble with next step after demo
Trouble with next step after demo
Robert M. Anderson
2004-03-10
Hi, everyone.

Just started experimenting with Quixote this week, and I have managed to get
a slightly modified version of the demo working so far. I'm using Apache
1.3.29 on Slackware with scgi_mod 1.2a2. The demo files were copied into
"~/py/quixote/qdemo" and I modified them simply to test whether they were
actually being accessed or not.

After verifying that the setup was working, I stopped both the scgi and
httpd servers, changed the "qdemo" name to "site" in the httpd.conf,
scgi_server.py, and __init__.py files, and changed the qdemo directory name
to "site" as well.

After re-starting the servers, I then get "page not found" errors. I checked
permissions, ownerships, and filenames for possible problems, but I can't
pin it down. I also checked the scgi and apache logs, and flushed the cache
in my browser, re-started it, etc., but still no luck.

I can simply continue to use the "qdemo" root, but I'd rather not if at all
possible. Any and all help would be appreciated.

The working configuration I have is as follows:

In my httpd.conf file:

# ===========================
RewriteEngine on
RewriteRule ^/qdemo$ /qdemo/ [redirect=permanent]

LoadModule scgi_module /usr/lib/python2.3/site-packages/scgi/mod_scgi.so

    SCGIServer 127.0.0.1 4000
    SCGIHandler On

# ===========================

My scgi_server.py script:

# ===========================
#!/usr/bin/env python
import sys
sys.path.insert(0, "/home/username/py/quixote")
from scgi.quixote_handler import QuixoteHandler, main
from quixote import enable_ptl, Publisher

class DemoPublisher(Publisher):
    def __init__(self, *args, **kwargs):
        Publisher.__init__(self, *args, **kwargs)

        # (Optional step) Read a configuration file
        # self.read_config("demo.conf")

        # Open the configured log files
        self.setup_logs()

class MyHandler(QuixoteHandler):
    publisher_class = DemoPublisher
    root_namespace = "qdemo"
    prefix = "/qdemo"

# Install the import hook that enables PTL modules.
enable_ptl()
main(MyHandler)
# ===========================

I start the scgi server with:

./scgi_server.py -p 4000 -l tmp.log

...and the demo works like a charm.

Being completely new to web application programming, please forgive me if my
questions here are a little basic. I've been using Python for about a year
or so, but nothing extremely serious, so there may be some issues I may be
ignorant of here.

Thanks in advance,

Robert M. Anderson
Technical Publication Section
Nikko Graphic Arts Co., Ltd.
Shizuoka, Japan




reply