Wikidot Home Network Install

This page is deprecated.

How To Install Wikidot On A Home Ubuntu Server

Update 2/17/2008


Before diving into this guide, you may want to check out this newer, easier to use guide based on this work:

The Easier Wikidot Home Network Install

Disclaimer

This guide is based on the Debian/Ubuntu Quickstart. I struggled for quite a while trying to get everything working. I finally figured out what I needed to do, but being a Linux rookie, I'm guessing some of the steps documented can be done a lot easier. If it looks like "brute force" was applied, it was only because I'm not knowledeable (yet!) and had to figure this out on my own. This guide is the result of countless trial and error steps.

Please update this guide if you have an easier, more elegant way to reach the end goal (but please confirm your changes actually work before making changes!)

Using This Guide

Everything in red text is what you type at the command prompt. I intentionally avoided using [[code]] tags since I have found that they are not friendly when trying to print, especially long lines of code.

Hot Tip!

If you opt to install the Ubuntu Desktop GUI, you can copy/paste most of the commands right from this guide into your terminal window.

Let's Get On With It!

Depending on your hardware and Internet connection speed, this will take some time. I would guess 2-3 hours for most if you have a reasonably fast Internet connection.

Install Ubuntu 7.10 Server

Download: http://www.ubuntu.com/getubuntu/download
I recommend setting this up on a new PC or one with a bare hard drive. I opted for guided partitioning, using the whole hard drive. If you are more knowledable about installing Ubuntu Server, please add your recommendations!

Do a "plain installation" (no extra packages except maybe Samba if you want Windows compatible file sharing).

Tip

Pick a meaningful name for your server. This will end up being the primary name of your wikidot web site. This guide uses ejwiki for the server name. Unless you plan on going live on the Internet, I also recommend picking a name that is NOT a registered domain name.

Configure the distribution

After the basic server install is done and you have rebooted, login with the username and password you created during install.

Note: After rebooting, if it seems like the computer is hung up and you see "* Running local boot scripts (/etc/rc/local) ........ [ok], just hit Enter to get a login prompt.

Next, you want to operate with "root" user privileges by doing this:

> $ sudo su -

You are prompted for your password and you will see the prompt change from "> $" to "> #".

Update the apt repositories:

> # apt-get update

Optional, but recommended for Linux novices!

Install the Gnome Desktop for Ubuntu

> # apt-get install ubuntu-desktop

Optional

Reboot

At this point, if you installed the Ubuntu Desktop and want an easier install, you should start the GUI by entering reboot at the command prompt.

> # reboot

After logging in, you can then load this guide into Firefox and copy (CTRL-C)/paste (SHIFT-CTRL-V) the commands into a terminal window.

Note

You will find that there will be a number of updates that you will be prompted to install. It is probably fine to wait until later to install updates, but I preferred to do them when prompted (and a couple of them required a reboot to be applied).

Start a terminal window by going to Applications » Accessories » Terminal

Tip

Right-click the terminal icon in the menu, and choose ""Add this launcher to panel" to create a terminal shortcut on the top menu bar.

Switch to the root user with:

> $ sudo su -

enter your password and you're ready to start copying and pasting.

Install Required Packages

Tip

Highlight everything in red text, hit CTRL-C to copy, change focus to your terminal window, hit SHIFT-CTRL-V to paste the command and then hit Enter to execute the command.

Hot Tip!

An alternate method for copy/paste is to select the text in the browser window, change focus to the terminal window and then click the middle mouse button. This will paste the text you previously selected.

> # apt-get install memcached apache2 php5 php5-cli php-pear php5-dev tetex-bin tetex-extra gs-gpl imagemagick build-essential fakeroot dpkg-dev libmagic1 libmagic-dev subversion php5-tidy php5-pgsql php5-gd zip

Optional, but recommended for remote administration of your server

Install Open SSH Server

> # apt-get install openssh-server

Install PostgreSQL (Version 8.2 does work)

Version 8.2

> # apt-get install postgresql-8.2 postgresql-contrib-8.2

Get libxdiff

(For highlighting history changes)

> # cd /usr/src
> # wget http://www.xmailserver.org/libxdiff-0.22.tar.gz
> # tar -xzf libxdiff-0.22.tar.gz
> # cd libxdiff-0.22
> # ./configure
> # make
> # make install

Get PECL (PHP) extensions

Note

PECL will pause twice to ask you questions. Just press Enter to accept the default options.

> # pecl install FileInfo memcache xdiff

Install compiled extensions:

> # echo "extension=fileinfo.so" >> /etc/php5/conf.d/fileinfo.ini
> # echo "extension=memcache.so" >> /etc/php5/conf.d/memcache.ini
> # echo "extension=xdiff.so" >> /etc/php5/conf.d/xdiff.ini

Note

Memcached is optional and caching is disabled by default in Wikidot.

Optional - Reconfigure PCRE

(important for processing long pages)

> # mkdir /usr/src/debian
> # mkdir /usr/src/debian/pcre
> # cd /usr/src/debian/pcre
> # apt-get -y source libpcre3
> # apt-get -y build-dep libpcre3
> # cd pcre3-*/
> # sed -i 's/--enable-utf8 --enable-unicode-properties/--enable-utf8 --disable-stack-for-recursion --enable-unicode-properties/' debian/rules
> # fakeroot debian/rules binary
> # dpkg -i ../*.deb
> # pcretest -C | grep 'Match recursion'

The last command should say: Match recursion uses heap

Configure Apache

> # cd /etc/apache2/mods-enabled
> # ln -s ../mods-available/rewrite.load ../mods-available/expires.load ../mods-available/headers.load ../mods-available/deflate.* .

Get Wikidot

  • Make room for Wikidot and checkout the latest version:

> # mkdir /var/www/wikidot
> # cd /var/www/wikidot
> # svn checkout http://svn.wikidot.org/repos/wikidot1/trunk .

Configure PostgreSQL

Initialize database structure from within the postgres user:

Wikidot 1 instructions

> # cd /var/www/wikidot
> # su postgres
> # psql

  • within psql type:

> # CREATE USER wd WITH PASSWORD 'wdpass';
> # CREATE DATABASE wd1 OWNER wd;
> # CREATE LANGUAGE plpgsql;
> # CREATE SCHEMA ts2 AUTHORIZATION wd;
> # \q (or <CRTL-D>) to exit psql
> # cat /usr/share/postgresql/8.2/contrib/tsearch2.sql | sed '1,5s/SET search_path = public/SET search_path = ts2/' | psql wd1

If you are using a different version of PostgreSQL, change the path of the tsearch2 init script.

> # psql wd1 < files/dump.sql

Note

It took me a long time to get this worked out so that there were no permissions errors. The rest of this section is my solution, but I'm sure it can be improved.

> # psql
> # ALTER SCHEMA ts2 OWNER TO wd;
> # \c wd1;
> # ALTER TABLE pg_ts_cfg OWNER TO wd;
> # ALTER TABLE pg_ts_cfgmap OWNER TO wd;
> # ALTER TABLE pg_ts_dict OWNER TO wd;
> # ALTER TABLE pg_ts_parser OWNER TO wd;
> # \q (or <CRTL-D>) to exit psql
> # exit (exits su postgres and returns to root user)

Configure Wikidot

  • Change directory to your new installation:

> # cd /var/www/wikidot

  • Make a working, editable copy of the GlobalProperties.php file:

> # cp conf/GlobalProperties.php.orig conf/GlobalProperties.php

Edit GlobalProperties to fit desired settings, change at least URL_DOMAIN.

If you did not install the Ubuntu Desktop, you can use the nano editor:

> # nano conf/GlobalProperties.php

  • edit the properties - as many as you need, save with ctrl+x

If you are in the GUI, try this:

  • Open another terminal window.
  • > $ sudo nautilus
  • Enter your password.
  • The Nautilus File Browser opens with root user access to files.
  • Navigate to /var/www/wikidot/conf. You will find the GlobalProperties.php file there. Double-click the file to open it in the gedit text editor.
  • Edit the file and save it.
  • Close the editor.
  • Minimize the file browser and terminal window that launched it (you'll need it later).

Generate Wikidot's Files

> # php bin/configure.php

Copy the Apache VirtualHost file to the proper place

(and make it define the FIRST vhost for Apache, on Debian)

> # cp files/apache.vhost.wikidot.conf /etc/apache2/sites-available/
> # rm /etc/apache2/sites-enabled/000-default
> # ln -s /etc/apache2/sites-available/apache.vhost.wikidot.conf /etc/apache2/sites-enabled/000-wikidot

Append Wikidot cronjobs to the global crontab

> # cat files/crontab >> /etc/crontab

Configure MIME Types (to display file types properly)

> # cp /usr/share/file/magic* /var/www/wikidot/lib/magic/

Change the owner of wikidot files:

> # chown www-data:www-data -R .

Edit The HOSTS File

  • Open the File Browser window you minimized earlier

(or open a terminal window and > $ sudo nautilus again).

  • Navigate to the /etc folder and find the hosts file.
  • Right-click and Open with "Text Editor"
  • Edit the file so it resembles below (the only lines I added are in red).
  • Substitute your server name for ejwiki.
  • Note that any new wiki sites created will have to be added manually to the hosts file (i.e newwikisite.ejwiki.com)

127.0.0.1 localhost
127.0.1.1 ejwiki.hsd1.mn.comcast.net. ejwiki
127.0.0.1 www.ejwiki.com profiles.ejwiki.com
127.0.0.1 templates-en.ejwiki.com test.ejwiki.com

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

  • Save the file.

Start/restart Apache & PostgreSQL

> # /etc/init.d/apache2 restart
> # /etc/init.d/postgresql-8.2 restart

Generate some Wikidot Files

> # cd /var/www/wikidot
> # php bin/generate_om.php

Log in to your Wikidot

  • open a webbrowser and navigate to www.yourdomain.com, click login
  • use e-mail: admin@wikidot ; password: ADMIN1

Optional, but recommended for Linux novices!

Install the PgAdminIII (GUI for PostgreSQL admin)

> # apt-get install pgadmin3

Other Tips

Stuff Left To Do / Figure Out

  • See if subdomain names for new sites can be handled automatically.
  • Fully test all Wikidot site functions (i.e backup).
  • Write an install script or two to make this even easier.

Done. Check this out…

The Easier Wikidot Home Network Install

  • Add some tips for using pgAdminIII.
  • Add tips for configuring Windows PCs so they can access the Wikidot site
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License