Manual Installation: Steps

Preparation

  1. Create the wacs user account and group and place your own username in the group file (/etc/group or distributed name service equivalent). This is easily done with the useradd command on Redhat-based distributions:
    # groupadd -r wacs
    # useradd -m -g wacs -r -c "WACS Files Owner" \
      -s /bin/bash wacs 
    #
    
  2. First of all check the web server is working by pointing your web browser to the address you expect it to be - you should see either the standard "It Works!" message or your existing web site. You have two basic choices as to how to install the WACS web tree - one is to place it within the existing web document tree, the other is to explicitly add the wacs directory into a custom configuration for the web server. The package installs of WACS place the document tree in /usr/share/wacs/html as part of placing all of the wacs system within /usr/share/wacs. If you're undecided as to which to use, we would recommend using the dedicated WACS directory tree either in /usr/share/wacs or /opt/WACS based on the usual convention on the Operating System you're using.

    You need to install the barebones WACS html index pages from the htmlbones directory of the distribution into your web tree and check you can see it. On a conventional Linux installation, this would be done with:

    # cd unpack_location
    # mkdir /usr/share/wacs/html
    # cp -rp htmlbones/* /usr/share/wacs/html
    #
    

    You then need to add the configuration file adjunct into the appropriate web server configuration directory - on Ubuntu this is to be found in /etc/apache2/conf.d/ and in RedHat flavours of Linux in /etc/httpd/conf.d - it's likely to be something similar on all *nix systems. Typically the Apache web server picks up any file ending with .conf in this directory so the logical name is wacs.conf. This file should contain the following, adjusted appropriately for the location you have choosen:

    Example 8.1. Sample Apache wacs.conf File

    # Bring in the wacs icons, glyphs and stylesheets from the /usr/share area.
    Alias /wacs /usr/share/wacs/html
    
    <Directory /usr/share/wacs/html>
      AllowOverride Options FileInfo
    </Directory>
    
    # add in the scripts in the cgi-bin directory
    ScriptAlias /cgi-bin/wacs /usr/share/wacs/cgi-bin
    

    [Tip]Tip

    If this proves not to work (Ubuntu had a problem with it), you can add a symbolic link into /usr/lib/cgi-bin pointing to /usr/share/wacs/cgi-bin.

  3. For the perl modules, first check whether your operating system distribution includes them - Redhat Flavours usually has packages called perl-DBI, perl-DBD-MySQL and perl-XML-Simple - so these could be simply installed with yum install perl-DBI, yum install perl-DBD-MySQL and yum install perl-XML-Simple. On Ubuntu these are called libdbi-perl, libdbd-mysql-perl and libxml-simple-perl respectively.

    The next easiest way to install the necessary perl modules, if they are not already present, is to use the cpan command. On some recent releases, the cpan command has become optional - you will have to do a yum install cpan on Redhat systems - Ubuntu is currently still installing it as part of perl. Once you have cpan, the necessary perl module installs can typically be done with:

    # cpan XML::Simple
    # cpan Data::Dumper
    # cpan File::Basename
    # cpan MIME::Base64
    #
    

The Wacs Code Itself

  1. The next step is to install the WACS perl modules into an appropriate perl library directory on your system. If you run perl -V, the perl interpreter will give you a list of the directories it will look in for perl modules. Generally the best idea is to use that doesn't include a specific version number, and ideally one that is obviously seperate from where the Operating System places it's versions of perl modules. On both Ubuntu and Redhat flavours of Linux, this would be /usr/share/perl5.

    First of all install the WacsId.pm perl module into the /usr/share/perl5 directory (or the appropriate one) of your system. [NB: note the change of case of the first letter of the perl module name from wacs.pm to Wacs.pm]. Then create a directory within there called Wacs and copy into there the WacsUI.pm, WacsStd.pm, WacsId.pm and WacsInstUtil.pm modules:

    # cd unpack_location
    # cp modules/wacs.pm /usr/share/perl5/Wacs.pm
    # mkdir /usr/share/perl5/Wacs
    # cp modules/wacsui.pm /usr/share/perl5/Wacs/WacsUI.pm
    # cp modules/wacsstd.pm /usr/share/perl5/Wacs/WacsStd.pm
    # cp modules/wacsid.pm /usr/share/perl5/Wacs/WacsId.pm
    # cp install/WacsInstUtil.pm /usr/share/perl5/WacsInstUtil.pm
    #
    
  2. The next step is to install the PAM modules and pam_auth program but you only need to do this if you want the host operating system to authenticate users for you. If you're going to be using user accounts in the database itself, you can skip this step completely. First install the wacs PAM (Plugable Authentication Modules) configuration into the /etc/pam.d directory. You will also need to compile the pam_auth program using the provided make file and then install the binary created into whereever your tooldirs configuration variable is set to (a common value is /usr/bin but /usr/local/bin or even /opt/WACS/bin would probably be better). If this compilation fails, the most likely cause is that the libpam development package is not installed. Then you need to create the /var/run/wacs directory where the dynamic leases files are stored and change it's ownership to apache (or whatever your web server user is).
    # cp unpack_location/security/wacs.pam /etc/pam.d/wacs
    # chown root.root /etc/pam.d/wacs
    # chmod 644 /etc/pam.d/wacs
    # cd unpack_location/security
    # make -f Makefile all
    Building pam_auth.x86_64-Fedora8 ...
    cc -o pam_auth.`arch`-`lsb_release -si | sed 's/\ /_/g'``lsb_release -sr`
    	pam_auth.c -lpam
    # ls pam_auth*
    pam_auth    pam_auth.c   pam_auth.x86_64-Fedora8
    # cp pam_auth.x86_64-Fedora8 /usr/local/bin/pam_auth
    # chown root.wacs /usr/local/bin/pam_auth
    # chmod u+s /usr/local/bin/pam_auth
    # mkdir /var/run/wacs
    # chown apache.apache /var/run/wacs
    #
    
    [Note]Note

    if you run selinux (Security Enhanced Linux) on Fedora Core or Redhat (or another future distro that includes it), you will need to give apache privilege to read the /var/run/wacs directory - this can be done by changing the context of the directories and files. The commands to do this are:

    # chcon system_u:object_r:httpd_sys_content_t /var/run/wacs
    # chcon -R system_u:object_r:httpd_sys_content_t /var/run/wacs/*
    # 
    
    If the leases file does not exist when you first do this and you encounter problems, try using the second of these two commands again.
  3. install the wacs application programs into the cgi-bin tree:
    # cd unpack_location
    # cp index/wacs* models/wacs* presentation/wacs* /usr/share/wacs/cgi-bin/
    # cp retrieval/wacs* search/wacs* tag/wacs* /usr/share/wacs/cgi-bin/
    # cp security/wacslogin /usr/share/wacs/cgi-bin/
    # cp security/wacslogout /usr/share/wacs/cgi-bin/
    # cp security/wacspref /usr/share/wacs/cgi-bin/
    # cp manage/wacs* /usr/share/wacs/cgi-bin/
    # chmod 755 /usr/share/wacs/cgi-bin/wacs*
    #
    
  4. install the wacs application programs into the cgi-bin tree:
    # cd unpack_location
    # cp index/wacs* models/wacs* presentation/wacs* /usr/share/wacs/cgi-bin/
    # cp retrieval/wacs* search/wacs* tag/wacs* /usr/share/wacs/cgi-bin/
    # cp security/wacs* manage/wacs* /usr/share/wacs/cgi-bin/
    # chmod 755 /usr/share/wacs/cgi-bin/wacs*
    #
    
  5. copy the applications that are just duplicate versions of existing commands and change the appropriate mode variables:
    # cd /usr/share/wacs/cgi-bin
    # cp wacsmodelpage wacsmpthumbs
    # editor wacsmpthumbs
    # cp wacsmodelpage wacsmpmini
    # editor wacsmpmini
    # cp wacsmodelpage wacsmpfull
    # editor wacsmpfull
    # cp wacsimgcats wacsvidcats
    # editor wacsvidcats
    # cp wacsimgcats wacsphotcats
    # editor wacsphotcats
    # cp wacsimglist wacsvidlist
    # editor wacsvidlist
    # cp wacsnewsets wacsnewvideo
    # editor wacsnewvideo
    # cp wacsshow wacsvidshow
    # editor wacsvidshow
    # cp wacsindex wacspage
    # editor wacspage
    # cp wacsimgselect wacsvidselect
    # editor wacsvidselect
    #
    
    edit the file and change the mode variable (thumbsmode in this case). Repeat this process for wacsimgcats becomes wacsvidcats and wacsphotcats, and so on. At the end, make sure all of the copies are executable:
    # cd /usr/share/wacs/cgi-bin
    # chmod 755 wacs*
    

Configuration

  1. install the configuration file, wacs.cfg into a suitable location such as /etc/wacs.d or /usr/local/etc/wacs.d. Edit this file and make sure the key settings are right for your server, specifically the location of the image files, the location of the video files and the server name in the URLs. You will also need settings for the database user name and password you intend to use, and the environment and path locations needed for the database system you are using. For more information, see the Configuration Guide.
  2. create a suitable permanent access control list in the configuration directory choosen above, the supplied wacs.acl should provide a suitable template. This step can be skipped if you're only ever going to use lease-based access with logins. For more information on the format of the access control lists, please see the section on security in the Configuration guide.

Database

  1. create a suitable owner account for the wacs data tables in your database system. The instructions here cover doing this for both MySQL and Oracle 10g, in that order. With MySQL 5.x, this would be done with:
    % mysql --user=root
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 17 to server version: 5.0.22
    
    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
    
    mysql> create database wacs;
    
    mysql> create user 'wacs'@'myserver' identified by 'wacs';
    
    mysql> create user 'wacs'@'localhost' identified by 'wacs';
    
    mysql> grant all on wacs.* to wacs;
    
    mysql> commit;
    
    mysql> flush privileges;
    
    mysql> quit
    
    With Oracle 10g, this would be something like:
    % sqlplus
    SQL*Plus: Release 10.1.0.3.0 - Production on Fri Sep 29 14:53:56 2006
    Copyright (c) 1982, 2004, Oracle.  All rights reserved.
    
    Enter user-name: system
    Password: *******
    
    Connected to:
    Oracle Database 10g Release 10.1.0.3.0 - 64bit Production
    
    SQL> create user wacs identified by wacs;
    
    User created.
    
    SQL> grant connect, resource to wacs;
    
    Grant succeeded.
    
    SQL> alter user wacs default tablespace main
       quota unlimited on main;
    
    User altered.
    
    SQL> commit;
    
    Commit complete.
    
    SQL> quit
    Disconnected from Oracle Database 10g Release 10.1.0.3.0 - 64bit Production
    
    Of course there is a huge amount of variance in how any given database is installed, so you will need some knowledge about your installation. For instance, your main tablespace may not be called "main" as it is in the example.

Database Schema Creation

  1. login as the database user just created and run the table create SQL script from the creation directory of the WACS distribution. These scripts are called by a single creation script, the one for oracle is called create_oracle.sql, the one for MySQL is called create_mysql.sql. To run this on MySQL 5.1 using the account created in the step above, you would do the following (the only difference for a web hosting service is that you probably have a yoursite_ prefix on the user and database names):
    % cd unpack_location/creation
    % mysql --user=wacs --password=wacs wacs < create_mysql
    [...]
    %
    
    To run this on Oracle 10g using the account created in the step above, you would do the following:
    % cd unpack_location/creation
    % sqlplus wacs/wacs @create_oracle
    SQL*Plus: Release 10.1.0.2.0 - Production on Fri Oct 6 19:11:41 2006
    Copyright (c) 1982, 2004, Oracle.  All rights reserved.
    
    Connected to:
    Oracle Database 10g Release 10.1.0.3.0 - 64bit Production
    
    WACS Database Table Creation Script for Oracle
    
    Commencing Table Creation:
    
      1. Photographer
    
    
    Table created.
    
      2. Vendor
    
    
    Table created.
    
      3. Sets
    
    
    Table created.
    
      4. Models
    
    
    Table created.
    
      5. Assoc
    
    
    Table created.
    
      6. Idmap
    
    
    Table created.
    
      7. Download
    
    
    Table created.
    
      8. Tag
    
    
    Table created.
    
      9. Conn
    
    
    Table created.
    
     10. Keyword
    
    
    Table created.
    
     11. User
    
    
    Table created.
    
     12. Attrib
    
    
    Table created.
    
     13. Notes
    
    
    Table created.
    
    Tables Created - Committing Changes
    
    
    Commit complete.
    
    Completed.
    
    Disconnected from Oracle Database 10g Release 10.1.0.3.0 - 64bit Production
    %
    

Support Scripts

  1. The penultimate major activity is to install the tools scripts, and if required the download and migrate tools, into a suitable directory, normally this would be /usr/local/bin, but it could be put within the wacs tree if desired. /usr/local/bin is usually in the default path for all the shells and thus available to user accounts without further work. To install, do:
    # cd unpack_location
    # cp -p tools/* /usr/local/bin
    # cp -p download/chkmodel /usr/local/bin
    # cp -p download/getarc /usr/local/bin
    # cp -p download/refresh /usr/local/bin
    # cp -p migrate/* /usr/local/bin
    #
    
    If you want to put it somewhere else, within the wacs home area would be fine, somewhere like /home/wacs/bin, but you will then need to add that directory to the path of your shell. For the C-shell, you would add set path=(/home/wacs/bin $path) into the .cshrc file in the home directory of your own account and those of other people who might be adding contents to the wacs server. For the Bourne style shells (sh,bash,etc), you would need to add PATH=/home/wacs/bin:$PATH and export PATH to the .profile or .bashrc files in the home directories. Once added, depending on the shell, you may need to type rehash to rescan the path for the new commands.

Populate The Initial Database

[Note]Note

In recent releases of Wacs we have suppressed the confirmatory Inserting Entries For... messages as they were playing havoc with the formatting on wacssetup. If you want to see them, simply edit the wacs.cfg debug section, look for the util_wacspop entry and set it to 1 or higher.

  1. The next step is to populate the vendor database with the sample records, which can be done with:
    # cd unpack_location/populate
    # ./wacspop vendors.xml
    Inserting Entries For Site: ATKP
    Inserting Entries For Site: AMK
    Inserting Entries For Site: ATE
    Inserting Entries For Site: SE
    #
    
    Please contribute back vendor descriptions you create to be included in the next release.
  2. Next we need to preload the keywords database table so that the automatic tagging will occur correctly. We do this with:
    # cd unpack_location/populate
    # ./wacspop keywords.xml
    [...]
    #
    
  3. Next we need to load the photographers database with some initial example records, which can be done with:
    # cd unpack_location/populate
    # ./wacspop photographers.xml
    [...]
    #
    
  4. Finally we need to load the attributes database with the basic attributes we will be using for searches and markup:
    # cd unpack_location/populate
    # ./wacspop attrib.xml
    [...]
    #
    

Initial User Creation for Database Authentication

If you're planning to use database authentication on your site, there's a catch 22 situation to get around first when you're doing a manual install. That is that although you can edit and create users using the wacsusermgr web application, you can't log in to the system in order to use the application until an initial account has been created. This is not so much of a problem with a normal root account install as this will initially be set up for host authentication which can be used to login that first time, create a user account and then switch over to the database authentication method. For a web site hosting provider where the host authentication method doesn't work, it's a lot more problematic. We now offer two solutions to this problem.

In WACS 0.9.1 we introduced a new users.xml file that sets up three accounts for you - root, support and guest . These give you an example of each of the possible types of user account - admin, power and viewer. This is ideal for testing and familiarisation activities but you really MUST remember to change these accounts from their default passwords before opening the server up to the internet. Their initial passwords are Svjck981 for the root account, uKiFt126 for the support and freebie for the guest account.

The other solution is to manually create the necessary user account using the SQL command line tool. Here is an example of how to do this:

# mysql -u wacs -p wacs
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 206917
Server version: 5.0.81-community MySQL Community Edition (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> insert into wacsuser 
     > (userid,username,upassword,ustatus,utype,uclass,uadded)
     > values(1,'wacs','badpasswd','A','A','admin','2012-11-11');
Query OK, 1 row affected (0.00 sec)

mysql> commit;
Query OK, 0 rows affected (0.00 sec)

mysql> quit;
Bye
#

Once you've created this account you will be able to log in to a database authenticating WACS system and create other users through the Web GUI.