Foswiki

From DreamHost
Jump to: navigation, search

What is Foswiki

FosWiki is an Enterprise Collaboration Platform that is a fork of TWiki. Foswiki is a Perl-based structured wiki application. (A structured wiki is a combination of a traditional freeform wiki and a more structured database typically used to run a collaboration platform, knowledge management system or document management system or team portal.) Users can create wiki applications using the Foswiki Markup Language, and developers can extend its functionality with plugins.

How to install Foswiki on Dreamhost

  • Installation of Foswiki on Dreamhost is similar to installation of Twiki
  • Before starting installation find your IP Address (using cmd command from Windows or ifconfig from Linux)

Put your IP in bin/.htaccess file and configure Foswiki Go to wiki.mydomain.com/bin/configure and run the configuration script.

Initial setup

  • Create your Foswiki directory, e.g. /home/mylogin/mydomain.com/foswiki
  • Download the latest tgz: ex. Foswiki-1.1.9.tgz
  • FTP the Foswiki-1.1.9.tgz file into your mydomain.com/foswiki directory
  • Log into dreamhost with your shell account
  • First create a tmp folder for foswiki (it uses it while it's running)
 cd
 mkdir tmp
 chmod 755 tmp
 cd tmp
 mkdir foswiki
 chmod 755 foswiki
  • Now go to your foswiki directory
 cd 
 cd mydomain.com/foswiki
  • unzip the compressed foswiki file you downloaded
 tar -xvzf Foswiki-1.1.5.tgz
  • there's now an install file you can look at to help you: mydomain.com/foswiki/INSTALL.html
  • create the /foswiki/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 $foswikiLibPath value to your Foswiki installation directory
 vi LocalLib.cfg
  • e.g. LocalLib.cfg will now have a value like
 $foswikiLibPath = "/home/mylogin/mydomain.com/foswiki/lib";
 cd 
 cd mydomain.com/foswiki
 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/foswiki/bin/configure

Running the configuration script

  • Go to mydomain.com/foswiki/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/foswiki
    • Security Setup
      • LoginManager: use None if you want everyone to be able to edit your wiki. Otherwise you can choose TemplateLogin to have Foswiki 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 Foswiki. 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 foswiki directory
 cd
 cd mydomain.com/foswiki
  • 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/foswiki 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 foswiki is at mydomain/foswiki)
 Redirect /foswiki/index.html http://www.mydomain.com/foswiki/bin/view
  • Prevent further configuration changes by setting the site config file to readonly
 cd
 cd mydomain.com/foswiki
 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

What SvenDowideit does

  • I unzip foswiki into a non-web directory (the root for eg)
  • cd the_host.com
  • ln -s ../foswiki/pub .
  • cp ../foswiki/bin/configure .
  • cp ../foswiki/bin/setlib.cfg .
  • cp ../foswiki/bin/LocalLib.cfg .

Then I set up a .htaccess file to treat configure as a cgi script and goto http://the_host.com/configure and run through that.

next up, use configure to install FastCgiEngineContrib and

  • cp ../foswiki/bin/foswiki.fcgi .

add foswiki.fcgi as a fastcgi script, and setup ShortUrl's

done.

.htaccess file

  Options -Indexes +SymLinksIfOwnerMatch
  DirectoryIndex index.php index.tml /
  
  <Files "configure">
       SetHandler cgi-script
  </Files>
  <Files "foswiki.fcgi">
       SetHandler fastcgi-script
  </Files>
  RewriteCond %{REQUEST_URI} !/*configure
  RewriteCond %{REQUEST_URI} !/*foswiki.fcgi
  RewriteCond %{REQUEST_URI} !/*pub
  RewriteCond %{REQUEST_URI} !/*stats
  RewriteRule ^(.*)$ foswiki.fcgi/$1 [L]