Sarawak: Installation

Welcome to the installation instructions for the Sycamore release of Sarawak. This is the third public release of the Sarawak system. This page covers the installation process.


Step 1: Prerequisites

I encourage you to examine how this system works. The How it Works web page provides examples of some of the core components of Sarawak.

Before you begin, please understand that this install process will require you to have root access on a linux system. You will need to be able to add a few Perl modules, create a MySQL database, add a user account and add a new service to the system.

Step 2: Download and Unzip

Download the sarawak.tar.gz file. You can also view comments about the history of sarawak from the download page.

Extract the files from the tar file.

  tar xvzf sarawak.tar.gz
This will create a directory called sycamore in your current directory.
Change into this directory and continue on to step 2.



No longer applicable. Will add new instructions in the future

Step 3: Configure

Inside the sycamore directory, you will find a file called setup.conf. Customize the setup.conf file with parameters for your site and then execute the configure.pl script.

Follow these instructions to configure the setup.conf file

After the setup.conf file is configured for your site, execute the configure Perl script.

/usr/bin/perl configure.pl
The configure process will check for perl modules, validate the contents of the setup.conf file and create a few install scripts.
Note: Please be sure to use the same perl interpreter as you specified in the setup.conf file.



Step 4: Install the Code

Execute the three install scripts.

The install_core.bash script will install the core components of Sarawak. This step will prompt you for the MySQL root password so it can create the database and the database user.

The install_web.bash script will write the html and cgi scripts to the web user's public_html directory.

The install_daemon.bash script will create a file in /etc/xinet.d/ to enable the log capturing service.

Run these three scripts to complete the install.

  ./install_core.bash
  ./install_web.bash
  ./install_daemon.bash




Step 5

The Apache web server needs a few options enabled to allow the perl cgi scripts to execute from the web. Add the following configuration to your httpd.conf file. These options assume the user's home directory is in the /home directory.
    <IfModule mod_userdir.c>
        # Enable requests to /~user/ to serve the user's public_html
        UserDir public_html
    </IfModule>

    <Directory /home/*/public_html>
        AllowOverride All
        Options +Includes
    </Directory>

    ScriptAliasMatch ^/~([^/]*)/cgi-bin/(.*) /home/$1/public_html/cgi-bin/$2

    <Directory "/home/*/public_html/cgi-bin">
      Options ExecCGI
      SetHandler cgi-script
      AllowOverride None
      Allow from all
      Order allow,deny
    </Directory>




Step 6

Since this system uses various services, we need to make sure these services startup upon boot. The following will help you configure these services.

Setup MySQL, Apache and xinetd to start on boot. These commands will actually configure them to start in run levels 3, 4 and 5.

  chkconfig --level 345 mysqld on
  chkconfig --level 345 httpd on
  chkconfig --level 345 xinetd on
The xinetd process will manage the network listener component. However, this service is disabled by default. The following command will enable the network listener. You will need to insert the name you gave to the XINETD_SERVICE in the setup.conf file. In our example we would specify chkconfig sycamore on to enable the service.
  chkconfig  <XINETD_SERVICE> on
To get us started, make sure all the services are running. The following commands will restart all the services. It is OK if you see errors indicating that the service failed to stop. But, you should not see an error on the startup of the service.
  service mysqld restart
  service httpd restart
  service xinetd restart




Step 7

The step is applicable only if you have iptables enabled.

You will need to explicitly allow access to various services if you have the iptables firewall enabled. This configuration will vary depending on the services you wish to enable, the clients you want to allow and the IP numbering scheme of your network.

The configuration for iptables can be found in /etc/sysconfig/iptables

You will need to enable access for the following services, but the port numbers may vary depending on your installation.

Service Port
Web Server 80/tcp
xinetd service 2469/tcp

You will need to customize the following examples for your environment:

Examples:

To enable your servers (10.40.0.0 - 10.40.255.255) to send log data to the xinetd service on tcp 2469.

    -A RH-Firewall-1-INPUT -s 10.40.0.0/255.255.0.0 -p tcp -m state --state NEW -m tcp --dport 2469 -j ACCEPT
To enable your client (10.123.0.0 - 10.123.255.255) to access the web server on port tcp 80
    -A RH-Firewall-1-INPUT -s 10.123.0.0/255.255.0.0 -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
You will need to restart the iptables service after making changes to the /etc/sysconfig/iptables. If this service fails to start, then you probably have an error in your entries.
  service iptables stop
  service iptables start