Talk:MediaWikiLite

From Organic Design wiki
Revision as of 18:11, 22 May 2015 by 127.0.0.1 (talk) (Change source-code blocks to standard format)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Portability

I have long been using mediawiki with a LAMP stack as a personal and home wiki. One of the main inconveniences is that it's not easy to move the wiki around to another machine. It involves dumping the database, copying various files etc. Is Mediawikilite more portable? Parker 11:32, 26 May 2010 (UTC)

Debian package

I wonder how far we are from having a mediawikilite debian package that installs dependencies (e.g. php5+sqlite+nanoweb) and runs "out of the box". It could significantly increase the number of users if Debian and Ubuntu users were only one apt-get away from using mediawikilite. Are there any technical hurdles? Parker 11:32, 26 May 2010 (UTC)

The main hold up really was MediaWiki's SQLite layer which I originally started off, but didn't have the SQL skills to get it to a stable state. But I tested it out not long ago and Brion, Tim Starling and a few others have done a lot of work on it and got it working pretty solidly. I'll take a look at building a deb package for it, but I've got a lot on so it'll probably be slow progress. --nad 03:11, 27 May 2010 (UTC)
That would be great. Let me know if you need any testing done, I'll give it a spin. I haven't succeeded in getting the nanoweb/sqlite (LNSP?) stack working whereas LAMP+mediawiki is quite easy. Parker 20:05, 28 May 2010 (UTC)
As you can see from all the recent activity in this article, I've got it successfully running under both Linux and Windows as a completely self-contained folder structure with no need for installation. However, a Debian package will be quite easy to construct as a means of running it too because nanoweb is available in the Debian and Ubuntu APT repositories which means it's not much more than a meta package (one that only refers to other required packages but doesn't do anything itself). I'll create one in the next few days and add it to our package repo. --nad 20:34, 28 May 2010 (UTC)

Working

Folder installed into C:\MyWiki in VB

Running this script: C:\MyWiki\php\php.exe -f c:\MyWiki\nanoweb\src\nanoweb.php -- --config=C:\MyWiki\nanoweb\nanoweb.conf

Downloaded and tested, remember to navigate to localhost, can edit etc. --Jack 00:05, 29 May 2010 (NZST)


NanoWeb log output

Here's the output of NanoWeb ending on a lockup after attempting to save. The lockup happens on both Windows and Ubuntu on save, but gets a few headers further on Ubuntu and is recoverable. The lines that start with header: is output that I added into line 237 of mod_cgi.php.

20100530:104011 aEGiS nanoweb/2.2.9 (C) 2002-2005 by sIX / aEGiS
20100530:104011 WARN: function 'pcntl_fork' not available
20100530:104011 WARN: function 'posix_setuid' not available
20100530:104011 loaded module : Static content support
20100530:104011 loaded module : CGI support
20100530:104011 loaded module : access limit based on server load average
20100530:104011 loaded module : Filter support
20100530:104011 loaded module : gzip content encoding support
20100530:104011 loaded theme : default server theme (4109 bytes)
20100530:104011 listening on port 55555
20100530:104011 ready and accepting connections

Splash
20100530:104015 header: Status: 301 Moved Permanently
20100530:104015 header: X-Powered-By: PHP/5.2.13
20100530:104015 header: Vary: Accept-Encoding, Cookie
20100530:104015 header: X-Vary-Options: Accept-Encoding;list-contains=gzip,Cookie;string-contains=wikidbToken;
                        string-contains=wikidbLoggedOut;string-contains=wikidb_session
20100530:104015 header: Expires: Thu, 01 Jan 1970 00:00:00 GMT
20100530:104015 header: Cache-Control: private, must-revalidate, max-age=0
20100530:104015 header: Last-Modified: Sun, 30 May 2010 09:40:15 GMT
20100530:104015 header: Content-Type: text/html; charset=utf-8
20100530:104015 header: Location: http://localhost:55555/index.php?title=Main_Page

Wiki
20100530:104015 header: X-Powered-By: PHP/5.2.13
20100530:104015 header: Set-Cookie: wikidb_session=4015c71142hnqa37cn2rak3r87; path=/; HttpOnly
20100530:104015 header: Content-type: text/html; charset=UTF-8
20100530:104015 header: Content-language: en
20100530:104015 header: Vary: Accept-Encoding, Cookie
20100530:104015 header: X-Vary-Options: Accept-Encoding;list-contains=gzip,Cookie;string-contains=wikidbToken;
                        string-contains=wikidbLoggedOut;string-contains=wikidb_session
20100530:104015 header: Expires: Thu, 01 Jan 1970 00:00:00 GMT
20100530:104015 header: Cache-Control: private, must-revalidate, max-age=0
20100530:104015 header: Last-Modified: Sun, 30 May 2010 09:36:16 GMT
20100530:104016 header: X-Powered-By: PHP/5.2.13
20100530:104016 header: Content-type: text/css; charset=UTF-8
20100530:104016 header: Cache-Control: public, s-maxage=18000, max-age=18000
20100530:104017 header: X-Powered-By: PHP/5.2.13
20100530:104017 header: Content-type: text/css; charset=UTF-8
20100530:104017 header: Cache-Control: public, s-maxage=18000, max-age=18000
20100530:104017 header: X-Powered-By: PHP/5.2.13
20100530:104017 header: Content-type: text/css; charset=UTF-8
20100530:104017 header: Cache-Control: public, s-maxage=18000, max-age=18000
20100530:104018 header: X-Powered-By: PHP/5.2.13
20100530:104018 header: Content-type: text/css; charset=UTF-8
20100530:104018 header: Cache-Control: private, s-maxage=0, max-age=18000
20100530:104018 header: X-Powered-By: PHP/5.2.13
20100530:104018 header: Content-type: text/javascript; charset=UTF-8
20100530:104018 header: Cache-Control: private, s-maxage=0, max-age=18000

Edit
20100530:104031 header: X-Powered-By: PHP/5.2.13
20100530:104031 header: Content-type: text/html; charset=UTF-8
20100530:104031 header: Content-language: en
20100530:104031 header: Vary: Accept-Encoding, Cookie
20100530:104031 header: X-Vary-Options: Accept-Encoding;list-contains=gzip,Cookie;string-contains=wikidbToken;
                        string-contains=wikidbLoggedOut;string-contains=wikidb_session
20100530:104031 header: Expires: Thu, 01 Jan 1970 00:00:00 GMT
20100530:104031 header: Cache-Control: private, must-revalidate, max-age=0

Save
20100530:104051 header: Status: 302 Moved Temporarily
20100530:104051 header: X-Powered-By: PHP/5.2.13
20100530:104051 header: Vary: Accept-Encoding, Cookie
20100530:104051 header: X-Vary-Options: Accept-Encoding;list-contains=gzip,Cookie;string-contains=wikidbToken;
                        string-contains=wikidbLoggedOut;string-contains=wikidb_session
20100530:104051 header: Expires: Thu, 01 Jan 1970 00:00:00 GMT
20100530:104051 header: Cache-Control: private, must-revalidate, max-age=0
20100530:104051 header: Content-Type: text/html; charset=utf-8
20100530:104051 header: Location: http://localhost:55555/index.php?title=Main_Page
20100530:104051 header: X-Powered-By: PHP/5.2.13
20100530:104051 header: Content-type: text/html; charset=UTF-8
20100530:104051 header: Content-language: en
20100530:104051 header: Vary: Accept-Encoding, Cookie
20100530:104051 header: X-Vary-Options: Accept-Encoding;list-contains=gzip,Cookie;string-contains=wikidbToken;
                        string-contains=wikidbLoggedOut;string-contains=wikidb_session
20100530:104051 header: Expires: Thu, 01 Jan 1970 00:00:00 GMT
20100530:104051 header: Cache-Control: private, must-revalidate, max-age=0
20100530:104051 header: Last-Modified: Sun, 30 May 2010 09:40:56 GMT

Ubuntu Save got a bit futher
20100530:215544 header: X-Powered-By: PHP/5.3.2-1ubuntu4.2
20100530:215544 header: Content-type: text/css; charset=UTF-8
20100530:215544 header: Cache-Control: private, s-maxage=0, max-age=18000


I then also printed the content corresponding to the headers which comes out in 1KB blocks from line 273. I found that the content corresponding to the headers before the lock up is the page that should have been returned to the client after saving. The content corresponding with the last headers sent is the wiki's Atom feed!? weird! no seems norma, removing RSS feed requests with $wgFeed = false didn't fix it, the lockup simply happens at a different point.

I installed xdebug with apt-get install php5-xdebug so that I could do a function trace to find where its locking up. To activate the extension I added the following directives to the end of php.ini, the results are logged to /tmp/debug. Note that the wiki runs from CGI which has it's php.ini in /etc/php5/cgi/php.ini, but NanoWeb's config is in /etc/php5/cli/php.ini.

xdebug.profiler_enable = 1;
xdebug.profiler_append = 1;
xdebug.profiler_output_name = debug;
xdebug.collect_params = 1;
xdebug.collect_vars = 1;
xdebug.collect_return = 1;


On Ubuntu, the lockup only seems to happen after NanoWeb starts from the shell and the shell is left open... after the lockup, input to the shell is locked too, and closing the shell frees the lockup... weird! During the lockup, NanoWeb is actually running through its main loops cycle as the function trace shows it cycling through calls to socket_select, pcntl_waitpid and time functions.

Notes on the problem

  • Happens with either SQLite or MySQL
  • Happens when saving even if no revision is created
  • Happens on saving prefs