downloads
  • apache 1.3.41
  • postgresql 8.2.13
  • ocaml 3.09.1
  • postgresql-ocaml 1.6.3
  • postgresql label datatype
  • selinks r7124
  • sesense
  • sewiki
  • SElinks installation

    Note: The installation procedure described here is fairly involved. Examples of selinks programs are available online:

    Install and configure webserver

    Running selinks requires a webserver. The configuration instructions provided are specific to apache 1.3.41. The instructions might require adaptation to other apache versions. Apache 1.3.41 can be downloaded here.

    See Compiling and Installing Apache for instructions on this step.

    Configuration

    Once apache is installed, some configuration additions need to be made, in the apache configuration file, httpd.conf, in the directories section, edit the DocumentRoot to refer to the intended location of links programs.
    DocumentRoot "/path/to/links/programs/"
    
    Also, edit the options for the document root to allow cgi execution:
    <Directory />
      Options Indexes FollowSymlinks MultiViews ExecCGI
      AllowOverride None
      Order allow,deny
      Allow from all
    </Directory>
    
    Next, in the section begining with IfModule mod_mime.c, add:
        AddHandler cgi-script .links
    
    Changes to apache configuration require server restart.

    Note: If another webserver is running on the computer, you might have to change the port at which it will be accessible. This can be done by modifying the Listen line in httpd.conf to refer to another, unused port:
    #
    # Listen: Allows you to bind Apache to specific IP addresses and/or
    # ports, instead of the default. See also the 
    # directive.
    #
    #Listen 3000
    
    Additionally, the URLs mentioned further in this document have to reflect this change; instead of pointing your browser to http://localhost/... you will have to point it to http://localhost:3000/... where 3000 is the port used.

    Database

    Required is postgresql 8.2.x, that is, 8.3 or newer will not do. The relevant version can be downloaded here. Refer to the postgresql documentation for instructions.

    Note: If another postgresql database is running on the same computer, the port used by your installation might need to be changed, this can be done by editing the postgresql.conf file within the database directory that you should have created when following the installation instructions on the postgresql documentation page:
    port = 5432                            # (change requires restart)
    

    Label datatype

    Once the postgresql is installed, we require the installation of a custom datatype (label). Download the label datatype and build it with make. To make on a non-OSX computer, make sure to comment out the DARWIN line in the Makefile:
    # comment out the next line if not making on osx
    DARWIN="yes"
    
    Also, make sure PG_DIR is set to the location wehre postgresql was installed:
    PG_DIR = /usr/local/pgsql
    
    Next, edit label.sql, replacing every occurance of PATH-TO-LABEL to the location of the just built label.so:
    -- replace PATH-TO-LABEL with the location of label.so, excluding the ".so"
    -- example: /fs/macdonald/selinks/sesense/selinks_strap/pgsql/label
    

    Database configuration

    Once database and label datatype are installed/built and the database is running, some additional items need to be carried out. First, create a database for the SEsense app, connect to that database (assumes commands are ran in the /bin directory of the database installation), and create a role:
    ./createdb --port 5432 selinks
    
    CREATE DATABASE
    ./psql --port 5432 selinks
    Welcome to psql 8.2.13, the PostgreSQL interactive terminal. Type: \copyright for distribution terms \h for help with SQL commands \? for help with psql commands \g or terminate with semicolon to execute query \q to quit
    selinks=# CREATE USER selinks WITH PASSWORD 'password';
    CREATE ROLE
    Next, include the label.sql recently built while connected to the sesense database:
    selinks=# \i /path/to/label.sql
    
    NOTICE: type "label" is not yet defined DETAIL: Creating a shell type definition. ... CREATE FUNCTION CREATE OPERATOR CLASS CREATE LANGUAGE
    Also, determine the oid of the label datatype and write it down:
    selinks=# SELECT oid FROM pg_type WHERE typname = 'label';
    
    oid ------- 17015 (1 row)

    Install OCaml

    Next install OCaml. The further installation of SElinks might not proceed as needed with a version of OCaml other than 3.09.1. The proper version can be downloaded here. Follow the installation instructions within the package.
    Note: opt.opt needs to be specified when making OCaml.
    make opt.opt
    
    ...
    make install (or sudo make install)
    ...

    OCaml database bindings

    Additionally, the OCaml bindings for postgresql need to be installed. The version with some small additions can be downloaded here.

    The Makefile.conf file needs to be edited to refer to the pg_config inside the postgresql installation:
    PG_CONFIG = /usr/local/pgsql/bin/pg_config
    
    Next edit the lib/postgresql_stubs.c to reference the label oid retrieved from postgresql several steps earlier.
    #define LABELOID                17015
    
    Then, build using make.

    Note: You might not be able to make install the bindings. Instead we will rather refer to the location where the bindings have been built explicitly in the further steps.

    Install SElinks

    Next install SElinks, which can be downloaded here. To do this, edit Makefile.config to make proper reference to the library directory where ocaml database bindings have been installed and the postgresql library directory:
    # OCaml PostgreSQL bindings
    POSTGRESQL_LIBDIR=/opt/local/lib/ocaml/site-lib/postgresql/lib
    
    # PostgreSQL lib files
    EXTRA_LIBDIRS=/usr/local/pgsql/lib
    
    SElinks is then built using make nc.

    Finally, the config file needs to be modified to make reference to the database, including host, port, username (db user), and password:
    database_driver=postgresql
    database_args=localhost:5432:selinks:password
    

    Run SEwiki

    Download sewiki and unpack into the web served directory configured earlier. Also, edit the first line of sewiki.links to make reference to the location of links in the selinks directory and the config file in the same selinks directory:
    #!/Users/piotrm/Sites/selinks/links --config=/Users/piotrm/Sites/selinks/config
    
    The sewiki.links file needs to be properly chmodedded,
    chmod 755 sewiki.links
    
    Additinally, the database tables for sesense need to be defined (run in the selinks database):
    selinks=# \i path/to/sewiki/db.sql
    
    SET SET SET ... REVOKE GRANT GRANT
    Now, assuming everything went according to plan, the webserver and the database are running, you can navigate to http://localhost/sewiki/sewiki.links in your browser.

    Note: Before logging in to sewiki for the first time, reload the login page.

    Run SEsense

    Download sesense and unpack into the web served directory configured earlier. Also, edit the first line of sense.links to make reference to the location of links in the selinks directory and the config file in the same selinks directory:
    #!/Users/piotrm/Sites/selinks/links --config=/Users/piotrm/Sites/selinks/config
    
    The sense.links file needs to be properly chmodedded,
    chmod 755 sense.links
    
    Additinally, the database tables for sesense need to be defined (run in the selinks database):
    selinks=# \i path/to/sesense/db.sql
    
    DROP TABLE ... INSERT 0 1 INSERT 0 1 INSERT 0 1
    In order for sesense to function properly, the Ponder2 SMC needs to be running. The SMC is included in the ponder directory, within sesense. To run it, use
    ./ant sesense
    

    Note: The Ponder2 SMC requires Java JDK.

    Now, assuming everything went according to plan, the webserver, database, and ponder SMC are running, you can navigate to http://localhost/sesense/sense.links in your browser.