» tagged pages
» logout

(Feed found, click Add Page to syndicate.) Error finding feed, please try again » Find feed title

A Blog Page allows you to add entries, for news or other time sensitive postings

(Login required to save to your tagged pages.)
(or Cancel)

Make further edits, (or Cancel)

(Login required to save to your tagged pages.)
(or Cancel)

(Editing anonymously: to be credited for your changes, login or register a new account)

Change Page Permissions? Changing these permissions will adjust who can modify this page.

alex (change)
Swik Users (change)
(or Cancel)
Upload an image from your computer:
or Copy an image from a URL:
or Erase the current icon:
Icon Preview:

or Cancel

Erase SWiK-Source? The contents of SWiK-Source page and all pages directly attached to SWiK-Source will be erased.

or Cancel

(Editing anonymously: to be credited for your changes, login or register a new account)

other page actions:
SWiK-Source

SWiK-Source

Tag Cloud

To further filter what appears in the Things Tagged SWiK-Source list, select a tag from the Tag Cloud.

SWiK-Source is the source code of the swik.net core engine. It is licensed for distribution under the GNU General Public License v2.

SWiK-Source is meant for people who are curious about the code that powers SWiK, for people who want to try making their own SWiK for their internal use or for some new web site, as well as for use with SourceLabs’ internal and partnering projects.

SourceLabs has released SWiK-Source as a source code release rather than a packaged release: it’s a complicated system built with a lot of assumptions for custom production servers rather than arbitrary or generic systems.

Installation

Setup and Deployment of SWiK Source is a 3 step process.
  1. Installing Dependencies
  2. Setup and Deployment
  3. Backend Deployment
Notes:

These documents are collaborative: if you run into trouble or see something wrong, fix the docs!

sorted by: recent | see : popular
Content Tagged SWiK-Source

SWiK Steering Committee

We’re preparing a new update to the SWiK site and have a lot of further updates planned, and as we go along and change and introduce new things to SWiK and SWiK-Source it seems like it might be a good idea to have a discussion over email of ideas for how SWiK should run and what features we need to add.

I dunno if there is a lot of interest in people helping decide how swik should be run, but if you’d be interested send me an email at

PS: New update to the site coming in a bit …

SWiK: News

Development Roadmap

SWiK development is fairly loose but we have ideas of features we want to see go into SWiK-Source.

While not all of these will make it into the code, here are 10 ideas of what we are working on currently or want to work on soon. These are not in any particular order.

  1. Make homepage more exciting
  2. LDAP integration for intranet use
  3. More sophisticated page locks
  4. Better install package
  5. Better popularity rankings in ?popular
  6. RSS feed coverage in areas that are not covered
  7. 2nd level page / 1st level page rationalizations
  8. Search improvements powered by Lucene or some other search library
  9. Back button support in editing areas
  10. File Attachments

Because of the way our internal development works, we will only do SWiK-Source releases intermittently, when we have stable releases. Features will likely appear in swik.net before they appear in swik-source, as the website is a lot easier to change on the fly than a packaged release.

SWiK-Source: 1st Release

SWiK Source – 1st Developer Release

This initial source code release is intended for a developer audience that is savvy enough to navigate complicated installation procedures and environment incompatibilities.

Due to bugs in Apache on Windows, SWiK is not capable of running perfectly on Windows and thus has not been tested for Windows at all: advised use is on Unix based servers, such as Ubuntu, Redhat/CentOS (the platform used in production) and Mac OS X (the platform used in development).

Future releases will include general maintenance of the code base to keep parity with the running service, and if there is sufficient interest or support in improving the source or the package, we will more forward on that front too.

SWiK-Source: SWiK-Source News

Backend Deployment

After you have installed dependencies, setup and configured the server, you are now ready to setup and deploy the backend.

There are various long running services that SWiK Source runs on the backend. These include: RSS aggregation, and various page and tag statistics computations.


Before You Start

The backend is mostly Java based and requires Java version 1.5, so make sure that you have Java 1.5 installed – you can obtain this from Sun, instructions are below, or skip to the 2nd step if you have java already.

Again, in these instructions the root directory of SWiK Source where you expanded the source files will be referred to as SWIK_HOME.

Step 1: Install Java 1.5

You must have JDK 1.5.x installed on your machine. These instructions detail how to download and install the Java 1.5 JDK. You should install the latest minor release.

Download the x86-64 version of the JDK. Pick the proper Java 1.5 JDK for your machine. These instructions assume you downloaded the AMD64 version, adjust as necessary for your own environment.

Run the self-extracting .bin file:

chmod a+x jdk-1_5_0_05-linux-amd64-rpm.bin*
 ./jdk-1_5_0_05-linux-amd64-rpm.bin*
As root, install the RPM that emerges:

rpm -iv jdk-1_5_0_<version>-linux-i586.rpm
(notice). These instruction assume that the new Java is on your path. At this point you should add the new version of Java to your path.
  • Verify that you are running 1.5, the required version of Java.

java -version
  • You should see something like:

java version "1.5.0_05" 
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05)
Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_05-b05, mixed mode)

Step 2: Deploy the Backend

Now you need to deploy your backend. The script assumes that Java 1.5 is on your path when you execute the script. If this is not true you’ll need to modify the script to pick up the proper version of Java.


cd SWIK_HOME/setup
bash -x ./backend_setup.sh config

This should start the backend. You can verify this by looking in the /opt/swik/backend/logs directory and verify that there are three sets of logs, feedsucker, strength and zeitgrinder. There should be both a status and error log for each.

Troubleshooting

Thing that often break in SWiK-Source, and why they break. The best way to diagnose problems is to check in the /logs directory. app.errors.log is a good place to look for application errors that occur on page load, app.ajax-errors.log is a good place to look for errors that occur through interactivity with ajax features.

SWiK fails to respond at all or returns a white page.

SWiK assumes a dedicated domain, such as swik.net, or no domain, for use in local host, see localhost install notes. The domain must not have a subdomain. Requests to SWiK are sent to apache through the virtual host setup, and then apache passes the request to swik.php, along with the raw query string. SWiK parses the query string and goes through each major page type, using an inverted control scheme to ask if a page wants to service the request.

This can go wrong because:
  • the requests aren’t being sent to swik: a virtual host setting is wrong, or a DNS issue
  • an error has been triggered and swik source is configured to hide errors.
  • an invalid swik domain has been used.

User and license pages fail to work properly

SWiK-Source does not encode the ’:’ entity in urls such as User:alex. On Unix in Apache 2.0, this is allowed, on Windows OR in Apache 1.0 this is not.

To fix this issue:
  • switch to Apache 2.0
  • do not host a swik-source wiki on windows
  • fix the bug in apache on windows.

Save a wiki page -> no text appears.

This occurs because SWiK execs a ruby textile script to generate the description cache, and it may have difficulty .

This can be because:
  • tmp file privileges are improperly set
  • ruby is not installed or the path to it is incorrect

check both these things.

RSS feeds do not syndicate properly

RSS feeds are syndicated using a temporary file, and then parsed with MagpieRSS.

If there is an issue with this, it can be because:
  • tmp file privileges are improperly set
  • the path to swik-configure is improperly set

Icon upload fails

Icon uploads use a two stage system. First the icon is persisted into the database; on the next request the icon is cached into a web directory. This is to ensure a single store for a multi-web-server environment, and cache icons for fast access.

If there is a problem with icon upload, it can be because:
  • the swikIcons directory is not created or has bad privs for the server to write to.
  • a libpng or libjpg library failure.

Setup and Deployment

Setting up and installing SWiK Source requires you have the necessary components installed first.

  1. Download and unpack SWiK Source
  2. Create a MySQL database for your wiki
  3. Edit setup/setup.sh – update the shell script to include the various settings for the wiki. The defaults are set for CentOS/Redhat – swik-source requires running as its own domain and if you are using a localhost, see localhost install notes for how to fake the domain on your own box.
  4. Run the setup/setup.sh script.
  5. Restart apache
  6. Update the database with setup/swik_tables.sql

After this is complete, you can run the backend deployment.

SWiK-Source News

News regarding SWiK-Source.

Installation

Setting up SWiK Source is a three step process. First, make sure you are running the software that SWiK Source relies upon, such as PHP and Apache. Second, configure your wiki and deploy it to a production directory. Finally, configure and deploy the backend services.

All documentation for SWiK Source lives on SWiK, so please refer to it if you have an issue, or improve it if you notice something lacking.


Install project dependencies

Setup and deploy the wiki

Setup and deploy the backend

  • SWiK Source includes various backend services that do background statistics generation as well as hourly RSS aggregation, to setup these services: follow the instructions in “Backend Deployment”.

Running your wiki on your local machine

  • SWiK Source is configured by default to run on a production web server. If you wish to run it locally, you need to make a few tweaks to the configuration, described in “Localhost Install Notes”.

Installing Dependencies

SWiK Source is built on and integrated with the platform combination of PHP, MySQL, and Apache HTTPd. These applications are not packaged as part of the distribution, however SWiK Source requires these and other 3rd party open source components to run properly.

List of components you must either have or obtain and install before setting up SWiK Source:
  1. PHP 5.0 (see below for specific configure line)
  2. Apache 2.0
  3. MySQL 4.1
  4. Ruby
  5. Java
  6. libxml
  7. libjpg
  8. libpng

Install these components yourself, or look down for how to compile these from source.

After you have completed installation of these components, continue to Setup and Deployment.


Step by step instructions for downloading and installing components

Note: These instructions assume you will make a directory called /usr/local/work and do your downloads and installations from there. If you deviate from this, please be careful to note instructions specific to this install directory.

Note: Many of these steps involve installing and configuring system level software, as such the steps assume that you are running as root. (“su -”, “sudo bash”, etc). If you are concerned about running as root, you can run much of the configuration without the privilege but please note steps that will have system level impact and do sudo accordingly.

Finally, all the steps assume you are setting your wiki up on a clean machine. If you have previous installations of components, you’ll have to adjust these instructions accordingly to make sure that your installations match the dependencies.

If you are using a package management system (such as yum on CentOS or Fedora) you can just make sure you’ve got the right packages installed, skipping all the following steps. For a CentOS 4.3 install, we used the following packages:

php-5.0.4-5.centos4
php-pear-5.0.4-5.centos4
php-ldap-5.0.4-5.centos4
php-mysql-5.0.4-5.centos4
php-mbstring-5.0.4-5.centos4
php-xml-5.0.4-5.centos4
php-imap-5.0.4-5.centos4
php-gd-5.0.4-5.centos4
php-xmlrpc-5.0.4-5.centos4
php-devel-5.0.4-5.centos4
httpd-suexec-2.0.52-22.ent.centos4
httpd-2.0.52-22.ent.centos4
httpd-devel-2.0.52-22.ent.centos4 
mysqlclient10-3.23.58-4.RHEL4.1 
mysql-4.1.20-1.RHEL4.1
mysql-server-4.1.20-1.RHEL4.1

On RedHat based systems, you can verify these are installed using ‘rpm -qa | grep [php|httpd|mysql]’


For installation on Ubuntu, here are the package matches discovered so far:

php-5.0.4-5.centos4 - php5
php-pear-5.0.4-5.centos4 - php-pear
php-ldap-5.0.4-5.centos4 - php5-ldap
php-mysql-5.0.4-5.centos4 - php5-mysql
php-mbstring-5.0.4-5.centos4 - - libapache2-mod-php5
php-xml-5.0.4-5.centos4 - php-xml-parser (?)
php-imap-5.0.4-5.centos4 - php5-imap
php-gd-5.0.4-5.centos4 - php5-gd
php-xmlrpc-5.0.4-5.centos4 - php5-xmlrpc
php-devel-5.0.4-5.centos4 - php5-dev (?)
httpd-suexec-2.0.52-22.ent.centos4 - - apache2-mpm-perchild (?)
httpd-2.0.52-22.ent.centos4 - - apache2 (?)
httpd-devel-2.0.52-22.ent.centos4 - apache2-utils (?)
mysqlclient10-3.23.58-4.RHEL4.1 - mysql-client
mysql-4.1.20-1.RHEL4.1 - mysql-common (?)
mysql-server-4.1.20-1.RHEL4.1 - mysql-server
libpng - libpng12-0
libjpg - libjpeg62
Java - sun-java5-jdk
Ruby - ruby

Step 1: Download

These are the primary versions which have been fully tested for SWiK Source. It should be fine to use new minor release, but some higher point releases may break.


Step 2: Install MySQL

Run the installer. The installer puts everything in /usr/local/mysql-blahblah and links to it from /usr/local/mysql. Set a root password!, or not (it’s a lot easier to manipulate data when you don’t … sure is a lot more secure when you do).


Step 3: Install Apache2

cd /usr/local/work
tar xfj httpd-2.0.54.tar.bz2
cd httpd-2.0.54
./configure --prefix=/usr/local/apache2 --enable-so --enable-rewrite=shared --with-mpm=prefork --enable-expires=shared
make && make install

Note: The httpd.conf will be configured later, when setting up and deploying the wiki.


Step 4: Build and Install libxml2

cd /usr/local/work
tar xfz libxml2-2.6.17.tar.gz
cd libxml2-2.6.17
./configure --prefix=/usr/local
make && make install


Step 5: Download the Graphics Libraries

The JPEG and PNG libraries for working with images need to be downloaded.


 cd /usr/local/work
 curl -O http://www.ijg.org/files/jpegsrc.v6b.tar.gz
 curl -O http://heanet.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.6rc5.tar.gz
 gnutar xzf jpegsrc.v6b.tar.gz
 gnutar xzf libpng-1.2.6rc5.tar.gz


Step 6: Build and Install the JPEG library

  • Build and install the jpeg-6b library:

 cd jpeg-6b
 ./configure
 make install
 make install-lib
 ranlib /usr/local/lib/libjpeg.a
 cd ..


Step 7: Build and Install the PNG library

  • First copy the correct makefile for your environment (.darwin for osx, .linux for linux, etc).

    cd libpng-1.2.6rc5 cp scripts/makefile.your_environment ./Makefile

You need to make a few changes to the Makefile to point at your zlib locations before you build the library.

EDITOR_PROGRAM Makefile
  • Find the following lines:

 # Where the zlib library and include files are located 
 #ZLIBLIB=/usr/local/lib 
 #ZLIBINC=/usr/local/include
 ZLIBLIB=../zlib
 ZLIBINC=../zlib
  • Reverse the comments to this:

 # Where the zlib library and include files are located 
 ZLIBLIB=/usr/local/lib 
 ZLIBINC=/usr/local/include
 #ZLIBLIB=../zlib
 #ZLIBINC=../zlib
  • Now build and install the PNG library:

    make make install ranlib /usr/local/lib/libpng.a

Step 8: Build PHP


 cd /usr/local/work
 tar xfj ~/php-5.0.4.tar.bz2
 cd php-5.0.4
 ./configure  --prefix=/usr/local/php5 
   --with-apxs2=/usr/local/apache2/bin/apxs
   --with-mysqli=/usr/local/mysql/bin/mysql_config --with-mysql=/usr/local/mysql
   --enable-mbstring --enable-mbregex --enable-soap --with-libxml2=/usr/local
   --with-zlib=/usr --with-iconv --with-gd --with-jpeg-dir=/usr/local/work/jpeg-6b
 make && make install

Note: php.ini will be setup later.


If you successfully completed these steps, you’ve now got the platform for SWiK Source to run. Please continue to the next step: SWiK Source Setup and Deployment.

Localhost Install Notes

Running a SWiK Source wiki on your local machine requires a few modifications to your configuration.

Step 1: Modify /etc/hosts

Add the following to your */etc/hosts

127.0.0.1       @SWIK_HOSTNAME
127.0.0.1       zeitgeist.@SWIK_HOSTNAME
127.0.0.1       history.@SWIK_HOSTNAME
127.0.0.1       xml.history.@SWIK_HOSTNAME
127.0.0.1       xml.@SWIK_HOSTNAME
127.0.0.1       icon.@SWIK_HOSTNAME

Step 2: Modify php.ini

You need to remove the cookie domain from php.ini.

# cd SWIK_CONFIG # EDITOR_PROGRAM php.ini # Find the ‘session.cookie_domain’ line are remove the value, the line should look like:
session.cookie_domain = 

Step 3: Modify httpd.conf

You need to add the ServerName to you @SWIK_HOSTNAME.

cd SWIK_CONFIG
EDITOR_PROGRAM php.ini
  • Find the ’#ServerName swik’ line. It is commented out. Un-comment it out and add the @SWIK_HOSTNAME to it. It should look like:

    ServerName @SWIK_HOSTNAME

Username:
Password:
(or Cancel)