create new tag
, view all tags

Running TWiki on LINUX/Windows without Web server/lan

This is a simple WEB server totaly written in a single Perl script and makes TWiki running on Windows or Linux, without installing anything. Remote user can be selected from a simple Tk graphical interface (if Perl/Tk available), TWiki.cfg file is automatically setup with minimum required to run TWiki.

See PerlWebServers for other solutions based on Perl only.

Why ?

  • to make (a copy of) TWiki available on your laptop (without any network, nothing to install),
  • to learn and play with TWiki,
  • to make TWiki running in seconds... without setting things (for lazy ones wink )
  • because I love TWiki !
  • just for fun !


  • Only one HTTPD request at a time to limit use of fork, keep good performances,
  • not imagined to be use as a real WEB server for TWiki, only for personal use,
  • On Win32, you should upgrade TWiki Search.pm, see SearchWithNoPipe.
  • only tested on Mandrake 8.2, Win98SE, W2000.
  • seems to work fine with with Plugins like LdapPlugin, ChartPlugin, skin plugins, etc...

How to build your own TWiki from scratch

  • create directory foo
  • add script TWikiHttpd.bat
  • add a TWiki tree copy
  • add PERL pre-installed
  • if on Windows, add the UNIX dir with Win32 UNIX commands grep.exe,
  • run the script (perl TWikiHttpd.cmd or TWikiHttpd.cmd )
  • launch your explorer on http://localhost/

Files needed

  • TWikiHttpd.bat
  • PERL/ (a pre-installed PERL is OK, no need to install PERL wink )
  • TWiki/

Planned to do

  • play with it at home this week end wink

Suggestions :

  • to merge .pl .bat so to have only one .bat script (like I did it in TWikiHttpd.cmd) ? Is that really usefull ?

Help and comments are welcome !

-- PatrickNomblot - 17 Jun 2003

Patrick, this is excellent stuff! I have seen that you use the trick to run the same file as a Windows command and as a Perl script (I have seen the same at work).

Since the script is so short we could include that in the TWiki package. Ideally we could offer a package for Windows that includes everything, including the standalone Perl. How big is it? Is mixing GPL and artistic license OK?

I renamed the topic from TWikiWebServer to TWikiWebServerForWindows since it is Windows specific.

-- PeterThoeny - 17 Jun 2003

The Artistic License is NOT compatible for mixing with the GPL.

(Which is the reason gnu.org recommend using the Artistic License with Perl code only ) There are GPL compatible versions of it however:

-- MichaelSparks - 17 Jun 2003

Nicely done Patrick. I did once alter Search.pm not to need ls or grep, but removing grep made things a lot slower. Still it would be very possible to have the option of running with grep. As a matter of interest, can this Web server serve up more than one page at a time? I can just see someone installing on Windows, then offering for others to try and then people saying TWiki is slow.

-- JohnTalintyre - 18 Jun 2003

Thank you John smile , I appreciate this help; many thanks ! I have just seen other nice Perl Web servers in PerlWebServers.

I think that external GREP for grep in TOPICS is OK, but for TOPIC list (matching name), simple PERL would be enough and mainly, do not need any PIPE. To serve more than one page, I could use fork... it's really too slow on W2000. For instant, the idea is to use TWikiHttpd as a personnal server.

Peter, this script runs also on LINUX, the .cmd is only to make it running on Windows without installing PERL. To run it on Linux, just run perl TWikiHttpd.cmd or simply add the #!/bin/perl in first line. I would suggest to let it platform independant, as TWiki is. Ok, it-s true, I made some corrections to make it running correctly on Linux too embarrassment So, if you agree, I would be very happy if you accept to rename TOPIC to TWikiMiniWebServer (for example) as I would like to keep it running also on Linux, even if installing APACHE is really the best thing to do to run TWiki on Linux!. Many thank's, Peter !

-- PatrickNomblot - 18 Jun 2003

I renamed the topic as requested.

-- PeterThoeny - 18 Jun 2003

Many thank's Peter. I'm really very happy and proud to give something to the TWiki group smile

-- PatrickNomblot - 19 Jun 2003

Patrick, this is truly great - many thanks. I am certain that this will be high up on my list of most-useful tools smile

Would there be any simple reason why I can't get this to work on Windows 98? My W2K setup works like a charm, but http://localhost/ won't display anything on Win98 (gives a 'page cannot be found' typical IE message). (I noted the patch to search.pm to account for pipe issue in W2K, but I don't think this is relevant here.)

-- RossC - 19 Jun 2003

I ran this and it worked!

I was a bit concerned by it patching files without me asking and even more so not seeming to create a backup copy of the old files.

-- JohnTalintyre - 19 Jun 2003

Yes, good remark John. I add the backup / restore of changed files. The version 1.4 does that. Next version should run also on Win98 (need to rename it in .bat). Thank you for these good remarks !

-- PatrickNomblot - 19 Jun 2003

Patrick, I think this will make developing/debugging skins on my local machine much easier. Thanks! Attached is a patch against v1.4 which I did to make it play nicely with cygwin. Basically all it does is add 1) search %PATH% for perl.exe and set the PERLDIR variable from that, and 2) delay starting the browser for a few seconds so that the httpd server has a chance to get started.

I wasn't sure if I should put the CMD subroutines at the end of the file or the beginning (before/after perl). I chose end. Feel free to move.

-- MattWilkie - 19 Jun 2003

Many thanks Matt, I will have a look. I have worked a little bit wink on 1.5 and I am proud to offer this new version 1.6 which runs on Linux, Win98, W2000.

ALERT! I split the script in :

  • TWikiHttpd.pl the PERL script

Note that cmd was only good for NT systems...and the batch script is in fact no very usefull as TWikiHttpd.pl does all the work without the help of an external batch.

I have proposed a new version of TWiki Search.pm with no pipe (_ls | _) which is also running well on all Win32, see SearchWithNoPipe. TWikiHttpd.pl 1.6 does not patch TWiki Perl libs any more, 1.6 has also bug fixed for wrong debugfilename setting in TWiki.cfg.

Note : I suggest to remove attached TWikiHttpd.cmd to save disk space on TWiki.org, and maybe the patch as this new version know how to wait before browser launch.

ALERT! : UNIX/grep.exe (that you can get at http://unxutils.sourceforge.net) will look into .txt files rather than in *.txt$" files (regex wich . CYGWIN grep does not have this bug), enhanced Search.pm in SearchWithNoPipe fix that point too.

1.8 version support UTF8 (%xx) url's, usefull for ChartPlugin

-- PatrickNomblot - 25 Jun 2003

  • 1.8 version support UTF8 (%xx) url's, usefull for ChartPlugin

URLs that include %xx aren't necessarily UTF-8 - they could be ISO-8859-1 or whatever. In fact there's no defined character set for URLs, even though there's a defined charset for pages (through InternationalisationEnhancements). For discussion of UTF-8 in pages and URLs, see InternationalisationUTF8 and EncodeURLsWithUTF8.

-- RichardDonkin - 05 Jul 2003

Moved from near top of page where it was hard to find -- RD

I tried to install a testing standalone solution of TWiki on my laptop. I followed almost all the rules I found here. But it didnīt work. I didnīt understand the discussion of search.pm and surely made mistakes on installation. Iīm a newbee on wikis at all. My limitations are the following: As a journalist I understand a lot from Content - lesser from Management - little from the System behind. Nevertheless Iīm interested in all kinds of CMSs. Okay, could somebody please lent me a helping hand or some enlightening links to realise a working TWiki on my laptop? Thanks to all, who take a newcomer seriously but I want to install a working wiki as the methodological part of my doctoral thesis. CU Helmer

-- HelmerPardun - 23 Jul 2003

I suspect this mini webserver setup is not as well tested / documented as it will be some day - assuming this is on Windows, you might like to try the WindowsInstallCookbook, which is probably more hassle but well tested. This works fine on a laptop - includes Apache but that's actually quite lightweight and never caused problems on my laptop (which is where I developed and tested the cookbook.)

-- RichardDonkin - 23 Jul 2003

Helmer, a very new initiative (and unsupported at present) is MichaelSparks TWikiUnixInstaller which will install a TWikiOnCygwin without ModPerl setup. You will need first to install CygWin. If it doesn't work for you then you will probably have to uninstall it and go back to the WindowsInstallCookbook as it is very early days.

It has heavier requirements for your laptop than using the TWikiMiniWebServer but, given your machine will be only serving yourself this is unlikely to be a problem unless you don't have a reasonably recent machine.

-- MartinCleaver - 23 Jul 2003

Do I enter a support request here or in the Support web? I made this page: TWikiMiniServerSaveProblem

-- TorbenGB - 05 Nov 2003

I have uploaded version 1.10 of twikiHttpd which fix a save problem which was due to redirect detection. Note that RCS managment may be handled via option rcslite in TWiki.cfg but it does not work for me. This seems to be a problem of date management and due to the fact that my system is "FR" , see TWikiMiniServerSaveProblem for details.

-- PatrickNomblot - 09 Dec 2003

Topic attachments
I Attachment History Action Size Date Who Comment
MS-DOS batch filebat TWikiHttpd.bat r6 r5 r4 r3 r2 manage 21.4 K 2003-12-09 - 15:21 PatrickNomblot Fix HTTP redirect detection
Edit | Attach | Watch | Print version | History: r32 < r31 < r30 < r29 < r28 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r32 - 2003-12-09 - PatrickNomblot
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.