Setup a Project Wiki: Difference between revisions

From Research
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
Kingfisher is our wiki server. Check out the [http://wiki.iat.sfu.ca wiki index] to see existing wikis.
sr-hercules01 is our wiki server. Check out the [http://wiki.iat.sfu.ca wiki index] to see existing wikis.


== Add a Separate Instance of MediaWiki ==
== Add a Separate Instance of MediaWiki ==
Line 5: Line 5:
To set the stage for a new wiki, the champion for this new wiki should provide a wiki-name, and be clear about the type of access they want.</p>
To set the stage for a new wiki, the champion for this new wiki should provide a wiki-name, and be clear about the type of access they want.</p>


  <font color=red>hostname</font> <font color=blue>~ #</font> '''ssh root@kingfisher'''
  <font color=red>sr-hercules01</font> <font color=blue>~ #</font> '''ssh root@hercules'''
  <font color=red>kingfisher</font> <font color=blue>~ #</font> '''cd /srv/www/htwiki'''
  <font color=red>sr-hercules01</font> <font color=blue>~ #</font> '''ssh 10.0.1.58'''
  <font color=red>kingfisher</font> <font color=blue>~ #</font> '''tar -xzvf mediawiki-unconfiguredInstallation.tar.gz'''
  <font color=red>sr-hercules01</font> <font color=blue>~ #</font> '''newWiki -N $projectName [-R $sqlRootPassword]'''
<font color=red>kingfisher</font> <font color=blue>~ #</font> '''mv mediawiki '''''$projectname'''''


The go to the mediawiki setup website for your project:
'''<nowiki>http://wiki.iat.sfu.ca/</nowiki>'''''$projectname''


Fill in the options appropriately with some special Configuration options to note:<br />
Your wiki should be completely setup at: <nowiki>http://wiki.iat.sfu.ca/$projectname</nowiki> I then usually go login to the wiki and check to see if I can edit for 100% assurance that everything is working :)


Leave the Sysop account name as WikiSysop; apply our strong password to this account.
'''A wikiSysOp account is created with a strong password unique to the wikis'''


Make a separate database for each project:
A log is kept at /var/log/newWiki.log
* '''Database name''': wiki_$projectname
Seperate username for each project:
* '''DB username''': wiki_$projectname
Unique password:
<font color=red>kingfisher</font> <font color=blue>~ #</font> '''apg -m 9 -MNC'''
*more '''apg''' info [[Linux Tips and Tools|here]]


And no table prefix.


DB root password is again our strong password.
== Access Restrictions ==
By default, our wikis are publicly viewable, but a user must login with their research account to edit pages.


''Note: When you click Install! it may fail. For me it has always failed if the username was too long (it must be at 16 characters or less)''
To customize access and viewing restrictions, look at this article on [http://www.mediawiki.org/wiki/Manual:Preventing_access Preventing Access] (check wiki version).


If it worked, this will create the LocalSettings.php file which you then move to the correct place:
Common tasks are listed below. Add them to LocalSettings.php to implement them.
<font color=red>kingfisher</font> <font color=blue>htwiki #</font> '''cd $projectname'''
<font color=red>kingfisher</font> <font color=blue>''wiki_name'' #</font> '''mv config/LocalSettings.php ./'''


Config should no longer be world writable:
<font color=red>kingfisher</font> <font color=blue>~ #</font> '''chmod a-w config'''


Your wiki should be completely setup at: <nowiki>http://wiki.iat.sfu.ca/$projectname</nowiki>  I then usually go login to the wiki and add to the main page: '''Wiki is configured correctly.''' for 100% assurance that everything is working :)
To restrict anonymous viewing:


<font color=red>sr-hercules01</font> <font color=blue>''wiki_name'' #</font> '''vim LocalSettings.php'''


== Access Restrictions ==  
          # Disable everything (reading) by anonymous users
To customize access and viewing restrictions, look at this article on [http://www.mediawiki.org/wiki/Manual:Preventing_access Preventing Access] (this version of mediawiki is 1.6.11).  It's probably always a good idea to prohibit anonymous edits; add these lines to LocalSettings.php:
          $wgGroupPermissions['*']['read'] = false;
          $wgGroupPermissions['*']['createtalk'] = false;
          $wgGroupPermissions['*']['createpage'] = false;
          $wgGroupPermissions['*']['writeapi'] = false;
          # But allow them to login and see main page: these pages:
          $wgWhitelistRead =  array ( "Main Page", "Special:Userlogin", "Help:Contents", "Special:UserLogout");


<font color=red>kingfisher</font> <font color=blue>''wiki_name'' #</font> '''vim LocalSettings.php'''
          # Entirely disable Anonymous Edits in Wiki versions 1.4 and before
          $wgWhitelistEdit = true;




To restrict anonymous registrations, the following snippet is added to allow only Sysops user registration:


  <font color=red>kingfisher</font> <font color=blue>''wiki_name'' #</font> '''vim LocalSettings.php'''
Disable even research users from reading.  This is a private wiki, and only sysops can now read:
           # Prevent new user registrations except by sysops
           $wgWhitelistAccount = array ( "user" => 0, "sysop" => 1, "developer" => 1 );
  <font color=red>sr-hercules01</font> <font color=blue>''wiki_name'' #</font> '''vim LocalSettings.php'''
           # Disable even research users from reading.
          $wgGroupPermissions['user']['read'] = false;
           $wgGroupPermissions['user']['edit'] = false;




To restrict anonymous viewing, the following snippet is added to allow only registered users content access to the main page, user login page, and the help page:
Disable even research users from reading.  This is a private wiki, and only sysops can now read:
 
  <font color=red>kingfisher</font> <font color=blue>''wiki_name'' #</font> '''vim LocalSettings.php'''
  <font color=red>sr-hercules01</font> <font color=blue>''wiki_name'' #</font> '''vim LocalSettings.php'''
           # Pages anonymous (not-logged-in) users may see
           # Only allow members of the "Trusted" group to view and edit pages.  This group is autocreated.
           $wgWhitelistRead = array( ":Main Page", "Special:Userlogin", "Wikipedia:Help" );
          $wgGroupPermissions['Trusted'] = $wgGroupPermissions['user'];
           $wgGroupPermissions['Trusted']['edit']          = true;
          $wgGroupPermissions['Trusted']['read']          = true;




To allow bans by account name in lieu of IP address:
To allow bans by account name in lieu of IP address:
   
   
  <font color=red>kingfisher</font> <font color=blue>''wiki_name'' #</font> '''vim LocalSettings.php'''
  <font color=red>sr-hercules01</font> <font color=blue>''wiki_name'' #</font> '''vim LocalSettings.php'''
           # allows bans to be typed in by account name rather than IP
           # allows bans to be typed in by account name rather than IP
           $wgSysopUserBans=true;
           $wgSysopUserBans=true;


== Add Sysop/Administrator User ==
Follow these steps to make a wiki account, a sysop account:
Create the account, if you haven't done so already. Logout. Login as the WikiSysop user.
Navigate to '''Special Pages''' ->''' Log in / Create an Account ''', select '''Create an account''' and enter the credentials for a new user.  Note: If you enter a username and email address, and click '''By Email''' you can have mediawiki email the user their credentials and instructions on accessing the wiki.
Navigate to '''Special Pages''' ->''' User Rights Management ''', type in the new username.  Select Sysop and bureaucrat and click save.


== Customizing ==
== Customizing ==

Revision as of 06:09, 18 February 2010