Re: Solving the 500 Internal error from ImportError

will <[email protected]> Thu, 31 Jul 2008 16:05:27 -0400
Newsgroups gmane.comp.web.pyblosxom.user
Message-ID <[email protected]>
Brianna Laugher wrote:
> 
> I managed to get Pyblosxom 1.4.3 up and running by following
> <http://pyblosxom.sourceforge.net/1.4/manual/install_cgi.html> but
> putting config.py and pyblosxom.cgi in my base dir. It worked fine
> until I tried to click on the permalink to my first test entry. The
> permalink went to "http://domain.com/first-post.html" and not
> surprisingly it 404ed.
> 
> So I thought OK, maybe I was trying to be too clever, and I should put
> my config.py and pyblosxom.cgi in a cgi-bin dir after all. (I have no
> idea what difference it makes, CGI is one thing I know nothing about.
> I use Dreamhost shared hosting and I was just taking a punt that it
> would work at all. :))

CGI is a protocol that allows the web-server to execute processes on the 
server in a specified environment and return the resulting stdout as the 
response to the browser's request.

More specifically, the web-server sets up a bunch of environment 
variables and then runs pyblosxom.cgi in that environment.  That's it.

There are a couple of problems this creates:

1. it's very possible that the environment the web-server executes 
PyBlosxom in is different in some/many ways from the environment that 
you as a user can execute PyBlosxom in on the command line

2. it's often difficult to figure out what the web-server is doing 
internally to create the environment


> So I created the cgi-bin directory and moved config.py and
> pyblosxom.cgi there, and made my nice relative paths in config.py into
> absolute paths.
> 
> Running ./pyblosxom.cgi in the command line works without
> show-stopping complaint, but the website produces a 500 error thanks
> to not being able to import the right script.

When you say "thanks to not being able to import the right script", what 
error messages are you seeing that draw you to that conclusion?


> http://laugher.id.au/cgi-bin/pyblosxom.cgi

This url gives me a 404.

If you can let us know what the specific error messages are and/or give 
us a url that executes PyBlosxom, I can figure more out from that.

/will

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/