The top few lines of my mwlib.cgi look like this:
---------
#! /usr/bin/env python
# Configuration:
# Name of logfile or None if log output should go to stderr.
LOGFILE = '/var/log/mwlib/mwlib.cgi.log'
# Cache directory. Must be writeable.
CACHE_DIR = '/var/cache/mwlib/'
# (Path to) mw-render executable.
MWRENDER = 'mw-render'
# Logfile for mw-render.
MWRENDER_LOGFILE = '/var/log/mwlib/mw-render.log'
# (Path to) mw-zip executable.
MWZIP = 'mw-zip'
# Logfile for mw-zip.
MWZIP_LOGFILE = '/var/log/mwlib/mw-zip.log'
# (Path to) mw-post executable.
MWPOST = 'mw-post'
# Logfile for mw-post.
MWPOST_LOGFILE = '/var/log/mwlib/mw-post.log'
# Queue directory for mw-watch or None if no queue should be used
QUEUE_DIR = None
#QUEUE_DIR = '/var/cache/mw-watch/q'
---------
You may need to specify the locations to the mw-* binaries
explicitly, for my install they are in my $PATH. The log files are
all owned by the webserver user (apache in my case).
In my LocalSettings.php I have:
-----------------
require_once("$IP/extensions/Collection/Collection.php");
$wgCollectionMWServeURL = "http://my.server.com/cgi-bin/mwlib.cgi";
$wgCollectionMWServeCredentials="<wikiuser>:<passwd>:local";
$wgCollectionFormats = array( 'rl' => 'PDF', 'odf' => 'ODT', );
$wgCollectionArticleNamespaces = array( NS_MAIN, NS_TALK, NS_USER,
NS_USER_TALK, NS_PROJECT, NS_PROJECT_TALK, NS_MEDIAWIKI,
NS_MEDIAWIKI_TALK, 100, 101, 102, 103, );
$wgCommunityCollectionNamespace = ( NS_MEDIAWIKI);
$wgCollectionMaxArticles = 500;
$wgLicenseName = null;
$wgLicenseURL = null;
-----------------
I had to use the credentials entry because login is required on my
wiki.
Can you see the logs on your webserver? You should see some posts to
the mwlib.cgi, you should be able to cut and paste those commands onto
the command line and run the cgi from there to see if it works. that
might expose some issues.
I think you are running into a path and/or permissions problem
somewhere such that the cgi can't find the binaries or can write to
files it wants to write to.
On Aug 24, 8:21 pm, mosa <[email protected]> wrote:
> That's great! Thank you... That wasn't working for me, maybe I
> implemented the CGI script wrong, or maybe I am calling to it from
> LocalSettings incorrectly. Does anyone see a step I am missing?
>
> The steps I followed were:
>
> 1. I got the correct mwlib.cgi script and uploaded it to my MediaWiki
> install's cgi-bin (and I tried in my public_html's cgi-bin when this
> didn't work)
>
> 2. I modified some of the configurations because I am using a Python
> instance in my home dir -- the paths to cache directory and log files.
> I did not touch the lower part of the cgi file.
>
> 3. I set the permissions to 777 on mwlib.cgi to make sure there were
> no permission conflicts for testing.
>
> 3. I modified the $wgCollectionMWServeURL= from "http://
> examplesite.org:8899" to "http://examplesite.org/cgi-bin/mwlib.cgi"
>
> 4. I created a PDF, but instead of working I got an error on my render
> page: "The POST request tohttp://mediawiki.pleiportal.org/cgi-bin/mwlib.cgi
> failed (HTTP status 301)."
>
> 5. Confirmed my mwlib cache is writable.
>
> 6. Noticed no log files were created. Manually created log files with
> open permissions, just in case this was an issue. No luck.
>
> 7. Modified the CGI script to also include direct paths to
> executables, no luck, same error.
>
> 8. I changed the $wgCollectionMWServeURL= from "http://examplesite.org/
> cgi-bin/mwlib.cgi" to include the port: "http://examplesite.org/cgi-
> bin/mwlib.cgi:8899". At this point I get an error that is different:
>
> Render server error: An error occured on the render server: <!DOCTYPE
> html etc etc.... This error includes a whole source code of the Main
> Page in MediaWiki, no matter what pages I am trying to generate PDFs
> from. The log files are still empty
>
> Maybe I need to be using a different port?
>
> How did you configure your LocalSettings (and anything else) to choose
> the CGI script? Does what I have tried sound close to what will work?
>
> Mosa
>
> On Aug 24, 4:07 pm, Bill <[email protected]> wrote:
>
> > I've been using the mwlib.cgi w/ good success. it doesn't require a
> > daemon to run.
>
> > On Aug 24, 6:30 pm, mosa <[email protected]> wrote:
>
> > > Hey all,
>
> > > I am a newb to MediaWiki and setting up a PDF render server, but have
> > > some experience with other tools and shell.
>
> > > The project I am working on requires customization of PDF output
> > > sizes, so I have (mostly) set up a PDF render server. Because I do not
> > > have root access on this server, I had to create an instance of Python
> > > (2.4) in our home directory and install and configure all the
> > > requirements for mwlib there.
>
> > > The problem I am having is that I cannot find in the documentation how
> > > to start mw-serve as a process that doesn't die. Perhaps I am not
> > > understanding the options for the command or I am starting it wrong,
> > > or perhaps this has to do with no root access?
>
> > > I am at the point where I can run mw-serve from the shell and I am
> > > able to generate PDFs, but this only works so long as I keep using it
> > > and creating output.
>
> > > At first I thought that this had to do with logging out of shell so I
> > > tried to use screen and nohub to run the process in the background.
> > > (http://www.xaprb.com/blog/2008/08/01/how-to-leave-a-program-running-
> > > after-you-log-out) but I soon realized that mw-serve would stop
> > > running no matter what, as soon as I let it sit with no output or
> > > action for a few minutes.
>
> > > Can anyone help me understand how I can keep mw-serve (or perhaps mw-
> > > watch?) running on render server when I do not have root access? I am
> > > unable to locate how to do this in the docs or by browsing these
> > > archives, and I could really use a hand!
>
> > > Mosa
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"mwlib" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/mwlib?hl=en
-~----------~----~----~----~------~----~------~--~---