Hey there, I am trying to take the CGI approach, and have reviewed my settings in mwlib.cgi and Localsetttings.php, and have tried a few more workarounds based on the last post here from Bill (thanks Bill!).
I made sure that I was including the full paths to binaries. I also have applied login restrictions to this wiki, so I added the $wgCollectionMWServeCredentials option as well. So far I wonder if this is related to something I need in my .htaccess file, or perhaps this is because I have a custom Python instance in my home dir? Maybe I need to include a differnt path at the beginning of the mwlib.cgi file? My host doesn't allow us to read the full Apache logs, but there is a feature where I can view all logs for all folks on the server, and copy the ones I might be relevant. The problem is that you can only view stuff that is happening within the last minute or two. The errors that I think might be useful are: >From the SUEXEC error_log: [2009-08-28 16:18:16]: uid: (2140/username) gid: (2140/username) cmd: mwlib.cgi Could this mean it's not accepting my username and password? I used the main admini account info, and it's correct. -- >From the 'Main' error log (Maybe they mean the apache error log?): Traceback (most recent call last): File "mwlib.cgi", line 43, in ? from flup.server.cgi import WSGIServer ImportError: No module named flup.server.cgi [Fri Aug 28 16:15:09 2009] [warn] (103)Software caused connection abort: mod_fcgid: ap_pass_brigade failed in handle_request function Traceback (most recent call last): File "mwlib.cgi", line 43, in ? from flup.server.cgi import WSGIServer ImportError: No module named flup.server.cgi [Fri Aug 28 16:22:45 2009] [error] [client 69.89.31.147] Premature end of script headers: mwlib.cgi, referer: http://site.example.org/index.php?title=Special:Book So I really can't find any sytnax errors in the CGI config, but I will definitly try again. And chmod permissions look okay too. These errors seem to sound like there's an issue with flup, like it isn't installed.... Could this be because I need to install it for my custom Python? Or is there a settings I am missing? I know my host can run CGI scripts because there are cgi-bin directories already created. I am still trying to see if there are other errors that might belong to me in this shared log, but don't see any so far. If anyone has any ideas, pleae let me know! On Aug 25, 6:32 am, Bill <[email protected]> wrote: > 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. > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
