Difference between revisions of "Install a new wiki"

From Organic Design wiki
(move script stuff to talk)
(redo)
Line 5: Line 5:
 
}}
 
}}
  
=== File structure ===
+
After a new database has been added for the wiki using the [[add a wiki database]] procedure, some files need to be added and modified.
 +
 
 +
== Configuration directory ==
 +
Each wiki requires a configuration directory in ''/var/www/wikis'' which contains it's ''LocalSettings.php'' file, a symlink to the MediaWiki code-base it's to use and its files as shown in the following example file structure.
 
{{code|<bash>
 
{{code|<bash>
/var/www/domains/tmp.peerix.org -> /var/www/wikis/template
+
/var/www/wikis/foo/
 +
/var/www/wikis/foo/LocalSettings.php                  # Individual wiki configuration
 +
/var/www/wikis/foo/wiki -> /var/www/mediawiki-1.13.2/  # Symbolic link to the MediaWiki code-base
 +
/var/www/wikis/foo/files/                              # Images filesystem hash table (ensure this is writable by webserver)
 +
</bash>}}
 +
 
 +
== LocalSettings.php ==
 +
Most of the settings required are already configured in the common [[Config:Wikia.php|wikia.php]] script, but some settings such as the wiki's name, its database details and its extensions are still necessary. The following is an example which covers most of the common conventions for a wiki's configuration including having the file synchronise with the in-wiki configuration article.
 +
{{code|<php>
 +
<?php
 +
# {{php}}{{Category:LocalSettings|foo}}{{#filesync:/var/www/wikis/foo/LocalSettings.php}}
 +
$wgSitename    = "Foobar";
 +
$wgShortName  = "foo";
 +
$wgDBname      = "foo";
 +
$wgDBprefix    = "foo_";
 +
 
 +
# Don't include extension code if running from shell for maintenance
 +
if (!$wgCommandLineMode) {
 +
 
 +
    # General extensions
 +
    include('extensions/GeneralExtensions.php');
 +
 
 +
    # Lock down
 +
    $wgGroupPermissions['*']['read'] = false;
 +
    $wgGroupPermissions['*']['edit'] = false;
 +
    $wgGroupPermissions['*']['createaccount'] = false;
 +
    $wgGroupPermissions['user']['createaccount'] = true;
 +
    $wgWhitelistRead = array("Special:Userlogin", "-", "MediaWiki:Common.css");
  
/var/www/wikis/template/
+
}
/var/www/wikis/template/LocalSettings.php                  # Individual configuration
+
</php>}}
/var/www/wikis/template/wiki -> /var/www/mediawiki-1.10.0/  # Symbolic link to common MediaWiki instance
+
 
/var/www/wikis/template/files/                              # Images filesystem hash table
+
== Domain configuration ==
/var/www/wikis/template/template.sql                        # MySQL dump of template database
+
Add a symlink for the domain(s) the new wiki should be accessible from. If the domain is pointed at the server using a wild-card, then no DNS configuration will be necessary, but otherwise an A-record will need to be created for the sub-domain, or a completely new domain may need to be set up, in which case see [[set up a new domain name]].
</bash>}}
+
 
 +
Once the domain/sub-domain is pointing at the server, then it is routed to the correct wiki by adding a symlink in ''/var/www/domains'' which has the same name as the domain and links to the configuration directory for the new wiki in ''/var/www/wikis'' for example:
 +
{{code|<pre>
 +
ln -s /var/www/wikis/foo /var/www/domains/foo.com
 +
</pre>}}
 +
 
 +
== See also ==
 +
*[[Add a wiki database]]
 +
*[[Set up a new domain name]]

Revision as of 00:04, 25 January 2009

Procedure.svg Install a new wiki
Organic Design procedure

After a new database has been added for the wiki using the add a wiki database procedure, some files need to be added and modified.

Configuration directory

Each wiki requires a configuration directory in /var/www/wikis which contains it's LocalSettings.php file, a symlink to the MediaWiki code-base it's to use and its files as shown in the following example file structure.

<bash>

/var/www/wikis/foo/ /var/www/wikis/foo/LocalSettings.php # Individual wiki configuration /var/www/wikis/foo/wiki -> /var/www/mediawiki-1.13.2/ # Symbolic link to the MediaWiki code-base /var/www/wikis/foo/files/ # Images filesystem hash table (ensure this is writable by webserver) </bash>

LocalSettings.php

Most of the settings required are already configured in the common wikia.php script, but some settings such as the wiki's name, its database details and its extensions are still necessary. The following is an example which covers most of the common conventions for a wiki's configuration including having the file synchronise with the in-wiki configuration article.

{{{1}}}

Domain configuration

Add a symlink for the domain(s) the new wiki should be accessible from. If the domain is pointed at the server using a wild-card, then no DNS configuration will be necessary, but otherwise an A-record will need to be created for the sub-domain, or a completely new domain may need to be set up, in which case see set up a new domain name.

Once the domain/sub-domain is pointing at the server, then it is routed to the correct wiki by adding a symlink in /var/www/domains which has the same name as the domain and links to the configuration directory for the new wiki in /var/www/wikis for example:

ln -s /var/www/wikis/foo /var/www/domains/foo.com

See also