Previous Up Next
Introduction Introduction Configuration files
Installing SWS

Installing SWS

SWS installation instructions

Installing SWS

Checking prerequisites

To install SWS, you must first check if all the necessary prerequisites are present on the system you want to install to. These are:

  • A computer running Linux or a version of BSD

  • Apache 2.0.x

  • MySQL 4.x (higher versions might work but are as of yet untested)

  • mod_php 5.x

  • Perl 5.6.x (5.8.x might work but is as of yet untested)

  • The perl Digest::MD5 module

  • The perl DBI module, along with the DBD module corresponding with your choice of database

Many of the items in this list can be replaced with other versions (for example Apache 1.3.x instead of Apache 2), but the above is the configuration on which SWS is tested the most.

The last thing you need to verify, is that your Apache configuration allows for SWS to override some parameters in .htaccess files. Therefore, your Apache configuration should have the AllowOverride All directive set for every site root that will use SWS. Alternatively, you can copy the contents of the .htaccess files in the SWS directories into appropriate Directory entries in your Apache httpd.conf but that is a lot more work, and prone to error when upgrading.

The actual installation

In the examples below, we will assume /local/www as the document root for the main site on which SWS will be installed.

First unpack the sources:$ cd /local/www $ tar xzf sws-0.2.tar.gz $ mv sws-0.2 sws

Then run the checksetup script in the tools directory:$ cd sws/tools $ ./checksetup ==> Could not find main configuration file, assuming initial installation. ==> Creating initial SWS ini files. ==> The next step is to configure SWS by editing the main configuration file: /local/www/sws/etc/sws Then create the database that SWS will use, and specify the parameters to access this database in the main database configuration file: /local/www/sws/etc/db/sws Then run checksetup again.

As the output says, you need to edit /local/www/sws/etc/sws to your liking. Pay attention to the host and docroot parameters. The latter will be used as the base of the default site.

Next, you need to create the database. Although there are hooks provided for PostgreSQL databases, the SWS tools are not yet ready for using a PostgreSQL database, so you should use MySQL for now. Create a database and grant a user rights on it:$ mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 57 to server version: 3.23.54 Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> create database sws; Query OK, 1 row affected (0.00 sec) mysql> grant all on sws.* to httpd@localhost identified by 'yourpass'; Query OK, 0 rows affected (0.02 sec) mysql> quit Bye

Now edit /local/www/sws/etc/db/sws and set the parameters for the "sws" database.

Next, run checksetup once more:$ ./checksetup ==> Checking main configuration... ==> Checking database configuration... ==> Checking for database updates... ==> Couldn't determine sws database version - assuming new installation ==> upgrading from version 0 to version 1 ==> Now we'll insert a root user that automatically has all privileges. Please enter a password for this user. Enter password: Again to confirm:

As prompted, enter a password for the SWS root user, and a second time to confirm it. This user will have all privileges by default, so make sure it is a reasonably secure password.

==> Checking subsites configuration... ==> Checking subsites configuration... ==> site /local/www: .htaccess does not exist, creating... ==> site /local/www: .sws directory does not exist, creating... ==> site /local/www: .sws/.htaccess does not exist, creating... ==> site /local/www: .sws/config does not exist, creating... ==> Please edit /local/www/.sws/config -- make sure you specify the baseurl parameter.

Finally you should edit the default site configuration file, /local/www/.sws/config. At a minimum, you need to specify the base URL that is used to access the site, for example /my/site/ or, more typically /.

Your setup is now complete, and (hopefully) working! To test it, create a file named e.g. "test.php" in your document root with the following contents:

Hello World in SWS
TBD

Then browse to this file using your favorite browser.

Where to go from here

You will probably first want to review your configuration, and make sure all your sites are set up correctly.

After configuring SWS, it's time to use it. You will probably want to create a nice theme, because for most sites the default plain theme is a little bit too plain. For more information about creating a theme, see the theme API.

Previous Up Next
Introduction Introduction Configuration files

Documentation generated on Fri, 30 Jun 2006 10:31:36 +0200 by phpDocumentor 1.3.0RC3