User Tools

Site Tools


build:wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
build:wiki [2009/02/19 13:55]
151.145.245.119 Update config file. (CMB)
build:wiki [2011/01/12 16:39] (current)
SLUUG Administration Upgrade to DokuWiki 2010-11-07. (CMB)
Line 1: Line 1:
 ====== DokuWiki ====== ====== DokuWiki ======
  
-These instructions detail how to install [[http://​wiki.splitbrain.org/​wiki:​dokuwiki | DokuWiki]] on our Debian GNU/Linux system. We're currently running the 2009-02-14 version of DokuWiki.+These instructions detail how to install [[http://​wiki.splitbrain.org/​wiki:​dokuwiki | DokuWiki]] on our Debian GNU/Linux system. We're currently running the 2010-11-07 version of DokuWiki.
  
 ===== Requirements ===== ===== Requirements =====
Line 121: Line 121:
 ===== Upgrading ===== ===== Upgrading =====
  
-Here are the steps taken to upgrade to version ​2009-02-14.+Here are the steps taken to upgrade to version ​2010-11-07.
  
 First, read the [[http://​www.dokuwiki.org/​changes | changes made in the new release]]. Make sure you follow any directions specific to the new release. First, read the [[http://​www.dokuwiki.org/​changes | changes made in the new release]]. Make sure you follow any directions specific to the new release.
  
 Then we create a full backup of the existing site. Then we create a full backup of the existing site.
-<​code ​rootshell>+<​code ​bash>
 cd /​home/​web/​wiki.sluug.org cd /​home/​web/​wiki.sluug.org
-export OLD_VERSION=2008-05-05 +export OLD_VERSION=2009-12-25 
-tar cfz /​var/​backups/​web/​wiki.sluug.org.BACKUP-`date +%Y%m%d`.tgz dokuwiki-$OLD_VERSION+sudo tar cfz /​var/​backups/​web/​wiki.sluug.org.BACKUP-`date +%Y%m%d`.tgz dokuwiki-$OLD_VERSION
 </​code>​ </​code>​
  
 Download and unpack the new version. Download and unpack the new version.
-<​code ​rootshell>+<​code ​bash>
 cd /​home/​web/​wiki.sluug.org cd /​home/​web/​wiki.sluug.org
-export VERSION=2009-02-14+export VERSION=2010-11-07
 wget http://​www.splitbrain.org/​_media/​projects/​dokuwiki/​dokuwiki-$VERSION.tgz wget http://​www.splitbrain.org/​_media/​projects/​dokuwiki/​dokuwiki-$VERSION.tgz
 tar xfz dokuwiki-$VERSION.tgz tar xfz dokuwiki-$VERSION.tgz
Line 141: Line 141:
 </​code>​ </​code>​
  
-Read through ''​dokuwiki-$VERSION/​.htaccess.dist''​ to look for anything new.+Read through ''​dokuwiki-$VERSION/​.htaccess.dist''​ to look for anything new. Make any necessary changes.
 <code bash> <code bash>
-diff -u public/.htaccess dokuwiki-$VERSION/​.htaccess.dist | less+diff -u dokuwiki-$OLD_VERSION/.htaccess dokuwiki-$VERSION/​.htaccess.dist | less
 </​code>​ </​code>​
  
-Read through the ''​dokuwiki-$VERSION/​conf/​dokuwiki.php''​ file to look for any new config options.+Read through the ''​dokuwiki-$VERSION/​conf/​dokuwiki.php''​ file to look for any new config options. Make any necessary changes to ''​conf/​local.php''​ in the OLD directory.
 <code bash> <code bash>
-diff -u public/​conf/​dokuwiki.php dokuwiki-$VERSION/​conf/​dokuwiki.php | less+diff -u dokuwiki-$OLD_VERSION/​conf/​dokuwiki.php dokuwiki-$VERSION/​conf/​dokuwiki.php | less
 </​code>​ </​code>​
  
 Double-check to see if there are any patches in the old version of DokuWiki. If so, you'll probably have to manually apply the patches to the new version. (Check to ensure they'​re still needed first though.) Double-check to see if there are any patches in the old version of DokuWiki. If so, you'll probably have to manually apply the patches to the new version. (Check to ensure they'​re still needed first though.)
 <code bash> <code bash>
-find public ​-name '​*.ORIG*'​+find dokuwiki-$OLD_VERSION ​-name '​*.ORIG*'​
 </​code>​ </​code>​
  
-Delete the old cache, since we don't need it, and the formats may have changed between versions. We can also use the new help pages (in the wiki namespace), so we can delete them from the old site. +Delete the old cache and index, since they can be regenerated, and the formats may have changed between versions. We can also use the new help pages (in the wiki namespace), so we can delete them from the old site. 
-<​code ​rootshell+<​code ​bash
-rm public/​data/​cache/​* -rf +sudo rm dokuwiki-$OLD_VERSION/​data/​cache/​* -rf 
-rm public/​data/​pages/​wiki -rf+sudo rm dokuwiki-$OLD_VERSION/​data/​index/​* -rf 
 +sudo rm dokuwiki-$OLD_VERSION/​data/​pages/​wiki -rf
 </​code>​ </​code>​
  
 Copy all the configuration info and data over from the old site to the new site. Copy all the configuration info and data over from the old site to the new site.
-<​code ​rootshell+<​code ​bash
-cp -f public/​conf/​{local.php,​acl.auth.php,​users.auth.php} dokuwiki-$VERSION/​conf/​ +cp -f dokuwiki-$OLD_VERSION/conf/{*local.php,​acl.auth.php,​users.auth.php} dokuwiki-$VERSION/​conf/​ 
-cp -f public/.htaccess dokuwiki-$VERSION/​ +cp -f dokuwiki-$OLD_VERSION/.htaccess dokuwiki-$VERSION/​ 
-cp -a public/data/* dokuwiki-$VERSION/​data/​+cp -a dokuwiki-$OLD_VERSION/data/* dokuwiki-$VERSION/​data/​
 </​code>​ </​code>​
  
-It installed a new ''​entities.conf'',​ so get rid of it again+Get rid of the files that we don't need
-<​code ​rootshell+<​code ​bash
-mv dokuwiki-$VERSION/​conf/​entities.conf dokuwiki-$VERSION/​conf/​entities.conf.out+mv dokuwiki-$VERSION/​conf/​entities.conf dokuwiki-$VERSION/​conf/​entities.conf.dist 
 +rm dokuwiki-$VERSION/​{install,​index}.php
 </​code>​ </​code>​
  
Line 177: Line 179:
  
 Re-create the sitemap file. Re-create the sitemap file.
-<​code ​rootshell>+<​code ​bash>
 touch dokuwiki-$VERSION/​sitemap.xml.gz touch dokuwiki-$VERSION/​sitemap.xml.gz
 </​code>​ </​code>​
  
-Correct the ownership so that the web server can write to where it needs to. +Re-index the site. 
-<​code ​rootshell+<code bash> 
-chown -R www-data:​www-data dokuwiki-$VERSION+php dokuwiki-$VERSION/​bin/​indexer.php -c 
 +</​code>​ 
 + 
 +Correct the ownership ​and permissions ​so that the web server can write to where it needs to, and so admins can also write files within the directory
 +<​code ​bash
 +sudo chown -R www-data:​www-data ​dokuwiki-$VERSION 
 +sudo chmod -R g+w dokuwiki-$VERSION
 </​code>​ </​code>​
  
 Switch over to the new version. Switch over to the new version.
-<​code ​rootshell>+<​code ​bash>
 rm public rm public
 ln -s dokuwiki-$VERSION public ln -s dokuwiki-$VERSION public
 </​code>​ </​code>​
  
-Test the site. Make sure you can browse to a few different pages. Also make sure you can edit and save a page. Once you're comfortable that the upgrade went OKyou can delete the directory for the previous version of DokuWiki.+Test the site. Make sure you can browse to a few different pages. Also make sure you can edit and save a page. Check out the search featurebacklinks, and old revisions.
  
-===== TODO: Enable ACLs and User Accounts =====+Once you're comfortable that the upgrade went OK, you can delete the directory for the previous version of DokuWiki.
  
-Create the conf/​users.auth file: +<​code ​bash
-<​code ​rootshell+rm -rf dokuwiki-$OLD_VERSION
-touch conf/​users.auth +
-chown www-data:www-data conf/​users.auth +
-chmod 440 conf/​users.auth+
 </​code>​ </​code>​
  
-Add an admin account in the file (replace $WIKI_ADMIN_PWD ​with real password): +===== Enable ACLs and User Accounts ===== 
-  # echo "​admin:​`echo -n '​$WIKI_ADMIN_PWD'​ | md5sum | awk '​{print $1;​}'​`:​Administrator:​webmaster@sluug.org:​admin,​users"​ >> conf/users.auth+==== This is a minimal implementation ​with a single account ==== 
 +=== The sole purpose is to reduce defacement and overhead from recovery===
  
-Create ​the conf/​acl.auth file: +Go to the DokuWiki configuration directory 
-<​code ​rootshell+<​code>​ 
-cp conf/acl.auth.dist conf/acl.auth +cd /home/web/wiki.sluug.org/public/conf
-chown www-data:​www-data conf/acl.auth +
-chmod 440 conf/acl.auth+
 </​code>​ </​code>​
  
-Edit the conf/​acl.auth file to look something look this: +Install ​the skeleton authorization files 
-<​code ​configfile+<​code>​ 
-*               ​@admin ​ 255 +cp -ip users.auth.php.dist users.auth.php 
-*               ​@ALL ​   7 +cp -ip acl.auth.php.dist acl.auth.php
-private:​* ​      ​@admin ​ 255 +
-private:​* ​      ​@ALL ​   0 +
-readonly:​* ​     @admin ​ 255 +
-readonly:​* ​     @ALL    1+
 </​code>​ </​code>​
  
 +Create a backup of the main config file
 +<​code>​
 +cp -ip local.php local.php.090219
 +</​code>​
 +
 +Edit local.php using your favorite editor to uncomment the useacl line:
 +<​code>​
 +$conf['​useacl'​] ​      = 1;        // Enable Access Control List authorization
 +</​code>​
 +
 +Create a new account using your web browser:
 +
 +  - Point the web browser at http://​wiki.sluug.org/​
 +  - Select the "​Login"​ button at the bottom of the page.
 +  - Select the "​Register"​ link.
 +  - Fill in
 +    - Username: ​ discuss
 +    - Real name: SLUUG Administration
 +    - E-mail: ​   (your e-mail address)
 +  - Select the "​Register"​ button. ​ You should end up at the login page again.
 +  - Read the mail sent to you and login using the generated password.
 +  - At the bottom of the page, select the "​Update Profile"​ button.
 +  - Change these fields:
 +    - E-mail: ​       root@mail.sluug.org
 +    - New passsword: (The password for the discuss mailing list archive)
 +  - Select the "​Save"​ button.
 +
 +Edit local.php using your favorite editor to add this line:
 +<​code>​
 +$conf['​disableactions'​] = '​register'; ​  // Users can't register themselves
 +</​code>​
 +
 +Test security using your web browser:
 +
 +  - Select the "​Logout"​ button.
 +  - Tried editing a page without being logged in, but it let me.
 +  - Tried editing a page after closing and restarting the browser, but it let me.
 +
 +Edit acl.auth.php using your favorite editor to:
 +
 +  - Change the authority of the "​ALL"​ group from "​8"​ to "​1"​.
 +  - Create a new line in the same format, giving user "​discuss"​ "​16"​ level authority.
 +<​code>​
 +*               ​discuss ​   16
 +</​code>​
 +
 +An attempt to edit the same page (still displayed from the earlier test)
 +still displays the source, but now says that update is not allowed.
 +Refreshing the page, it no longer has the "​Edit"​ buttons.
 +
 +Test for an authenticated user:
 +
 +  - Use the "​Login"​ button, enter the username and password from above.
 +  - The Edit buttons are now displayed and able to update this page.
 +
 +For more information,​ see the
 +[[http://​wiki.splitbrain.org/​wiki:​acl | ACL documentation]].
  
 ===== TODO ===== ===== TODO =====
  
 Copy the files in /​var/​backups off the server. Delete older versions, or at least create a subdirectory structure. Copy the files in /​var/​backups off the server. Delete older versions, or at least create a subdirectory structure.
- 
-Accounts/​ACLs. [[http://​wiki.splitbrain.org/​wiki:​acl | See documentation]]. Set admin'​s password. 
  
 Turn on wordblock to ban edits with certain words (to prevent spamming and profanity)? Turn on wordblock to ban edits with certain words (to prevent spamming and profanity)?
Line 246: Line 301:
 ===== Credits ===== ===== Credits =====
  
-Initially installed, configured, and documented by Craig Buchek, 2005-09-10. Updated to newer versions on 2005-11-26, 2007-05-09, 2008-06-11, ​and 2009-02-19.+Initially installed, configured, and documented by Craig Buchek, 2005-09-10. 
 + 
 +Updated to newer versions on 2005-11-26, 2007-05-09, 2008-06-11, 2009-02-19, 2010-01-08.
build/wiki.1235073317.txt.gz · Last modified: 2009/02/19 13:55 by 151.145.245.119