To get the latest official release, go to the sourceforge project page and click on download. If the latest release is 0.7.3, then download wacs-0.7.3.tar.gz. Once downloaded, save it somewhere appropriate for unpacking - the installation will work without the archive, although there are sample configs and docuentation files which are not installed anywhere. If for instance you've decided to keep wacs in an "src/wacs" directory of your home directory and your web browser has placed the downloaded file on your Desktop, do:
% cd % mkdir -p src/wacs % cd src/wacs % tar -xzvf ~/Desktop/wacs-0.7.3.tar.gz x wacs-0.6.2/README [...] % cd wacs-0.7.3and from there follow one or other of the installation instructions below.
To get the very latest version from the sourceforge subversion repository, do the following:
% cd % mkdir -p src/wacs % cd src % svn co https://wacsip.svn.sourceforge.net/svnroot/wacsip/trunk wacs [...] % cd wacsand then follow the installation or upgrade instructions below as appropriate.
You do need to be aware that the MySQL network layer appears to be
extremely sensitive to what the host is called. It needs to have a
permanent, static name which is correctly mapped in the hosts or DNS
so that hostname maps to ip address and the ip
address maps back to THE SAME hostname. If this isn't the
case, the final part of the installation - creating the database schemas
and populating them - may well not work.
Easy Install
EasyInstall should be just that, but probably won't be. An installer is
a complex thing and depends heavily on the environment around it.
If you're running Fedora Core 5, Fedora Core 6, Fedora 7, Fedora 8 or
Ubuntu Feisty Fawn (7.04)
and accept all the defaults, there is a
reasonable chance it'll work. If you're running an older release with
either MySQL < 5.0 or Apache < 2.2, you may well have problems...
On other RPM-based distributions with the yum updater (SuSE, CENTOS, RHEL)
you're in with a chance of it working, or at the very least installing
most of the necessary infrastructure for you.
Other non-RPM based distributions will almost certainly fail (apart from Ubuntu which should work), but if you feed back the error messages, we'll have a go at fixing it. If using an apt-get based distribution, modifying the places where it checks for "Ubuntu" to whatever your distribution returns when you do an lsb_release -sir may well help.
To run easyinstall, become the super user (root) and issue the following commands:
# cd unpack_location/install # ./easyinstalland follow the onscreen prompts. Packages invoked by this script will include your package manager (yum, apt-get, etc) and the perl CPAN installer. At the end of the package configuration questions, you will be shown your answers and asked for comfirmation; if you answer n for no, you'll be asked the questions again. After that, once the installation phase starts, if you make a mistake in answering a question press <CTRL>-C to abort and start again. Between all the package managers and installers, you may well have to answer a couple of dozen questions in all.
Once you've done that you will need to add some model details and
content to the server. There's a step-by-step guide on how to do this
in the next section, getting started,
and a more detailed
discussion of the addmodel, addassoc and generate
commands used for this in the page on console
tools.
Manual Install
Obviously this is a big task, and there will hopefully be better documentation
in due course, but here is the basic bones of what needs to be done.
# cd unpack_location # mkdir /var/www/html/wacs # cp -rp htmlbones/* /var/www/html/wacs #
# cpan install XML::Simple # cpan install Data::Dumper # cpan install File::Basename # cpan install Authen::SimplePam #
# cd unpack_location # cp modules/wacs.pm /usr/lib/perl5/site_perl/5.8.8/Wacs.pm # cp modules/wacsid.pm /usr/lib/perl5/site_perl/5.8.8/WacsId.pm #
# cp unpack_location/security/wacs.pam /etc/pam.d/wacs # chown root.root /etc/pam.d/wacs # chmod 644 /etc/pam.d/wacs # chgrp apache /etc/shadow # chmod g+r /etc/shadow # mkdir /var/run/wacs # chown apache.apache /var/run/wacs #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/* #
# cd unpack_location # cp index/wacs* models/wacs* presentation/wacs* /var/www/cgi-bin/ # cp retrieval/wacs* search/wacs* tag/wacs* /var/www/cgi-bin/ # cp security/wacs* manage/wacs* /var/www/cgi-bin/ # chmod 755 /var/www/cgi-bin/wacs* #
# cd /var/www/cgi-bin # cp wacsmodelpage wacsmpthumbs # editor wacsmpthumbs # cp wacsimgcats wacsvidcats # editor wacsvidcats # cp wacsimgcats wacsphotcats # editor wacsphotcats # cp wacsimglist wacsvidlist # editor wacsvidlist # cp wacsnewsets wacsnewvideo # editor wacsnewvideo #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 /var/www/cgi-bin # chmod 755 wacs*
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 ProductionOf 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.
To run this on MySQL 5.1 using the account created in the step above, you would do the following:
% 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. Tables Created - Committing Changes Commit complete. Completed. Disconnected from Oracle Database 10g Release 10.1.0.3.0 - 64bit Production %
# cd unpack_location # cp -p tools/* /usr/local/bin # cp -p download/* /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.
# cd unpack_location/populate # ./vendpop 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.
# cd unpack_location/populate # ./keywordpop keywords.xml [...] #
# cd unpack_location/populate # ./photpop photographers.xml [...] #
# cd unpack_location/install # ./upgrade WACS - Upgrade -------------- [...] Do you wish to continue? (y/n): y [...] #
[...] mrace varchar2(15), [...]
You have three options for adding this to the database - you can choose to alter the existing schema (may leave fields in an odd order in describe); you can rename the existing table, create the new one, copy the data across and then repoint any relational constraints to the new table; or you can export your entire database, create a fresh one and import the records back in (the tools for this are incomplete in 0.6.1 but just about usuable). The former is quick and easy if the database supports it but leaves the field list in an odd order; the middle one is more work but produces a fully "normal" schema in the end but requires serious black magic if your database understands relational constraints. The final one is *VERY* experimental at this point but will improve with time.
Here is a worked example that shows how to use the alter table syntax in Oracle's SQL*Plus command interpreter to add one field called mrace:
% sqlplus [...] Username: wacs Password: **** sqlplus> alter table models > add ( mrace varchar2(15) ); Table altered. sqlplus> commit; Commit complete. sqlplus> desc models [...] MRACE VARCHAR2(15) sqlplus> quit %
Another issue you need to be aware of is that the upgrade script will
not over-write any existing files in the wacs web document tree (by
default this is /var/www/html/wacs) because you may well have
tailored them and we wouldn't want to overwrite those. You may well
therefore need to look at what is in the htmlbones directory and copy
some of the new files across into your web tree, or merge the new html
into your modified version of the pages.
Troubleshooting
Obviously we hope the installation script will create a running installation
for you, but there will no doubt be occasions when it does not. Before
seeking help via the mailing lists and other resources on the
sourceforge site, there are
some things you should clarify. The first of these is to confirm what the
status of the various subsystems are. Here's a quick check list:
% sestatus SELinux status: enabled SELinuxfs mount: /selinux Current mode: permissive Mode from config file: permissive Policy version: 20 Policy from config file: targeted %If it's either disabled, or is enabled but with a current mode of permissive, it's not actualling going to be causing us a problem right now. If it is enabled and enforcing, we've got to work on it. The web server process needs a security context of httpd_sys_content_t to be present on any directory it needs to access, so the first step is to add this context to each directory (outside of the normal ones) that it is likely to access. This is done with the chcon commands shown above in the manual install section - example:
# chcon system_u:object_r:httpd_sys_content_t /var/run/wacs #In addition to the directory gaining the httpd_sys_content_t security context, any pre-existing files will also need the same, so this can be done with:
# chcon -R system_u:object_r:httpd_sys_content_t /var/run/wacs/* #To inspect the security context of a file or directory, you use the -Z option to the ls command:
# ls -Z /var/run/wacs/ -rw-r--r-- apache apache system_u:object_r:httpd_var_run_t leases.acl #While the easyinstall script does try to set these for all the areas the web server might go (/var/run/wacs, /etc/wacs.d and the files area /home/wacs/*), any problems which are causing avc_denied messages in the dmesg output are most likely down to this issue.