[mwlib] Error by PDF-creation with mw-serve

151 views
Skip to first unread message

_apollo

unread,
May 8, 2010, 12:32:23 AM5/8/10
to mwlib
Hello.

I've installed the newest MediaWiki on a Kubuntu 10.04 with Collection
and PDF Writer. I've running a local server startet with mw-serve. I
can successful create a PDF on a console with:
mw-render --config http://en.wikipedia.org/w/ --output test.pdf --
writer rl Physics

But I have problems, when I try it an my site: http://localhost/media_wiki/index.php/Hauptseite

The manual entires I've done in LocalSettings.php are:

require_once("$IP/extensions/Collection/Collection.php");
$wgCollectionMWServeURL = "http://localhost:8899/";
$wgCollectionFormats = array(
'rl' => 'PDF',
'xhtml' => 'XHTML',
'odf' => 'OpenDocument',
);
With this the browser says:
Auf dem Render-Server ist ein Fehler aufgetreten: bad base_url 'http://
localhost/media_wiki'. check your $wgServer and $wgScriptPath
variables

mw-serve says:
2010-05-08T06:19:39 mw-serve.info >> serving http on 0.0.0.0:8899
2010-05-08T06:19:42 mwlib.serve.info >> Creating directory '/var/cache/
mw-serve/dd/ddfc637306eaa521'
2010-05-08T06:19:42 mwlib.serve.bad >> bad base_url: 'http://localhost/
media_wiki'
localhost - - [08/May/2010 06:19:42] "POST / HTTP/1.1" 200 105
^C2010-05-08T06:21:24 mw-serve.info >> exit.


I've added the line $wgServer = ""; to LocalSettings.php. So it looks
like this at the end:
$wgEnableApi = "true";
require_once("$IP/extensions/Collection/Collection.php");
$wgServer = "";
$wgCollectionMWServeURL = "http://localhost:8899/";
$wgCollectionFormats = array(
'rl' => 'PDF',
'xhtml' => 'XHTML',
'odf' => 'OpenDocument',
);

With this the browser says:
Auf dem Render-Server ist ein Fehler aufgetreten: traceback Traceback
(most recent call last): File
"/usr/local/lib/python2.6/dist-packages/mwlib-0.12.12-py2.6-linux-
x86_64.egg/mwlib/apps/render.py", line 170, in __call__ env =
self.get_environment() File
"/usr/local/lib/python2.6/dist-packages/mwlib-0.12.12-py2.6-linux-
x86_64.egg/mwlib/apps/render.py", line 93, in get_environment env =
self.parser.makewiki() File
"/usr/local/lib/python2.6/dist-packages/mwlib-0.12.12-py2.6-linux-
x86_64.egg/mwlib/options.py", line 143, in makewiki env =
wiki.makewiki(**kw) File
"/usr/local/lib/python2.6/dist-packages/mwlib-0.12.12-py2.6-linux-
x86_64.egg/mwlib/wiki.py", line 251, in makewiki res =
_makewiki(config, metabook=metabook, **kw) File
"/usr/local/lib/python2.6/dist-packages/mwlib-0.12.12-py2.6-linux-
x86_64.egg/mwlib/wiki.py", line 225, in _makewiki raise
RuntimeError("could not read config file %r" % (conf,)) RuntimeError:
could not read config file u'/media_wiki' sys.argv=['/usr/local/bin/mw-
render', '
--logfile', '/var/cache/mw-serve/b9/b90b1eeb06294259/mw-
render.log.rl', '
--error-file', '/var/cache/mw-serve/b9/b90b1eeb06294259/errors.rl', '
--status-file', '/var/cache/mw-serve/b9/b90b1eeb06294259/status.rl', '
--writer', 'rl', '
--output', '/var/cache/mw-serve/b9/b90b1eeb06294259/output.rl', '
--pid-file', '/var/cache/mw-serve/b9/b90b1eeb06294259/pid.rl', '
--metabook', '/var/cache/mw-serve/b9/b90b1eeb06294259/metabook.json',
'
--keep-zip', '/var/cache/mw-serve/b9/b90b1eeb06294259/collection.zip',
'
--config', '/media_wiki', '
--template-blacklist', 'MediaWiki:PDF Template Blacklist', '
--template-exclusion-category', 'Vom Druck ausschlie\xc3\x9fen', '
--print-template-prefix', 'Drucken', '
--print-template-pattern', '$1/Druck', '
--script-extension', '.php', '
--language', 'de']


mw-serve says:
2010-05-08T06:24:21 mwlib.serve.info >> Creating directory '/var/cache/
mw-serve/b9/b90b1eeb06294259'
2010-05-08T06:24:21 mwlib.serve.info >> render b90b1eeb06294259 rl
2010-05-08T06:24:21 mwlib.serve.info >> removing error file '/var/
cache/mw-serve/b9/b90b1eeb06294259/errors.rl'
2010-05-08T06:24:21 mwlib.serve.info >> removing status file '/var/
cache/mw-serve/b9/b90b1eeb06294259/status.rl' (forced rendering)
2010-05-08T06:24:21 mwlib.serve.info >> rendering '/var/cache/mw-serve/
b9/b90b1eeb06294259/output.rl'
2010-05-08T06:24:21 mwlib.serve.info >> queuing ['mw-render', '
--logfile', '/var/cache/mw-serve/b9/b90b1eeb06294259/mw-
render.log.rl', '
--error-file', '/var/cache/mw-serve/b9/b90b1eeb06294259/errors.rl', '
--status-file', '/var/cache/mw-serve/b9/b90b1eeb06294259/status.rl', '
--writer', 'rl', '
--output', '/var/cache/mw-serve/b9/b90b1eeb06294259/output.rl', '
--pid-file', '/var/cache/mw-serve/b9/b90b1eeb06294259/pid.rl', '
--metabook', '/var/cache/mw-serve/b9/b90b1eeb06294259/metabook.json',
'
--keep-zip', '/var/cache/mw-serve/b9/b90b1eeb06294259/collection.zip',
'
--config', '/media_wiki', '
--template-blacklist', 'MediaWiki:PDF Template Blacklist', '
--template-exclusion-category', 'Vom Druck ausschlie\xc3\x9fen', '
--print-template-prefix', 'Drucken', '
--print-template-pattern', '$1/Druck', '
--script-extension', '.php', '
--language', 'de']
localhost - - [08/May/2010 06:24:21] "POST / HTTP/1.1" 200 73
2010-05-08T06:24:21 mwlib.serve.info >> render_status b90b1eeb06294259
rl
localhost - - [08/May/2010 06:24:21] "POST / HTTP/1.1" 200 101
2010-05-08T06:24:22 mwlib.serve.info >> render_status b90b1eeb06294259
rl
localhost - - [08/May/2010 06:24:22] "POST / HTTP/1.1" 200 1884
2010-05-08T06:24:23 mwlib.serve.info >> render_status b90b1eeb06294259
rl
localhost - - [08/May/2010 06:24:23] "POST / HTTP/1.1" 200 1884
^C2010-05-08T06:25:39 mw-serve.info >> exit.


I guess mw-serve sends the wrong --config value to mw-render and it
has something to do with $wgServer = ""; But I can't find the reason
after very much hours work. Would somebody please help?

--
You received this message because you are subscribed to the Google Groups "mwlib" group.
To post to this group, send email to mw...@googlegroups.com.
To unsubscribe from this group, send email to mwlib+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mwlib?hl=en.

_apollo

unread,
May 8, 2010, 12:42:59 PM5/8/10
to mwlib
I've tried it now per manual call on cocsole with --confi
http://localhost/media_wiki/api.php

Now I'am getting a new error. I will first take a search in this
group. Maybe I will ask later.

In which config file do I have to put what, that mw-serve sends --
confi http://localhost/media_wiki/api.php ?

_apollo

unread,
May 10, 2010, 5:28:35 AM5/10/10
to mwlib
Everything is fine now. I had to add ServerName = ".." to httpd.conf
make an entry in /etc/hosts and change $wgServer = to this URL.
Reply all
Reply to author
Forward
0 new messages