has been updated to support Apache 2.4.
Apache Config Generator
This page creates an Apache configuration file
for your installation.
- Select your Apache version, and fill out the form.
- Press the "Update Config File" button
- Copy and paste the generated configuration into a new file in the same directory as httpd.conf
- Add a line to httpd.conf so Apache loads the new configuration file (e.g.
- Note that the exact method of including a configuration file can vary by os and distribution. Consult your local apache documentation.
For setting up Foswiki on Linux or Unix, see also SettingFileAccessRightsLinuxUnix
If you used the Debian packages
to install Foswiki, do not use the ApacheConfigGenerator
. Use the configuration files included in the .deb packages.
Windows Users: enter all file paths using linux forward-slash style, like
C:/www/foswiki. Don't use Windows style back-slash in the paths.
Some people, including many using web hosts, can't edit http.conf. If this applies to you, do not bother using this page - edit the various .htaccess template files included in the download. (They have instructions in them. Their filenames are all different, but include "htaccess.txt" in them.)
Press the "Update config file" button to generate your custom config
By pressing the button below you select all the text in the textarea. Then you just need to copy the text to the clipboard and paste it into the
Depending on the configuration you might get an error in Apache leading to a non-working configuration:
Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden: /var/www/foswiki/bin/configure
In this case you should think about your redirection policy. One fix is to add the line
to the configuration which applies to the base directory of the path mentioned in the error message (either as htaccess or conditional in apache .conf)
- Originally crafted and regularly maintained by KennethLavrsen
- removed the handy W3C tools from the blocked list. -- WillNorris - 18 Feb 2009
- ending % was missing for a %PATHURL in a ScriptAlias declaration -- ColasNahaboo - 23 Feb 2009
- Noted can't use a configure user as an editing wiki user -- MartinCleaver - 23 Mar 2009
- Remove /bin/view from the ErrorDocument strings if shorturls enabled - otherwise Apache fails to prompt for password - 5 Apr 2009
- Disabled TinyMCE plugin as it messes up with the layout -- OlivierRaginel - 06 Apr 2009
- Reorganized, added support for protecting attachments, FollowSymLinks -- GeorgeClark - 11 Apr 2009
- Simplified viewfile regex - should fix compile failure on Apache startup.
- Allow any wiki topic to be specified as the not-authorized page
- Allow location of .htpasswd to be overridden
- Add an optional port # for the Virtual host. So you can specify :80, :443, or whatever on the statement.
- Fixed htpasswd to default to data directory if left blank, otherwise overrides path - 3 Sept 2009
- Added (commented out) rules for serving pre-compressed .js and .css -- MichaelTempest - 22 Sep 2009
- Moved LocationMatch for fcgi outside of the directory.
- Add an Alias statement for robots.txt when short URLs are enabled
- Add or/and configuration of access control to
bin/configure command -- TobiasVonDerKrone - 11 Dec 2009
- Fixed the urlpath element so that it roundtrips without adding a bogus leading space -- MartinCleaver - 11 Feb 2010
ErrorDocument 401 default for bin/configure, so it doesn't rewrite to the bin/view and cause other errors - 9 July 2010
- Added NO_FOSWIKI_SESSION for protection against hungry spiders - AndrewJones - 14 July 2010
- Improve regex for Expires header - match jpeg as well as jpg. ( WillNorris ) And match the gz compressed versions of css and js -- GeorgeClark - 30 Sep 2010
- default Foswiki version to 1.1 -- WillNorris - 09 Nov 2010
- changed default config mode to AND. Foswiki:Tasks/Item10018
- Added more quotes on file system paths to deal with spaces. -- GeorgeClark - 26 Oct 2011
FcgidMaxRequestLength, changed default from mod_fastcgi to mod_fcgid. -- GeorgeClark - 29 Dec 2012 Tasks.Item12318
- Added ModPerlStartup script -- CrawfordCurrie - 06 Jan 2014
- Template Login should be enable by default on "Choose your Login Manager".
- Add support for Foswiki 1.2 and Apache 2.4
- On the line that starts with "Generated at..." I changed the topic reference from
%TOPIC% so as to true to the version of of the config generator used. -- LynnwoodBrown - 30 Jan 2015
- Added SSL support, also hide Configure protection if Foswiki 1.2 selected -- GeorgeClark - 22 Apr 2015 - 23:11
- For ShortURLs, I had to (at least for what I'm doing at SSLForNonViewScriptsOnly), add
Alias /error/ "/usr/share/apache2/error/" above
Alias / "/srv/www/vhosts/wiki.trin.org.au/foswiki/bin/view/"
- Handle modules needed for LDAP library inclusions -- MartinCleaver - 11 Feb 2010
- There should be a really basic configuration file ready to download and explained for newbies - there is the httpd.conf.txt at the root of the release
- Shouldn't we change the
FilesMatch "(attach|edit|manage|rename|save|upload|mail|logon|rest|.*auth......" to simply be something like
FilesMatch "(?<!view)$" ?
- No. In 1.2, the rest script does not require authentication. And jsonrpc does its own checking and can be unprotected.
- Clarify why enabling Short URLs creates RewriteRules as well as Aliases, when ShorterUrlCookbook claims that only one or the other is necessary. -- HeathRaftery - 9 Feb 2012
- The Rewrite rules redirect users who entered the full URL to the short URL. The Alias associates the view script with the short URL.