Installation Guide Part 2

Post-Installation Configuration and Tuning

Once you have Foswiki installed and running, you can perform one or more of the following steps to tailor your installation to your needs. While most are optional, many of these will enhance your Foswiki installation's features and performance.

On this page:

Set Foswiki Site Preferences

Preferences for customizing many aspects of Foswiki are set by editing Main.SitePreferences. On that page you'll find some of the most common local site preferences such as the name for your site, the header logo image and, site tag line. However, there are many more site preference settings which you'll find in System.DefaultPreferences. If a given preference is not set in Main.SitePreferences, then it defaults to the value is defined in System.DefaultPreferences (or in the case of extensions, in the respective extension topics).

Because DefaultPreferences is included in Foswiki upgrade packages, you will simplify upgrades by not changing these DefaultPreferences. Instead, copy any settings you want to change and add them to Main.SitePreferences.

Automating Routine Tasks

Several Foswiki "house-keeping" tasks occur on daily basis and can be combined into a cron job (or equivalent). Here's a sample cron job that would combine the schedules for email notification, removal of expired sessions, and gathering of site statics:
0 0 * * * cd /usr/local/foswiki && perl -I bin tools/mailnotify -q
0 0 * * * cd /usr/local/foswiki/bin; ./statistics -subwebs 1 >/dev/null 2>&1
0 0 * * 0 cd /usr/local/foswiki/bin && perl ../tools/tick_foswiki.pl
Read further below about how to customize these schedules and script options to your particular needs. You can find some general information about cron jobs at MailerContrib - Setting up a cron job.

Enable Email Notification

Each web has an automatic email notification service that sends you an email with links to all of the topics modified since the last alert. To enable this service:
  1. Confirm the Mail and Proxies settings on the configure page.
  2. Setup a cron job (or equivalent) to call the tools/mailnotify script, as described in the System.MailerContrib topic.
  3. To enable S/MIME signatures on notification emails, see instructions below.

Enable Site Statistics

You can manually or automatically generate a listing of the most popular pages for each web (based on number of visits) and most active editor (based on number of topic saves). For information on setting up this feature, see the SiteToolStatistics topic.

Automate removal of expired sessions and lease files

By default Foswiki cleans out expired session and lease files each time any topic is viewed, but this has a performance cost. Instead you may wish to schedule a cron job (or equivalent) to run the tools/tick_foswiki.pl script, and set a negative value on the configure page for {Sessions}{ExpireAfter}. For more details, read CommandAndCGIScripts#A_61tick_foswiki.pl_61.

Site Security

Select the desired security level

Foswiki has a many security features that can be enabled/disabled and adjusted to suit your needs.

In many cases enabling a security feature prevents other features. It is a balance that the administrator has to choose depending on the purpose of the Foswiki installation (confidential vs public knowledge), the type of installation (intranet vs internet), and your type of business.

A new administrator is encouraged to read Foswiki:Support.SecurityFeatures which gives a walkthrough of the different security aspects and how to set the appropriate configuration settings. Note that that some security settings are only visible in configure in "expert mode" which you enter by clicking the "Show expert options" button at the top of the configure screen.

Enable Signed Email Notification

Foswiki administrative emails are an attractive target for SPAM generators and phishing attacks. One good way to protect against this possibility to enable S/MIME signatures on all administrative e-mails. To do this, you need an an X.509 certificate and private key for the the {WebMasterEmail} email account. Obtain these as you would for any other S/MIME e-mail user.

To enable Foswiki to sign administrative e-mails:
  1. Enable e-mail as described above
  2. Ensure that the system has the CPAN module Crypt::SMIME installed.
  3. If necessary, convert your certificate and key files to PEM format ( openssl has all the necessary utilities)
  4. Place the certificate anyplace convenient that the webserver can read. It should be protected against write. The conventional place under linux is /etc/pki/tls/certs
  5. Place the key file in a secure location that only the webserver (or CGI user) can read. It must not be readable by anyone else, and must not be served by the webserver.
  6. Using the configure script, change the following settings under Mail and Proxies:
    1. "Email Server" tab. Follow the directions under {MailMethod} and {MailProgram} to enable an external mail program such as sendmail. Net::SMTP is not supported.
      • {SMTP}{MAILHOST}, {SMTP}{SENDERHOST}, {SMTP}{Username} and {SMTP}{Password} are not used an may be deleted.
      • If Foswiki variable SMTPMAILHOST is defined in Main.SitePreferences it should be removed.
    2. "S/MIME" tab:
      • Enable the S/MIME checkbox
      • Enter the full path to the certificate file in the {SmimeCertificateFile} configuration variable
      • Enter the full path to the private key file in the {SmimeKeyFile} configuration variable
    3. Save the configuration
  7. Re-run the configure script an resolve any errors that it identifies

All out-going administrative e-mails will now be signed.

Enable Localisation and Multilingual Interface

Foswiki supports displaying national (non-ASCII) characters, and using different languages for its basic interface elements. To configure localisation, modify the Localisation section of the configure page. For more information, see Foswiki:Support.InternationalizationSupplement.

Performance Enhancements

Choose an appropriate search algorithm for your Operating System

On the Store pane in configure you will find the setting {Store}{SearchAlgorithm}.

By default bootstrap attempts to pick the best implementation for your system. You can optimize search by choosing algorithms as follows:

If you install Foswiki on a Windows server, using an external grep program can create problems because of limitations in the length of command lines. You may be able to run with Forking in Windows if your directory path to Foswiki is kept short (short directory names and few levels), however the recommended (safe) setting for Windows is Foswiki::Store::SearchAlgorithms::PurePerl.

There are several other options available for search tools via the Extensions web, including:

Web Acceleration (mod_perl, FastCGI, ...)

Foswiki is installed by default supporting standard CGI scripts as well as CLI access. For best performance, Foswiki can be accelerated using one of the several accelerators, however, you must install the required dependencies before enabling acceleration! See the listed extensions for more information.

Fast CGI FastCGIEngineContrib Supports the mod_fastcgi and mod_fcgid extensions
mod_perl ModPerlEngineContrib supports the apache mod_perl extension
ALERT! Caution

Page Caching

By default, Foswiki renders each page dynamically when the page is requested. If you anticipate a relatively high volume of page views in comparison to users actively editing the site, you may want to consider System.PageCaching which can significantly improve the performance of a Foswiki site. To learn more about how to configure and fine-tune this feature, along with considerations for maintaining dynamic page elements, refer to System.PageCaching.

Customizing your site's "look and feel"

Customize pages for managing personal information

If you are not using Foswiki to manage your users' passwords or email addresses, or would just like to enhance the default pages, then modify the following topics accordingly with information appropriate for your site:

Customize the user topic for new users

When a new user registers on your Foswiki site, a topic with a name corresponding to the user's WikiName is created in the Main web: this topic is the user's user topic. The user topic is based on the Main.NewUserTemplate topic; if it is not present, then System.NewUserTemplate (and its associated System.UserForm) is used as a default. If you want to customize the user topic for your users, copy System.NewUserTemplate to Main.NewUserTemplate, and System.UserForm to Main.UserForm, and make your changes to Main.NewUserTemplate and Main.UserForm. (See ManagingTopics#CopyTopic for instructions on copying a topic.)

You can edit these topics to suit your needs, such as the following:

If you added or removed fields from the user form you may also need to tailor Main.UserRegistration to match (copy over the contents from System.UserRegistration to Main.UserRegistration when creating it).

Customize the appearance of your Foswiki site

The real power of Foswiki lies in its flexibility to be customized to meet your needs. To change the look of the default skin, PatternSkin, please refer to System.PatternSkin and System.PatternSkinCustomization.

At the Foswiki website you can find more resources. A good place to start exploring is Foswiki:Support.BestPracticeTips and Foswiki:Support.FAQ which offer tips and tricks for customizing your Foswiki site. Many of these are best done before any content has been added to your site, so immediately after installation is a good time to consider the possibilities.

Left, Top and Bottom Bars with PatternSkin

The top bar and bottom bar are common across all webs.

To customize the top bar, copy System.WebTopBarExample to WebTopBar, and make your desired changes to WebTopBar.

To customize the bottom bar, copy System.WebBottomBarExample to WebBottomBar, and make your desired changes to WebBottomBar.

The side bar can be customized on a per web basis. To customize the side bar, copy the WebLeftBarExample topic in the given web to WebLeftBar, and make your desired changes to WebLeftBar. If you would like to move the side bar to the right of the page, see System.PatternSkin for more details.

See System.PatternSkinCustomization for detailed information on tailoring the look of your site.

At the bottom of each topic, there is a copyright statement that is set in the WEBCOPYRIGHT preference. Its default is the following: Copyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.

If your Foswiki site is used in an environment without public access you should replace this with your normal copyright notice. You should also consider adding a security classification (e.g., For Internal Use Only) so people do not have to add this manually to every new topic.

If your Foswiki site is publicly accessible, you need to decide which copyright and license you wish to apply to all contributions. For open source applications, licenses such as the GNU Free Documentation License, FreeBSD Documentation License, and one of the various Creative Commons licenses are possible licenses to consider. Remember that once people have started contributing, you cannot retroactively change the license (unless it has a provision for this).

To change the copyright statement, perform the following steps:

WYSIWYG vs Raw Edit

In Foswiki, the WYSIWYG editor is used by default in edit mode. An Edit wiki text link is available for those who prefer to edit the topic markup language (TML) directly.

There are actually two different wiki text editors available now on Foswiki 2,0:
NatEdit, The "Natural Editor"
This is the new JavaScript enabled wiki text editor. This editor allows the user to directly edit the TML, but provide a JavaScript assist, to help in learning TML.
raw editor
This is the original wiki text editor included with Foswiki 1.0 and 1.1. It can be used without JavaScript, provided that Security & Authentication Validation tab is configured for embedded or none. The raw editor can be enabled per user by overriding the SKIN, and removing natedit from the default setting natedit, pattern in their user topic:    * Set SKIN = pattern

If you prefer to use the wiki text editor by default and have a separate WYSIWYG button, then you can modify the templates that define the edit screen as described in Foswiki:Support.FaqHowToMakeRawEditDefault.

Extensions

Foswiki:Extensions is an extensive library of Plugins for Foswiki that enhance functionality in a huge number of ways. A few plugins are pre-installed in the Foswiki distribution. There are several types of Extensions available:

Installing extensions

Extensions can be installed using any of several different methods: To update an extension, simply re-run the installer. If prompted, tell it to download fresh copies from the repository.

ALERT! If the extensions installer is not run, (for example, installing using unzip, debian/RPM packages or git clone), you must run the Plugins wizard to import and save the new configuration settings.

ALERT!Caution: Users of the debian .deb or .rpm packages should only use the system package tools when installing extensions.

The simplest way is to visit configure -> Extensions -> Extensions operations and maintenance tab, and use the [TIP search for extensions] button to download and install additional extensions from the foswiki.org website. If you are behind a firewall or your server has no access to the Internet, you can also install plugins manually. Installation instructions for each plugin are located in its corresponding topic on https://foswiki.org/. Additional documentation on Foswiki plugins can be found at Foswiki:Support.PluginsSupplement.

When installing an extension from the configure interface:

When installing extensions from the command line: (Internet access available)

When installing extensions from the command line: (no Internet access)
TIP Use this method to install a back-level version of an extension. Manually download the old archives and installer from the repository using the attachments dialog.

Manual installation

When using either the web or shell installation tools:

The instructions for using the extensions installer from the shell are retrieved by using the "usage" command: tools/extension_installer usage or ./SomePlugin_installer usage

Removing (uninstalling) extensions

ALERT! Caution: When removing an extension, no dependency checking is performed.

The web and command line interfaces can be used to uninstall extensions. When an extension is removed, the following occurs:

Run the uninstall from the "root" of the Foswiki installation:
perl working/configure/pkgdata/SomeExtension_installer uninstall

Restoring a removed, or previous version of an extension

The backup can be extracted from the root directory of the Foswiki installation. The archive is taken "relative" to the root of the installation, so an unzip or tar -xzf of the backup file should be all that is required:
cd /root/of/foswiki
tar -zxvf * working/configure/backup/[Extension}-backup-[yyyymmdd]-[hhmmss].tgz
# or
unzip working/configure/backup/[Extension}-backup-[yyyymmdd]-[hhmmss].zip

Always run the tools/configure -wizard Plugins -save utility after manually changing any extension. This ensures that Foswiki is running with the latest Config.spec / Foswiki.spec configuration information.


Related Topics: InstallationGuide, AdminDocumentationCategory, Foswiki:Support.SupplementalDocument