...explore qbfreak.net
HowISetupTWiki412OnDreamhost 1 - 30 May 2007 - Users.JasonHill
Line: 1 to 1
Added:
>
>

TWiki 4.1.2 on Dreamhost

These instructions assume you have a shell account with Dreamhost. Before you begin, connect to your account with an SSH client such as PuTTY (windows) or ssh (Linux). All actions below are either performed on the server or in your browser. Command to run in the shell will look like this.

For security reasons, we will be install TWiki to a directory that is not directly accessible from the internet. Once installed, we will use symbolic links to make the appropriate sections accessible. We will name the TWiki directory after the TWiki version, this is to aid in upgrading. Not only will it be obvious from the file system which version of TWiki is installed, but you can quickly switch between installed versions by changing the symbolic links. Externally, the name of the TWiki install directory will not be visible.

  1. Create a directory to install TWiki
    • Change to your home directory: cd ~
    • mkdir TWiki412
    • cd TWiki412

  1. Download TWiki 4.1.2 from TWiki.org and unpack the archive

  1. Configure the twiki/lib path and setup twiki/bin
    • Create bin/LocalLib.cfg from the included template: cp bin/LocalLib.cfg.txt bin/LocalLib.cfg
    • Edit bin/LocalLib.cfg and change the $twikiLibPath to /home/user/TWiki412/lib (replace user with your username)
    • Create bin/.htaccess from the included template: cp bin/.htaccess.txt bin/.htaccess
    • Edit bin/.htaccess and make the following replacements:

Replace With
{DataDir} /home/user/TWiki412/data
{ScriptUrlPath} /TWiki412/bin
{Administrators} admin

      • Replace user in all above paths with your username
      • Note that there may be multiple occurances of each item in the file

  1. Create the password file and add the configure script admin user :
    • htpasswd -dc data/.htpasswd admin
    • When prompted, enter the new password to access the configure script. Note that as a side effect, the TWiki login will recognize the admin user with this password

  1. Create the web-accessible directory
    • mkdir /home/user/www.yourdomain.com/twiki (replace user with your username and www.yourdomain.com with the domain where you wish to install TWiki. This will not create the domain, you must have already done so through the Dreamhost web panel

  1. Create the symbolic links so that TWiki is accessible through the webserver
    • Change to the web-accessible directory: cd /home/user/www.yourdomain.com/twiki
    • Create the twiki/bin link: ln -s /home/user/TWiki412/bin/
    • Create the twiki/pub link: ln -s /home/user/TWiki412/pub/

  1. Create the .htaccess file for the web-accessible directory (/home/user/www.yourdomain.com/twiki/.htaccess) and paste the following:
		# Redirect www.yourdomain.com/twiki/ to Main/WebHome
		#   The first path here must be a URL path, not a file pathname
		Redirect /twiki/index.html http://www.yourdomain.com/twiki/Main/WebHome
		# Allow the server to follow symbolic links, deny directory listings
		Options FollowSymLinks -Indexes
		# Support for www.yourdomain.com/twiki/Web/Topic style URLs, making =bin/view= optional
		RewriteEngine On
		RewriteOptions MaxRedirects=2
		RewriteRule ^([A-Z].*) /twiki/bin/view/$1

  1. Make additional security and server configuration with .htaccess files
    • Additional server configuration: cp TWiki412/root-htaccess.txt TWiki412/.htaccess
    • Mild security for twiki/pub: cp TWiki412/pub-htaccess.txt TWiki412/pub/.htaccess
    • Edit TWiki412/pub/.htaccess and change the Options None directive to Options -Indexes FollowSymlinks?
      • This is required for the webserver to follow the symbolic links

  1. Create the TWiki session directory: mkdir TWiki412/tmp

  1. Set file permissions:
    • Allow the webserver to read all TWiki files: chmod o+r TWiki412/ -R
    • Allow the webserver to execute twiki/bin files: chmod o+rx TWiki412/bin/*
    • Deny execution of twiki/bin .htaccess and templates: chmod o-x TWiki412/bin/*.txt TWiki412/bin/.htaccess
    • Allow webserver modification of TWiki topics: chmod o+rw TWiki412/data/*

We're almost done, its time to configure TWiki with the web browser.

  1. Browse to http://www.yourdomain.com/twiki/bin/configure
    • Under General Path Settings verify the following settings:

Setting Desired value
{DefaultUrlHost} www.yourdomain.com
{ScriptUrlPath} /twiki/bin
{PubUrlPath} /twiki/pub

      • Remove the storage server name from the paths. For instance my home directory is /home/qbfreak/, however the full path to is detected as /home/.daphne/qbfreak/. The .daphne section needs to be removed in the event that my home directory is ever moved to a different server. Check the following paths: {PubDir}, {TemplateDir}, {DataDir}, and {LocalesDir}

      • Set the session temp directory: Change {TempfileDir} to /home/user/TWiki412/tmp
      • Save your configure settings: Click the Next button and set the new configure script password. This password will be required to save any changes in configure later

  1. Finish configuration
    • The configure script should have reloaded after the last step, if not, browse to http://www.yourdomain.com/twiki/bin/configure
    • There should only be three warnings: {AuthScripts} under Security Setup, and {WebMasterEmail} and {MailProgram} under Mail and Proxies.
    • Configure the Login manager, we want apache to handle all logins. Under the Security Setup section:
      • Set {LoginManager} to TWiki::Client::ApacheLogin
      • It is safe to ignore the {AuthScripts} warning, its related to the fact that {LoginManager} was not set yet
      • Verify that {Htpasswd}{FileName} is set to /home/user/TWiki412/data/.htpasswd
    • Configure logging: Under Log Files verify that {ConfigurationLogName}, {DebugFileName}, {WarningFileName}, and {LogFileName} are all set to files in the directory /home/user/TWiki142/data
    • Configure RCS: Under Store Settings verify that {RCS}{WorkAreaDir} is set to /home/user/TWiki412/pub/_work_areas
    • Configure email: By default TWiki emails new users an activation code that they must use before logging in. To do this and other email notifications, TWiki must know how to send email. Under the Mail and Proxies section:
      • Set {WebMasterEmail} to a valid email address for your site
      • The default setting for {MailProgram} is ok, Dreamhost has sendmail installed
      • Ignore all of the warnings for the {SMTP} settings, because we have {MailProgram} set, all mail will be sent through sendmail

  1. Lastly, view your newly installed TWiki: Browse to http://www.yourdomain.com/twiki/
    • You may wish to clear your existing CGI sessions before editing topics or creating users, if you do not you will appear logged in to TWiki as admin. To clear the CGI sessions: rm TWiki412/tmp/* and restart the browser

At this point you're ready to add users and edit topics. You might want to take a look at HTML starting at "Set TWiki Preferences"

-- JasonHill? - 15 Mar 2007


Revision 1r1 - 30 May 2007 - 19:25 - JasonHill
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding QBFreak.net? Send feedback
Powered by TWiki/Dakar Wed, 08 Feb 2006 build 8740
Syndicate this site RSSATOM