System.InstallationGuide
(the InstallationGuide topic in the System web).
For information on upgrades, please also refer to Foswiki:System.UpgradeGuide. A static HTML version of this document, UpgradeGuide.html
, is included in the root of your Foswiki distribution.
UpgradeGuide.html
, is included in the root of your Foswiki distribution.
Verify that your server meets the Foswiki system requirements, including having the minimum required Perl version and all required Perl modules installed. If you need to install any Perl libraries from CPAN for use by Foswiki, see Foswiki:Support.HowToInstallCpanModules for more information.
If you need help, feel free to ask a question in the Foswiki:Support web or on Foswiki:Community.InternetRelayChat (irc.freenode.net, channel #foswiki).
/path/to/foswiki
. foswiki
directory tree.
Note: for more information on the appropriate permissions to ensure security for your Foswiki data, see Foswiki:Support.SecuringYourSite.
The default file and directory access permissions as set by the distribution define a reasonable security level that will work for many types of installations, including shared hosting. Nonetheless, you should verify that the web server user has read access to all files and directories beneath the foswiki
directory, and execute access for all directories. Also verify that the data
and pub
directories and all the subdirectories and files beneath them allow write access for the web server user. chmod -R 770 foswiki
. Providing execute access to all files is potentially dangerous. This is a common mistake made by Foswiki installers. See Foswiki:Support.SettingFileAccessRightsLinuxUnix for a sample set of Unix commands to set the file and directory permissions.
foswiki
directory tree to the web server user, using the command chown -R user:group /path/to/foswiki
. The web server username varies in different installations; here are some sample commands for various Linux distributions: chown -R apache:apache /path/to/foswiki
chown -R www-data:www-data /path/to/foswiki
chown -R wwwrun:www /path/to/foswiki
/usr/bin/perl
then this step is not required. This step is required on Windows installations.
Find the location of your system's Perl interpreter. Change the path to Perl in the first line of each script (you may have to give yourself write permission first) in the bin
and tools
directories. You can use the tools/rewriteshebang.pl
script to do this; for example:
cd /path/to/foswiki/bin /path/to/perl ../tools/rewriteshebang.pl # At the prompt, enter the full path to the perl executable, including # the full filename of the executable. You will be prompted twice for # this information in order to confirm it. cd /path/to/foswiki/tools /path/to/perl rewriteshebang.pl
.cgi
or .pl
). This is not normally required with the Apache web server, though some hosted web servers are configured to require it. If the documentation for your web server indicates that a special extension is necessary, rename all the executable scripts in bin
; that is, rename bin/view
to bin/view.pl
, and so on. When configuring Foswiki (see the section "Configure Foswiki"), set the ScriptSuffix
option to the special extension.
bin/
and lib/
located under the Foswiki installation directory. If you have moved these directories, or if your system requires changes to the default Perl libraries, then this step is required.
Create the file LocalLib.cfg located at bin/LocalLib.cfg
bin
directory, copy the template file LocalLib.cfg.txt
to LocalLib.cfg
. Make sure the ownership and access rights of the copy are the same as LocalLib.cfg.txt.
bin/LocalLib.cfg
so that $foswikiLibPath
is set to the absolute file path of your lib
directory. For example: /path/to/foswiki/lib
.
$CPANBASE
to point to your personal CPAN install. Don't forget that the web server user has to be able to read those files as well.
foswiki.conf
). Performance is much better with a config file, and one file gives the best overview and ensures that you get a safe installation . However to use a config file you need root or sudo access to stop and start Apache. The Foswiki apache config file is included from the main Apache config file http.conf. Most distributions have a directory from which any file that ends with .conf
gets included when you restart Apache (Example RedHat/Fedora/Centos: /etc/httpd/conf.d
). If you use a virtual host setup in Apache you should include the foswiki.conf
file from inside the desired virtual host config in your Apache configuration.
.htaccess
files on each page access. Normally this is the only way to control Apache in a shared host environment where you have no root or sudo privileges.
foswiki_httpd_conf.txt
can be found in the root of the foswiki installation.
bin
and pub
. The Foswiki:Support.ApacheConfigGenerator tool will generate the appropriate settings; the foswiki_httpd_conf.txt
file also has examples of configuring Apache appropriately.
ScriptAlias
directive for the bin
subdirectory, or an Alias
directive with SetHandler cgi-script
and Options ExecCGI
directives for the bin
subdirectory, so that the bin
scripts will be executed by Apache.
bin
directory, there are sample .htaccess
files for various subdirectories in your installation. Each file has help text explaining how to modify it for your configuration. For more information, see Foswiki:Support.SupplementalDocuments. location and name of sample .htaccess file | copy sample file to the following location |
---|---|
foswiki/root-htaccess.txt | foswiki/.htaccess |
foswiki/bin/.htaccess.txt | foswiki/bin/.htaccess |
foswiki/pub-htaccess.txt | foswiki/pub/.htaccess |
foswiki/subdir-htaccess.txt | .htaccess in all other subdirectories below foswiki |
bin
and pub
. The sample .htaccess
files show how to configure Apache appropriately.
foswiki/bin/.htaccess
files contains the line SetHandler cgi-script
so that all scripts in the bin
directory will be executed by Apache.
pub
directory. For example, most Linux distributions have a default Apache installation with PHP and server side include (SSI) enabled. This would allow PHP scripts uploaded as attachments to be executed, which is a security risk, so it should be disabled in the Apache configuration with php_admin_flag engine off
.
Different script execution mechanisms are disabled in different ways; see your web server configuration and documentation for more details.
Protect the configure script: You should never leave the configure
script open to the public. Limit access to the bin/configure
script to either localhost, an IP address or a specific user using basic Apache authentication. The Foswiki:Support.ApacheConfigGenerator lets you setup who has access to the configure
script. Also see the foswiki-httpd-conf.txt
or bin/.htaccess.txt
file for an example of the setting required to protect the configure
script.
To limit access to a particular user, set up a .htpasswd
file that contains the user name and password that Apache will use to authenticate the user: foswiki/data
directory.
htpasswd -c .htpasswd <username>
, where <username> is the name of the user you will use to access the configure
script. Choose the username with care: the username cannot be an existing login name for your Foswiki installation, nor can it be used later on to register in Foswiki. Enter a password when prompted.
configure
web page will be protected using the user and password held in the data/.htpasswd
file. The Apache config file or .htaccess file will have a Require user <username>
directive to restrict access to the configure
script. Ensure the user specified in the directive matches the <username> you used when creating the .htpasswd file.
Note: In addition to any web server security protection that you have set up, when saving any configuration settings for the first time on the configure
web page, you will be prompted to set a configuration password. This password must be entered on all subsequent configuration changes, and is also used to log in via the internal admin link (see the section "Define the administrator user(s)"). Even after a configure
password has been set, access to the configure
page should still be restricted by the web server, in order to avoid revealing internal information to potential attackers.
For more information, refer to Foswiki:Support.ProtectingYourConfiguration.
http://yourdomain/url/to/foswiki/bin/configure
into your browser address bar. configure
web page for the first time, you can only edit the section General Path Settings
. Make any required changes, and save the settings, whether or not you needed to make any changes. You will be prompted to set a password for the configure
page: this password must be entered for all subsequent configuration changes, and is also used to log in via the internal admin link (see the section "Define the administrator user(s)"). Note: Theconfigure
password is remembered byconfigure
, separate to web server access controls mentioned in "Protect the configure script".
General Path Settings
, continue configuring Foswiki. Configuration items which may require further attention will be highlighted.
{PermittedRedirectHostUrls}
. Example: if{DefaultUrlHost}
is set tohttps://wiki.company.com
, an example{PermittedRedirectHostUrls}
might contain:https://company.com, http://111.222.123.234
Mail and Proxies
section. The {WebMasterEmail}
and {SMTP}{MAILHOST}
settings must be defined so Foswiki can send registration emails. Many ISPs have introduced authentication when sending emails to fight spam so you may also have to set {SMTP}{Username}
and {SMTP}{Password}
. If you do not want to enable sending registration emails or want to enable it later you can uncheck {EnableEmail}
. If your server is behind a firewall with a proxy, and you wish to install extensions via configure
, you may have to set {PROXY}{HOST}
and {PROXY}{PORT}
. Note: If e-mail is enabled in configure, Foswiki will not allow any new registrations unless e-mail is functional. In order to avoid issues, return to theSMTP authentication requires additional perl modules includingMail and Proxies
,Email Test
tab inconfigure
and verify that Foswiki can successfully send e-mail.
Authen::SASL
and MIMI::Base64
,
configure
page, you can configure Foswiki manually.
mod_auth_ldap
or mod_auth_mysql
. However, as your browser is caching your login, you must restart the browser to log out.
System.InstallationGuide
into the "Jump" text box. By doing this instead of using the INSTALL.html
file from the distribution, you will be able to use the embedded hyperlinks to jump directly to the referenced pages.
Login
, Password
and user mapping
options.configure
, Security And Authentication
tab Login
tab on the Security and Authentication
panel. Select the Foswiki::LoginManager::TemplateLogin
login manager.
Passwords
tab. Select the appropriate PasswordManager
for your system - the default is Foswiki::Users::HtPasswdUser
. {TemplateLogin}{PreventBrowserRememberingPassword}
that you can set to prevent Browsers from remembering username and passwords if you are concerned about public terminal usage.{TemplateLogin}{AllowLoginUsingEmailAddress}
that you can set to allow users to login using their password system registered e-mail addresses.mod_auth_ldap
or mod_auth_mysql
you can just plug in to them directly.
The disadvantage is that because the user identity is cached in the browser, you can log in, but you can't log out again unless you restart the browser.
Foswiki maps the REMOTE_USER
that was used to log in to the webserver to a WikiName using the table in Main.WikiUsers. This table is updated whenever a user registers, so users can choose not to register (in which case their webserver username is used for their signature) or register (in which case that username is mapped to their WikiName).
The same private .htpasswd
file used in Foswiki Template Login can be used to authenticate Apache users, using the Apache Basic Authentication support.
htpasswd
program to modify .htpasswd
files generated by Foswiki! htpasswd
wipes out e-mail addresses that Foswiki saves in the info fields of this file.
Apache Login is required for Apache-based login methods such as mod_ldap
You can use any Apache authentication module that sets the REMOTE_USER
environment variable.
Security and Authentication
pane on the Login
tab in configure
: Foswiki::LoginManager::ApacheLogin
for {LoginManager}
.
Foswiki::Users::HtPasswdUser
for {PasswordManager}
.
Foswiki::Users::TopicUserMapping
for {UserMappingManager}
.
foswiki/bin-htaccess-advanced.txt
file to set the following Apache directives on the bin
scripts:(This example is for Apache 2.2, there are changes required if using Apache 2.4) AuthType Basic <FilesMatch "(attach|edit|manage|rename|save|upload|mail|logon|.*auth).*"> require valid-user </FilesMatch>You can also refer to the sample
foswiki_httpd_conf.txt
and bin-htaccess-advanced.txt
files to see how the appropriate Apache directives are specified.
Store
pane in configure
you will find the setting {RCS}{SearchAlgorithm}
.
By default it is set to Foswiki::Store::SearchAlgorithms::Forking
which is what you should keep if you install Foswiki in Linux or any other Unix type operating system.
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
.
admin
and the password established when initially saving the configuration. Don't log in with the wikiname AdminUser
.
After installing Foswiki, you can also register other users that you will use to administer Foswiki. To make a user an administrator, add the WikiName for the user to the AdminGroup
, defined in the AdminGroup
topic in your Foswiki installation.
Note that with the sudo or internal admin login, it is not necessary to add other users to the AdminGroup. However if you have more than one administrator, you may still want to do this to ensure that topic changes are attributed to a specific user instead of the default Main.AdminUser.
By adding users to Main.AdminGroup: bin/configure
password is not required
bin/configure
will need to be shared among administrators
System.InstallationGuide
into the "Jump" text box. By doing this instead of using the INSTALL.html
file from the distribution, you will be able to use the embedded hyperlinks to jump directly to the referenced pages.
To add an initial administrator to the AdminGroup
, perform the following steps:
AdminGroup
topic and select the "internal admin login" link. Login using the password you set on the configure
page.
Main.AdminGroup
topic. Follow the instructions on the page to add users to the AdminGroup. You do not need to edit the topic.
AdminGroup
that you use only for administering your Foswiki site. See AccessControls for more information on access controls and user groups.
http://yourdomain.com/url/to/foswiki/bin/view/System/InstallationGuidePart2
to proceed with further tailoring your site..
In order to keep your user, group, and site configuration information separate from the actual content of your site, it is recommended that you create a new web in which your site's pages will reside. See ManagingWebs for more information on Wiki webs and how to create one.
configure
script and make sure you have resolved all errors and are satisfied that you understand any warnings.
Resource | Required Server Environment |
---|---|
Perl | 5.8.8 or higher is recommended and it will run with Perl >=5.8.4 and <5.8.8 but this is untested. It also runs in Perl 5.6.1 but only with Wysiwyg editor disabled. Wysiwyg requires Unicode support which is provided by perl 5.8.1 onwards. |
RCS | 5.7 or higher (including GNU diff ) Optional. Foswiki includes a pure Perl implementation of RCS (RcsLite) that can be used instead, at the cost of performance |
GNU diff | GNU diff 2.7 or higher is required when not using the all-Perl RcsLite. Install within the PATH if not included with RCS (check version with diff -v ) Must be the version used by RCS, to avoid problems with binary attachments - RCS may have hard-coded path to diff |
Other external programs | fgrep, egrep |
Cron/scheduler | • Unix: cron • Windows: cron equivalents |
Web server | Apache is well supported; for information on other servers, see Foswiki:Support.InstallingOnSpecificPlatforms. |
Module | Preferred version | Required/Optional | Description |
---|---|---|---|
Algorithm::Diff | Required | Included with Foswiki | |
CGI | Versions 2.89, 3.37, 3.43, and 3.47 must be avoided. Most versions from 3.15 and onwards should work. | Required | Included with Perl core since Perl 5.4 |
Error | Required | Included with Foswiki | |
Apache::Htpasswd | Optional | May be required for ApacheHtpasswd password manager | |
Archive::Tar | Optional | May be required by the Extensions Installer in configure if command line tar or unzip is not available, since Perl 5.9.3 part of core. | |
Archive::Zip | Optional | Alternative to Archive::Tar, used by the Extensions Installer if Archive::Tar also unavailable | |
CGI::Session | Optional | Required for Sessions support, available from the CPAN archive | |
Digest::SHA | Optional | May be required for password encryption, since Perl 5.9.3 part of core | |
Digest::SHA1 | Optional | ||
Encode::compat | Optional | May be required for international characters | |
HTML::Entities | Optional | Required for Foswiki:Extensions.WysiwygPlugin | |
HTML::Parser | Optional | Required for Foswiki:Extensions.WysiwygPlugin | |
Lingua::EN::Sentence | Optional | May be required for generating new language files | |
Locale::Maketext::Lexicon | >=0 | Optional | Used for I18N support |
LWP | Optional | Required for the Configure Extensions Installer, and for external URL based INCLUDEs | |
URI | Optional | Required by the configure script | |
Win32::Console | Optional | May be required for Windows |
perl -le 'use ModuleName; print "ModuleName"->VERSION'
pub
directory.)
lib
directory at the same level as the bin
directory. You can create this directory elsewhere and configure the bin/setlib.cfg
file. Foswiki dir: | What it is: | Where to copy: | Example: |
---|---|---|---|
foswiki | start-up pages | root Foswiki dir | /home/smith/public_html/foswiki/ |
foswiki/bin | CGI bin | CGI-enabled dir | /home/smith/public_html/foswiki/bin |
foswiki/lib | library files | same level as bin | /home/smith/public_html/foswiki/lib |
foswiki/locale | language files | dir secure from public access | /home/smith/public_html/foswiki/locale |
foswiki/pub | public files | htdoc enabled dir | /home/smith/public_html/foswiki/pub |
foswiki/data | topic data | dir secure from public access | /home/smith/public_html/foswiki/data |
foswiki/templates | web templates | dir secure from public access | /home/smith/public_html/foswiki/templates |
foswiki/tools | Foswiki utlilities | dir secure from public access | /home/smith/public_html/foswiki/tools |
foswiki/working | Temporary and internal files | dir secure from public access | /home/smith/public_html/foswiki/working |
configure
page) configure
page. However, if you are unable to get the configure
page to display (for example, if a dependency is missing), or for some reason you do not wish to use the configure
page, then you can configure Foswiki manually
Perform the following steps to manually configure Foswiki: lib/Foswiki.spec
to lib/LocalSite.cfg
$Foswiki::cfg{DefaultUrlHost} $Foswiki::cfg{ScriptUrlPath} $Foswiki::cfg{ScriptDir} $Foswiki::cfg{PubUrlPath} $Foswiki::cfg{PubDir} $Foswiki::cfg{DataDir} $Foswiki::cfg{ToolsDir} $Foswiki::cfg{TemplateDir} $Foswiki::cfg{LocalesDir} $Foswiki::cfg{WorkingDir} $Foswiki::cfg{OS}
$Foswiki::cfg{LoginManager} $Foswiki::cfg{WebMasterEmail} $Foswiki::cfg{SMTP}{MAILHOST} $Foswiki::cfg{SMTP}{SENDERHOST}
__END__
and everything following it.