TWiki

From DreamHost
Jump to: navigation, search

TWiki is a wiki system similar to MediaWiki but different (better, IMHO) in several ways:

  • General:
    • The formatting is easier because it resembles normal email/chat codes more, like *bold* and _italic_.
    • You can attach files to pages, the same way you attach files to emails.
    • TWiki automagically creates hyperlinks to other pages whenever you mention them, so you don't need to use [ and ] brackets so often.
    • TWiki has built-in help and tutorials that make it very easy to get started, and also easy to learn the more advanced features.
  • Administration:
    • Most aspects of TWiki can be changed using a browser (with admin login) instead of requiring direct telnet access to the server.
    • There are LOTS of plugins and skins that you can use to customize your TWiki website. They are easy to install and well documented.
    • There is a very effective support community to give you quick solutions to your problems.
    • There is also an active IRC community that can help with installation problems. Be sure to mention that you're doing an in installation on DH as there are quite a few folks in TWiki community that use DH and are very knowledgeable about setup here.
    • TWiki has access control. (see TWiki Advantages)


TWiki runs quite nicely on DH. The installation using TWiki4 goes very smoothly if you just remember to do a couple of things:

  • Permissions of some the files in the distribution need to be tweaked. Specifically, /bin/.htaccess and bin/LocalLib.cfg and any files in the root that you want to view need to be set to 644.
  • Be sure to include in bin/.htaccess this line: "SetHandler cgi-script". You can use the template htaccess file provided.
  • In shell at the root of your TWiki installation, run this command: "chmod 644 `find pub -type f -print`" so that the style sheets and graphics in the pub directory are universally accessable. This is addressed at the end of the INSTALL.html file.

On level1 shared hosting, response time can be quite slow up to 15 seconds to display a page, even on small Twikis. Mod_perl and SpeedyCGI could improve response time but DreamHost does not support them. Alternatively caching is a workaround but it has some limitation. (see Twiki_Troubleshooting)

Installing Twiki v4.1.1 on Dreamhost on mydomain.com/twiki

I last tried using v4.1.1, and I used a shell account for some of the steps: (Note: These instructions written for v4.1.1 but validated as still correct for v4.1.2 as of 1 May 07)

Initial setup

  • create your twiki directory, e.g. /home/mylogin/mydomain.com/twiki
  • Download the latest tgz: http://twiki.org/cgi-bin/view/Codev/DownloadTWiki
  • FTP the TWiki-4.1.1.tgz file into your mydomain.com/twiki directory
  • Log into dreamhost with your shell account
  • First create a tmp folder for twiki (it uses it while it's running)
 cd
 mkdir tmp
 chmod 755 tmp
 cd tmp
 mkdir twiki
 chmod 755 twiki
  • Now go to your twiki directory
 cd 
 cd mydomain.com/twiki
  • unzip the compressed twiki file you downloaded
 tar -xvzf TWiki-4.1.1.tgz
  • there's now an install file you can look at to help you: mydomain.com/twiki/INSTALL.html
  • create the /twiki/bin/LocalLib.cfg file from the sample LocalLib.cfg.txt file
 cd bin
 cp LocalLib.cfg.txt LocalLib.cfg
  • use vi to edit the LocalLib.cfg file and set the $twikiLibPath value to your twiki installation directory
 vi LocalLib.cfg
  • e.g. LocalLib.cfg will now have a value like
 $twikiLibPath = "/home/mylogin/mydomain.com/twiki/lib";
 cd 
 cd mydomain.com/twiki
 chmod -R 755 pub
 chmod 644 `find pub -type f -print`
  • Note that the ` in the last step is the backwards apostrophe, often under the tilde key on the keyword ~.
  • Now create an .htaccess file in the bin directory so you can run the configuration script.
 vi bin/.htaccess
  • and give it one line:
 SetHandler cgi-script
  • Now you can run the configuration script at mydomain.com/twiki/bin/configure

Running the configuration script

  • Go to mydomain.com/twiki/bin/configure
  • At the top it might have a warning like "cannot find LocalSite.cfg" -- that's normal.
  • You want to set the following values at least:
    • General Path Settings
      • Double check the paths in PubDir, TemplateDir, DataDir, and LocalesDir. If they look like /home/.something/mylogin/mydomain.com/blah change them to /home/mylogin/mydomain.com/blah
      • Set TempFileDir to /home/mylogin/tmp/twiki
    • Security Setup
      • LoginManager: use None if you want everyone to be able to edit your wiki. Otherwise you can choose TemplateLogin to have TWiki manage logins and require registration in order to edit the wiki.
      • AuthScripts: if LoginManager is None, then you probably want to make AuthScripts blank. Not sure on this, since I used TemplateLogin for LoginManager.
    • Anti Spam Settings
      • Email Padding: Put something in here, like 'NOSPAM'
    • Mail and Proxies
      • WebMasterEmail: enter the email address of whoever's in charge of the wiki, e.g. support@mydomain.com or wikiadmin@mydomain.com
      • WebMasterName: Leave the default, or use something like MyCompany Wiki Support, or your name, I guess.
      • STMP Mailhost: set to localhost
  • Now click Next at the very bottom of the page
  • You'll get a configuration password page -- enter a strong password at the bottom and click Change Password and Save
  • After a few seconds you'll see a page listing all the changes. Scroll to the bottom and click Return to Configuration
  • Now let's enable the WYSIWYG plugin for TWiki. Expand the Plugins section and check the WysiwygPluginEnabled checkbox.
  • Click Next.
  • At the top, enter the strong password you entered a few steps ago and click Save. Ok, now to do some additional administration.

Closing the holes

  • go back to your shell login and switch to the twiki directory
 cd
 cd mydomain.com/twiki
  • Block access to private subdirectories with these steps
 cp subdir-htaccess.txt data/.htaccess
 cp subdir-htaccess.txt lib/.htaccess
 cp subdir-htaccess.txt locale/.htaccess
 cp subdir-htaccess.txt templates/.htaccess
  • configure access to the pub directory
 cp pub-htaccess.txt pub/.htaccess
  • configure the root directory access
 cp root-htaccess.txt .htaccess
  • edit the root .htaccess so that when users go to mydomain.com/twiki they get redirected to the right spot
 vi .htaccess
  • uncomment the last line (remove the #), fix the paths, and save the file. Note that the file is probably read-only, so use :x! to save your changes. The last line should look like (assuming your twiki is at mydomain/twiki)
 Redirect /twiki/index.html http://www.mydomain.com/twiki/bin/view
  • Prevent further configuration changes by setting the site config file to readonly
 cd
 cd mydomain.com/twiki
 chmod 444 lib/LocalSite.cfg
  • If in the future you want to run the configuration script again, set the lib/LocalSite.cfg permissions to 644.

Finish wiki permissions

Installing Twiki v4.3.2 on Dreamhost on mydomain.com/twiki

A few more steps are required in order to get TWiki v4.3.2 up and running. Follow the steps provided for version v4.1.1, but before opening the configure page, do the following:

  • chmod 755 all perl scripts in twiki/bin folder. Here's the quick and dirty way
 cd
 cd mydomain.com/twiki
 chmod 755 *
 chmod 644 LocalLib.cfg
  • (Optional) Use the .htaccess templates provided with the TWiki installation to configure access permissions
 cd
 cd mydomain.com/twiki/bin
 cp .htaccess.txt .htaccess
 htpasswd -c ../data/.htpasswd admin
 New password:
 Re-type new password:

Modify twiki/bin/.htaccess file. You must replace the strings {DataDir}, {ScriptUrlPath} and {Administrators}. These strings should be replaced by something like

 {DataDir} = /home/myuser/mydomain.com/twiki/data
 {ScriptUrlPath} = /twiki/bin
 {Administrators} = admin

Now open the configure page on your browser. You'll be asked for the credentials you provided when you executed the htpasswd command. If the authentication is successful you should be able to view the configure page.

Installing Twiki v5.0.0 on mydomain.com/twiki

TWiki v5.0.0 can be installed on a non-VPS account. These are similar steps to v4.1.1, however they've been modified to include 5.0.0 changes.

Initial setup

  • go to http://twiki.org/cgi-bin/view/Codev/DownloadTWiki and click "I'd rather skip this form" and follow the zip or tgz link. Stop the download before it starts and copy the address for the direct link
  • login to your shell account
  • create your twiki directory, e.g. /home/mylogin/mydomain.com/twiki
 cd 
 cd mydomain/
 mkdir twiki
  • wget the Twiki release
 cd /home/mylogin/mydomain.com/twiki
 wget [paste the direct link address in]
  • unzip the compressed twiki file you downloaded
 tar -xvzf TWiki-5.0.0.tgz
 or 
 unzip TWiki-5.0.0.zip
  • there's now an install file you can look at to help you: mydomain.com/twiki/INSTALL.html
  • create the /twiki/bin/LocalLib.cfg file from the sample LocalLib.cfg.txt file
 cd bin
 cp LocalLib.cfg.txt LocalLib.cfg
  • use vi to edit the LocalLib.cfg file and set the $twikiLibPath value to your twiki installation directory
 vi LocalLib.cfg
  • e.g. LocalLib.cfg will now have a value like
 $twikiLibPath = "/home/mylogin/mydomain.com/twiki/lib";
 cd 
 cd mydomain.com/twiki
 chmod -R 755 pub
 chmod 644 `find pub -type f -print`
  • Note that the ` in the last step is the backwards apostrophe, often under the tilde key on the keyword ~.
  • chmod 755 all perl scripts in twiki/bin folder. Here's the quick and dirty way
 cd
 cd mydomain.com/twiki/bin
 chmod 755 *
 chmod 644 LocalLib.cfg
  • Use the .htaccess templates provided with the TWiki installation to configure access permissions
 cd
 cd mydomain.com/twiki/bin
 cp .htaccess.txt .htaccess
 vi .htaccess
  • as the comments note you'll need to find and replace all instances of at least {DataDir} {DefaultUrlHost} {ScriptUrlPath} {Administrators}. In this example {DataDir} is replaces with /home/username/mydomain.com/twiki/data/ and {DefaultUrlHost} is replaced with /twiki/ and {ScriptUrlPath} is replaced with bin/ and {Administrators} is replaced with admin
  • For example the line
AuthUserFile {DataDir}/.htpasswd 
  • becomes
 AuthUserFile /home/username/mydomain.com/twiki/data/.htpasswd 
  • and the lines
 {DefaultUrlHost}{ScriptUrlPath}/preview {DefaultUrlHost}{ScriptUrlPath}/save {DefaultUrlHost}{ScriptUrlPath}/attach {DefaultUrlHost}{ScriptUrlPath}/upload {DefaultUrlHost}{ScriptUrlPath}/rename {DefaultUrlHost}{ScriptUrlPath}/manage {DefaultUrlHost}{ScriptUrlPath}/installpasswd {DefaultUrlHost}{ScriptUrlPath}/passwd 
  • becomes
 /twiki/bin/preview /twiki/bin/save /twiki/bin/attach /twiki/bin/upload /twiki/bin/rename /twiki/bin/manage /twiki/bin/installpasswd /twiki/bin/passwd 
  • You will also need to edit the <FilesMatch "configure.*"> section. You may either comment out all but the "SetHandler cgi-script" line and proceed to load mydomain.com/twiki/bin/configure in your browser, then return when you are done with configure and remove the comments like so
 
<FilesMatch "configure.*">
	SetHandler cgi-script
#	Order Deny,Allow
#	Deny from all
#	Allow from 127.0.0.1, 192.168.0.10
#	Require user {Administrators}
#	Satisfy Any
</FilesMatch>
  • or add your IP value to the "Allow from" line, close vi and run
 htpasswd -c ../data/.htpasswd admin
 New password:
 Re-type new password:
  • Now you can run the configuration script at mydomain.com/twiki/bin/configure

Running the configuration script

  • Go to mydomain.com/twiki/bin/configure
  • At the top it might have a warning like "cannot find LocalSite.cfg" -- that's normal.
  • You want to set the following values at least:
    • General Path Settings
      • Double check the paths in PubDir, TemplateDir, DataDir, and LocalesDir. If they look like /home/.something/mylogin/mydomain.com/blah change them to /home/mylogin/mydomain.com/blah
      • Set TempFileDir to /home/mylogin/tmp/twiki
    • Security Setup
      • LoginManager: use None if you want everyone to be able to edit your wiki. Otherwise you can choose TemplateLogin to have TWiki manage logins and require registration in order to edit the wiki.
      • AuthScripts: if LoginManager is None, then you probably want to make AuthScripts blank. Not sure on this, since I used TemplateLogin for LoginManager.
    • Anti Spam Settings
      • Email Padding: Put something in here, like 'NOSPAM'
    • Mail and Proxies
      • WebMasterEmail: enter the email address of whoever's in charge of the wiki, e.g. support@mydomain.com or wikiadmin@mydomain.com
      • WebMasterName: Leave the default, or use something like MyCompany Wiki Support, or your name, I guess.
      • STMP Mailhost: set to localhost
  • Now click Next at the very bottom of the page
  • You'll get a configuration password page -- enter a strong password at the bottom and click Change Password and Save
  • After a few seconds you'll see a page listing all the changes. Scroll to the bottom and click Return to Configuration
  • Now let's enable the WYSIWYG plugin for TWiki. Expand the Plugins section and check the WysiwygPluginEnabled checkbox.
  • Click Next.
  • At the top, enter the strong password you entered a few steps ago and click Save. Ok, now to do some additional administration.

Closing the holes

  • go back to your shell login and switch to the twiki directory
 cd
 cd mydomain.com/twiki/bin/
 vi .htaccess
  • if you choose to comment out the <FilesMatch "configure.*"> section, remove the comments so it looks similar to
<FilesMatch "configure.*">
	SetHandler cgi-script
	Order Deny,Allow
	Deny from all
	Allow from 127.0.0.1, 192.168.0.10
	Require user {Administrators}
	Satisfy Any
</FilesMatch>
  • Block access to private subdirectories with these steps
 cd 
 cd mydomain.com/twiki/
 cp subdir-htaccess.txt data/.htaccess
 cp subdir-htaccess.txt lib/.htaccess
 cp subdir-htaccess.txt locale/.htaccess
 cp subdir-htaccess.txt templates/.htaccess
  • configure access to the pub directory
 cp pub-htaccess.txt pub/.htaccess
  • configure the root directory access
 cp root-htaccess.txt .htaccess
  • edit the root .htaccess so that when users go to mydomain.com/twiki they get redirected to the right spot
 vi .htaccess
  • uncomment the last line (remove the #), fix the paths, and save the file. Note that the file is probably read-only, so use :x! to save your changes. The last line should look like (assuming your twiki is at mydomain/twiki)
 Redirect /twiki/index.html http://www.mydomain.com/twiki/bin/view
  • Prevent further configuration changes by setting the site config file and configure script to readonly
 cd
 cd mydomain.com/twiki/
 chmod 444 lib/LocalSite.cfg
 chmod 444 bin/configure
  • If in the future you want to run the configuration script again, set the lib/LocalSite.cfg permissions to 644 and bin/configure to 555

Finish wiki permissions


For more information regarding TWiki installation, please consult the TWiki Installation Guide.