Advertising sustains the DA. Ads are hidden for members. Join today

Installation guide

Last updated on
30 April 2025
Contents

Introduction

The installation process of the XC Drupal Toolkit has multiple steps:

  • 1. preparing Drupal
  • 2. installing Drupal
  • 3. installing the XC Drupal Toolkit modules
  • 4. setup the Toolkit

If you already has a Drupal, you can skip 1. and 2. If you don't have Drupal, you should install one. This documentation write it down how to do it manually, but we created two things, to make your life easier: a linux shell script, which does step 1. (see Automatic installation section), and an installation profile (http://drupal.org/project/xc_installation), which does step 2. and 3.

For a general, and quite extended description of how Drupal should be install to support Solr, please consult our INSTALL.txt file.

Hardware requirements

I am not a hardware person. We have a good experience with a 2.4 GHz Core2Duo processor 4 GB RAM machine. In terms of operating system I'd like to suggest to choose a 64 bit version, which - according to our experience - provides a drastical improvement. I PHP 5.3 has a better performance than 5.2. We haven't had chance to try it, but theoretically using an SSD (solid-state drive)instead of HDD would improve the performance as well.

The most problematic part is the disk space allocated by Drupal Toolkit.

In our internal demo site we are working with 2.6+ MARC records. It required the following disk spaces here and there:

  • we make use the option of postoned insert into MySQL, which means, that first it creates CSV files (into Drupal's sites/default/files/oaiharvester directory), then the Toolkit utilizes the 'LOAD DATA INFILE' syntax to import the records into MySQL. The total size of these files are 12 GB (but these files can be deleted after the process, and the site administrator can clear the cache from the UI). You might choose the direct insert method, which inject records into MySQL on-the-fly, and does not create these files. The negative effect side of this approach, that this method is much slower.
  • the total size of MySQL database is 14 GB.
  • the total size of optimized Solr index is 15 GB. During the optimization process Solr temporary doubles this size.
  • you might choose the option to cache the MST responses (it could be useful, if you would like to try different options, but to harvest the OAI data provider server takes long time because of the internet connection speed). In our case this would be 12+ GB.

The total allocated disk space during the process of harvesting/indexing is about 60 GB (but as I mentioned it might be a larger or smaller number according to your settings - we use the default settings). Though for the service it requires only 29 GB.

If you have more disks or partitions (a smaller and a bigger one, as it is the case in many servers) I would like to suggest to install Apache Solr entirely into the bigger disk. Please check whether the actual MySQL data directory has enough space. If not, you have to consider to move the MySQL data directory to the bigger disk. Brandon Gant suggested the following article whcih describes the details of this process: http://www.ubuntugeek.com/how-to-change-the-mysql-data-default-directory.... It is also good practice to move Drupal's site/default/files directory to the big disk, and make a soft link inside Drupal which points to this new location, like

cd /var/www/drupal
mv sites/default/files /bigdisk/drupal_files
ln -s /bigdisk/drupal_files sites/default/files

We can suggest to use SSD disk for Solr index or a HDD with SSD cache. SSD and quicker HDD (higher RPM number) improves the speed of reading, which is an important factor in accessing the index.

Installing with profile

The eXtensible Catalog installation profile helps you to set up everything you need to immediatelly start harvesting. It contains those settings needed for XC public demo site. You might want to adjust these settings according to your institution's needs, which can be done after installation. If you want to give a chance of trying our software, the easiest way is to use this method.

  1. download the installation profile from http://drupal.org/project/xc_installation
  2. create directory [drupal root]/profiles/xc
  3. copy xc.profile to [drupal root]/profiles/xc
  4. do everything according to the Drupal installation documents up to the point of start installation (steps 1-3. of http://drupal.org/node/628292)
  5. the XC modules use other contributed modules if they are available. These modules are:

    Before starting harvester you should download and install these modules. To do this repeat these steps for all modules:

    1. go to the project page of the module (we provided the URLs in the previous listing)
    2. go to Downloads section, and from the "Recommended relases" choose the latest 6.x version
    3. download it into your [drupal root]/sites/all/modules
    4. extract it with tar xvzf [module][version].tar.gz

    Of course, please do not forget about downloading and extract the xc module itself.

  6. Follow the Step 4: Install of http://drupal.org/node/628292, but in the first screen choose eXtensible Catalog profile instead of the default Drupal profile

The procedure requires lots of mechanical manual steps up to Step 4. To make it easy, we created a linux shell script. See this document's Automatic installation section.

Manual installation of XC modules

The eXtensible Catalog Drupal Toolkit consists of many modules, which have a complex interdependent structure. All these modules are packaged into the main module, so you need to download only one file (http://drupal.org/project/xc). We suggest you to install the modules in this order:

  1. XC Core (xc)
  2. XC Utility (xc_util)
  3. XC Metadata (xc_metadata)
  4. XC SQL Database Storage (xc_sql)
  5. XC Schema (xc_schema)
  6. NCIP Integration (ncip)
  7. NCIP Toolkit (xc_ncip_provider)
  8. OAI Harvester (oaiharvester)
  9. XC OAI Harvester Bridge (xc_oaiharvester_bridge)
  10. XC external services framework API (xc_external)
  11. Syndetics Solution (syndetics)
  12. XC Account (xc_account)
  13. XC Authentication (xc_auth)
  14. ILS (xc_ils)
  15. OAI DC Schema (xc_oai_dc)
  16. XC Solr (xc_solr)
  17. XC Index (xc_index)
  18. XC Search (xc_search)
  19. XC Browse (xc_browse)
  20. EZProxy URL rewrite (ezproxy_url_rewrite)
  21. XC Statistics (xc_statistics)

To install a module, go to Administer > Site building > Modules (admin/build/modules), and check the modules you would like to install, and click on Save configuration button.

Installing Apache Solr

Apache Solr is a powerful powerful full-text and faceted search server with a list of features, such as highlighting, caching, replication, and a web administration interface.

More information about Solr can be found at: http://lucene.apache.org/solr/

Solr is a Java application that runs within a servlet container, such as Apache Tomcat or Jetty. For this reason, there are many ways to install and configure Solr.

From now on, [solr] will be used to substitute the directory or path where Apache Solr is installed.

The easiest and fastest way to get Solr up and running is to simply download the application and run it with the embedded version of Jetty:

  1. Follow the Solr tutorial instructions at: http://lucene.apache.org/solr/tutorial.html
  2. Navigate to the Solr administration page in a web browser to verify that the server is running at: http://localhost:8983/solr/admin
  3. Take note of the port number (8983) and the Solr directory (solr)

Now you should shut down Solr, and copy the XC Drupal Toolkit specific configuration files.

  1. shut down Solr
  2. create a backup from Solr's configuration files: "schema.xml" and "solrconfig.xml". These files can be found in solr/conf directory.
  3. within the module's "xc_solr" directory (for the XC Solr module), there is a directory named "resources", which contains two configuration files to copy: "schema.xml" and "solrconfig.xml". Copy these files into Solr's solr/conf directory.
  4. If you use 3.x version of Apache Solr and keep ICUFoldingFilterFactory in the schema — which enables searching with or without accents —, create a "lib" directory under Solr home directory (the new directory will be apache-solr-xxx/example/solr/lib) or directories, if you use multicore setup (apache-solr-xxx/example/multicore/core1/lib, apache-solr-xxx/example/multicore/core2/lib etc. or apache-solr-xxx/example/multicore/lib if the apache-solr-xxx/example/multicore/solr.xml contains a sharedLib attribute of the <solr> element like in <solr persistent="false" sharedLib="lib">) with the following files (in parens we mentioned the directory in which the file originally located relative to the downloadable Apache Solr package):
    • apache-solr-analysis-extras-3.1.0.jar (in apache-solr-xxx/dist)
    • icu4j-xxx.jar (in apache-solr-xxx/contrib/analysis-extras/lib)
    • lucene-icu-3.1.0.jar (in apache-solr-xxx/contrib/analysis-extras/lucene-libs)
  5. start Solr

In the module's INSTALL.txt you can find a more detailed description about how to run and setup Solr.

We would like to call your attention, that you don't need to follow these rules, if you choose the Automatic installation.

Automatic installation

Here is a script, which might help you to install the Drupal Toolkit from scratch. This is a linux script, and requires Git and wget command line tools. Before running the script make sure, that you have this two tools are installed.

$ wget

If you have wget, it will write down some usage instructions. If you don't have it, you will receive an error message, and even instructions how to install in your environment.

$ git

If you have Git, it will write down some usage instructions. If you don't have it, you will receive an error message, and even instructions how to install in your environment. You can find more information at Git's home page at http://git-scm.com/.

The script will download the Drupal core, the necessary modules, installation profile and theme, and sets the permissions. It also download, extracts and start Apache Solr, with the configuration files customized for XC Drupal Toolkit.

To run the script type in the command line:

$ sudo sh xc_install.sh <command>

where the command could be:

all
prepare Drupal and Apache Solr files for XC
createdb
create database for Drupal
droptables
drop all tables from Drupal database
solr_start
start Apache Solr
solr_stop
stop Apache Solr

After running the "all" command, you will have a Drupal prepared for installation. Then open http://localhost/xc-1.0rc-test in web browser, and select "eXtensible Catalog Drupal Toolkit demo site" installation profile. Don't forget, that in the script the default MySQL database username and password is xc10rctest. The default root Drupal user in the installation profile is admin, and his password is xc. Do not use these values in production environment.

And finally, here is the shell script (you can download the actual version from the repository: http://drupalcode.org/project/xc_installation.git/blob_plain/refs/heads/...):

#!/bin/sh
#set -x
#
# Downloads and prepares all components needed for eXtensible Catalog Drupal Toolkit
# demo site
#

DRUPAL_VERSION=6.22
CURRENT_DIR=`pwd`

get_web_directory() {
  echo -n 'What is the Apache HTTP server web directory? (/var/www): '
  read WWW_DIR
  
  if [ "$WWW_DIR" = "" ]; then
    WWW_DIR=/var/www
  fi
}

get_drupal_name() {
  echo -n 'What will be the directory name of your new Drupal? (xc-1.0rc-test): '
  read DRUPAL_NAME

  if [ "$DRUPAL_NAME" = "" ]; then
    DRUPAL_NAME=xc-1.0rc-test
  fi
}

get_solr_parent_dir() {
  echo -n 'In which directory to put Apache Solr? ('$HOME'/solr): '
  read SOLR_PARENT_DIR
  
  if [ "$SOLR_PARENT_DIR" = "" ]; then
    SOLR_PARENT_DIR=$HOME/solr
  fi
}

get_solr_version() {
  echo -n 'Select Apache Solr version ([1] = 1.4.1, [2] = 3.1.0, [3] = 3.2.0, [4] = 3.3.0): '
  read number
  
  SOLR_VERSION=3.3.0
  case "$number" in
    '1') SOLR_VERSION=1.4.1;;
    '2') SOLR_VERSION=3.1.0;;
    '3') SOLR_VERSION=3.2.0;;
    '4') SOLR_VERSION=3.3.0;;
  esac
}

get_download_directory() {
  echo -n 'The directory where the script will download the necessay applications ('$HOME'/download/xc-1.0rc-test): '
  read DOWNLOAD_DIR
  
  if [ "$DOWNLOAD_DIR" = "" ]; then
    DOWNLOAD_DIR=$HOME/download/xc-1.0rc-test
  fi
}

get_mysql_settings() {
  echo -n 'The name of MySQL database for the new Drupal: (xc10rctest) '
  read DRUPAL_DB_NAME
  if [ "$DRUPAL_DB_NAME" = "" ]; then
    DRUPAL_DB_NAME=xc10rctest
  fi
  
  echo -n 'A MySQL user name for the Drupal database: (xc10rcuser) '
  read DRUPAL_DB_USER
  if [ "$DRUPAL_DB_USER" = "" ]; then
    DRUPAL_DB_USER=xc10rcuser
  fi

  echo -n 'The password of MySQL user for the Drupal database: (xc10rcpass) '
  read DRUPAL_DB_PASS
  if [ "$DRUPAL_DB_PASS" = "" ]; then
    DRUPAL_DB_PASS=xc10rcpass
  fi
  
  echo -n 'The admin user of MySQL: '
  stty -echo
  read MYSQL_USER
  stty echo
  echo ''
  if [ "$MYSQL_USER" = "" ]; then
    echo 'Please enter the admin user name'
    exit 1
  fi

  echo -n 'The password of MySQL admin: '
  stty -echo
  read MYSQL_PASS
  stty echo
  echo ''
  if [ "$MYSQL_PASS" = "" ]; then
    echo 'Please enter the admin password'
    exit 1
  fi
}

read_variables() {
  echo 'Please answer the following questions:'
  echo ''
  get_web_directory
  get_drupal_name
  get_solr_parent_dir
  get_solr_version
  get_download_directory
  get_mysql_settings
}

set_variables() {
  WWW_DIR=/var/www
  DRUPAL_NAME=xc-1.0rc-test
  SOLR_PARENT_DIR=$HOME/solr
  SOLR_VERSION=3.1.0
  DOWNLOAD_DIR=$HOME/download/xc-1.0rc-test
  DRUPAL_DB_NAME=xc10rctest
  DRUPAL_DB_USER=xc10rcuser
  DRUPAL_DB_PASS=xc10rcpass
  MYSQL_USER=
  MYSQL_PASS=
}

flush() {
  echo 'Your settings'
  echo ''
  echo 'Web root directory:' $WWW_DIR
  echo 'Drupal name:' $DRUPAL_NAME
  echo 'Solr parent directory:' $SOLR_PARENT_DIR
  echo 'Solr version:' $SOLR_VERSION
  echo 'Download directory:' $DOWNLOAD_DIR
  
  echo 'The name of MySQL database for the new Drupal:' $DRUPAL_DB_NAME
  echo 'The MySQL username for the Drupal database:' $DRUPAL_DB_USER
  echo 'The password of MySQL user for the Drupal database:' $DRUPAL_DB_PASS
}


droptables() {
  # this hack is from http://www.thingy-ma-jig.co.uk/blog/10-10-2006/mysql-drop-all-tables
  mysqldump -u $MYSQL_USER -p$MYSQL_PASS --add-drop-table --no-data $DRUPAL_DB_NAME | grep ^DROP | mysql -u $MYSQL_USER -p$MYSQL_PASS $DRUPAL_DB_NAME
}

createdb() {
  echo "check whether the database exists"
  db_exists=`mysql -u $MYSQL_USER -p$MYSQL_PASS -e "SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = '$DRUPAL_DB_NAME'" | wc -c`
  if [ $db_exists = 0 ]; then
    echo "** create Drupal database $DRUPAL_DB_NAME..."
    mysqladmin -u $MYSQL_USER -p$MYSQL_PASS create $DRUPAL_DB_NAME
  else
    echo "** Drupal database $DRUPAL_DB_NAME exists, drop tables..."
    echo -n 'Are you sure, that you want to drop tables? (y/n) '
    read do_drop
    if [ $do_drop = y ]; then
      droptables
    else
      echo 'The script does not drop tables'
    fi
  fi

  create_user=0
  echo "check whether the database user exists and has privilege"
  user_exists=`mysql -u $MYSQL_USER -p$MYSQL_PASS -e "SELECT user FROM mysql.user WHERE user = '$DRUPAL_DB_USER'" | wc -c`
  if [ $user_exists = 0 ]; then
    create_user=1
  else
    user_has_privilage=`mysql -u $MYSQL_USER -p$MYSQL_PASS -e "SELECT User FROM mysql.db WHERE db = '$DRUPAL_DB_NAME' AND user = '$DRUPAL_DB_USER'" | wc -c`
    if [ $user_has_privilage = 0 ]; then
      create_user=1
    fi
  fi
  
  if [ $create_user = 1 ]; then
    echo "** create MySQL user $DRUPAL_DB_USER..."
    mysql -u $MYSQL_USER -p$MYSQL_PASS -e "GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, LOCK TABLES, CREATE TEMPORARY TABLES ON $DRUPAL_DB_NAME.* TO '$DRUPAL_DB_USER'@'localhost' IDENTIFIED BY '$DRUPAL_DB_PASS';FLUSH PRIVILEGES;" $DRUPAL_DB_NAME
  else
    echo 'The user already exists and has appropriate privilege'
  fi
}

# download and extract Drupal and setup filesystem
drupal_download() {
  if [ ! -e $DOWNLOAD_DIR ]; then
    mkdir -p $DOWNLOAD_DIR
  fi
  cd $DOWNLOAD_DIR

  # get actual Drupal
  # wget http://drupal.org/files/projects/drupal-6.19.tar.gz
  if [ ! -e drupal-$DRUPAL_VERSION.tar.gz ]; then
    echo "** downloading Drupal... $DRUPAL_VERSION"
    wget http://ftp.drupal.org/files/projects/drupal-$DRUPAL_VERSION.tar.gz
  fi

  if [ ! -d $WWW_DIR/$DRUPAL_NAME ]; then
    # uncompress
    echo '** extracting Drupal...'
    tar -zxf drupal-$DRUPAL_VERSION.tar.gz
    # move to the web directory
    mv drupal-$DRUPAL_VERSION $WWW_DIR/$DRUPAL_NAME
  fi
  cd $WWW_DIR/$DRUPAL_NAME

  echo '** prepare Drupal setting files...'
  if [ ! -e sites/default/settings.php ]; then
    cp sites/default/default.settings.php sites/default/settings.php
  fi
  chmod a+w sites/default/
  chmod a+w sites/default/settings.php
  cd sites/all
  if [ ! -d modules ]; then
    mkdir modules
  fi
  if [ ! -d themes ]; then
    mkdir themes
  fi

  cd $CURRENT_DIR
}

# download XC profile
drupal_profile() {
  # setup profile
  echo '** setup profile...'
  cd $WWW_DIR/$DRUPAL_NAME/profiles/
  if [ ! -d xc ]; then
    git clone --branch master http://git.drupal.org/project/xc_installation.git
    mv xc_installation xc
  fi
  cd $CURRENT_DIR
}

# download necessary modules to $DOWNLOAD_DIR
drupal_modules() {
  # prepare module and theme directories
  echo '** prepare module and theme directories...'
  if [ ! -e $DOWNLOAD_DIR ]; then
    mkdir $DOWNLOAD_DIR
  fi
  cd $DOWNLOAD_DIR

  if [ ! -d $WWW_DIR/$DRUPAL_NAME/sites/all/modules/admin_menu ]; then
    echo "** downloading admin_menu module..."
    $VERSION=6.x-1.8
    if [ ! -e admin_menu-$VERSION.tar.gz ]; then
      wget http://ftp.drupal.org/files/projects/admin_menu-$VERSION.tar.gz
    fi
    tar -zxf admin_menu-$VERSION.tar.gz
    mv admin_menu $WWW_DIR/$DRUPAL_NAME/sites/all/modules
  fi

  if [ ! -d $WWW_DIR/$DRUPAL_NAME/sites/all/modules/addthis ]; then
    echo "** downloading addthis module..."
    $VERSION=6.x-3.0-beta1
    if [ ! -e addthis-$VERSION.tar.gz ]; then
      wget http://ftp.drupal.org/files/projects/addthis-$VERSION.tar.gz
    fi
    tar -zxf addthis-$VERSION.tar.gz
    mv addthis $WWW_DIR/$DRUPAL_NAME/sites/all/modules
  fi

  if [ ! -d $WWW_DIR/$DRUPAL_NAME/sites/all/modules/lightbox2 ]; then
    echo '** downloading lightbox2 module...'
    $VERSION=6.x-1.11
    if [ ! -e lightbox2-$VERSION.tar.gz ]; then
      wget http://ftp.drupal.org/files/projects/lightbox2-$VERSION.tar.gz
    fi
    tar -zxf lightbox2-$VERSION.tar.gz
    mv lightbox2 $WWW_DIR/$DRUPAL_NAME/sites/all/modules
  fi

  if [ ! -d $WWW_DIR/$DRUPAL_NAME/sites/all/modules/print ]; then
    echo '** downloading print module...'
    $VERSION=6.x-1.12
    if [ ! -e print-$VERSION.tar.gz ]; then
      wget http://ftp.drupal.org/files/projects/print-$VERSION.tar.gz
    fi
    tar -zxf print-$VERSION.tar.gz
    mv print $WWW_DIR/$DRUPAL_NAME/sites/all/modules
  fi

  if [ ! -d $WWW_DIR/$DRUPAL_NAME/sites/all/modules/fieldset_helper ]; then
    echo '** downloading fieldset_helper module...'
    $VERSION=6.x-1.0
    if [ ! -e fieldset_helper-$VERSION.tar.gz ]; then
      wget http://ftp.drupal.org/files/projects/fieldset_helper-$VERSION.tar.gz
    fi
    tar -zxf fieldset_helper-$VERSION.tar.gz
    mv fieldset_helper $WWW_DIR/$DRUPAL_NAME/sites/all/modules
  fi

  if [ ! -d $WWW_DIR/$DRUPAL_NAME/sites/all/themes/xc_theme ]; then
    echo '** downloading theme xc_theme...'
    $VERSION=6.x-1.0-beta1
    if [ ! -e xc_theme-6.x-1.0-beta1.tar.gz ]; then
      #git clone --branch 6.x-2.x http://git.drupal.org/project/fieldset_helper.git
      wget http://ftp.drupal.org/files/projects/xc_theme-$VERSION.tar.gz
    fi
    tar -zxf xc_theme-$VERSION.tar.gz
    mv xc_theme $WWW_DIR/$DRUPAL_NAME/sites/all/themes
  fi

  if [ ! -d $WWW_DIR/$DRUPAL_NAME/sites/all/modules/xc ]; then
    cd $WWW_DIR/$DRUPAL_NAME/sites/all/modules
    echo '** downloading xc module...'
    git clone --branch 6.x-1.x http://git.drupal.org/project/xc.git
  fi

  cd $CURRENT_DIR
}

# download, extract and prepare Solr
solr_download() {
  if [ ! -e $DOWNLOAD_DIR ]; then
    mkdir $DOWNLOAD_DIR
  fi
  cd $DOWNLOAD_DIR
  
  echo '** checking Apache Solr...'
  if [ ! -e apache-solr-$SOLR_VERSION.tgz ]; then
    wget http://www.apache.org/dist/lucene/solr/$SOLR_VERSION/apache-solr-$SOLR_VERSION.tgz
  fi
  solr_instance=$SOLR_PARENT_DIR/apache-solr-$SOLR_VERSION/example

  echo '** extracting Solr...'
  if [ ! -e apache-solr-$SOLR_VERSION ]; then
    tar -zxf apache-solr-$SOLR_VERSION.tgz
    # SOLR_PARENT_DIR
    if [ ! -e $SOLR_PARENT_DIR ]; then
      mkdir $SOLR_PARENT_DIR
    fi
    cp -r apache-solr-$SOLR_VERSION $SOLR_PARENT_DIR/apache-solr-$SOLR_VERSION
    
    conf_dir=$solr_instance/solr/conf
    resources=$WWW_DIR/$DRUPAL_NAME/sites/all/modules/xc/xc_solr/resources
    
    # save original config files
    cp $WWW_DIR/$DRUPAL_NAME/sites/all/modules/xc/xc_solr/resources/solr.* $solr_instance
    if [ ! -e $conf_dir/solrconfig-orig.xml ]; then
      mv $conf_dir/solrconfig.xml $conf_dir/solrconfig-orig.xml
      mv $conf_dir/schema.xml $conf_dir/schema-orig.xml
    fi
    
    # copy Solr configuration file
    if [ -e $resources/solrconfig-for-$SOLR_VERSION.xml ]; then
      cp $resources/solrconfig-for-$SOLR_VERSION.xml $conf_dir/solrconfig.xml
    else 
      cp $resources/solrconfig.xml $conf_dir
    fi
    
    # copy Solr schema file
    if [ -e $resources/schema-for-$SOLR_VERSION.xml ]; then
      cp $resources/schema-for-$SOLR_VERSION.xml $conf_dir/schema.xml
    else 
      cp $resources/schema.xml $conf_dir
    fi
    
    # copy jar files
    SOLR_DIR=$SOLR_PARENT_DIR/apache-solr-$SOLR_VERSION
    mkdir $solr_instance/solr/lib
    SOLR_LIB=$solr_instance/solr/lib
    case "$SOLR_VERSION" in
      '1.4.0')
        ;;
      '3.1.0')
        cp $SOLR_DIR/dist/apache-solr-analysis-extras-$SOLR_VERSION.jar $SOLR_LIB
        cp $SOLR_DIR/contrib/analysis-extras/lib/icu4j-4_6.jar $SOLR_LIB
        cp $SOLR_DIR/contrib/analysis-extras/lucene-libs/lucene-icu-$SOLR_VERSION.jar $SOLR_LIB
        ;;
      '3.2.0')
        cp $SOLR_DIR/dist/apache-solr-analysis-extras-$SOLR_VERSION.jar $SOLR_LIB
        cp $SOLR_DIR/contrib/analysis-extras/lib/icu4j-4_6.jar $SOLR_LIB
        cp $SOLR_DIR/contrib/analysis-extras/lucene-libs/lucene-icu-$SOLR_VERSION.jar $SOLR_LIB
        ;;
      '3.3.0')
        cp $SOLR_DIR/dist/apache-solr-analysis-extras-$SOLR_VERSION.jar $SOLR_LIB
        cp $SOLR_DIR/contrib/analysis-extras/lib/icu4j-4_8.jar $SOLR_LIB
        cp $SOLR_DIR/contrib/analysis-extras/lucene-libs/lucene-icu-$SOLR_VERSION.jar $SOLR_LIB
        ;;
    esac
  fi
  cd $solr_instance
  chmod +x solr.s*
  cd $CURRENT_DIR
}

# start Solr
solr_start() {
  if [ "$SOLR_PARENT_DIR" = "" ]; then
    get_solr_parent_dir
    get_solr_version
  fi
  solr_instance=$SOLR_PARENT_DIR/apache-solr-$SOLR_VERSION/example

  echo '** Starting Solr...'
  cd $solr_instance
  ./solr.sh start
  cd $CURRENT_DIR
}

# stop Solr
solr_stop() {
  if [ "$SOLR_PARENT_DIR" = "" ]; then
    get_solr_parent_dir
    get_solr_version
  fi
  solr_instance=$SOLR_PARENT_DIR/apache-solr-$SOLR_VERSION/example

  echo '** Stoping Solr...'
  cd $solr_instance
  ./solr.sh stop
  cd $CURRENT_DIR
}

welcome() {
  echo 'Welcome to eXtensible Catalog Drupal Toolkit installation'
  echo ''
}

# all things together
all() {
  echo '**********************************'
  echo '** installing XC Drupal Toolkit **'
  echo '**********************************'
  welcome
  read_variables
  createdb
  drupal_download
  drupal_profile
  drupal_modules
  solr_download
  solr_start
  echo '*******************************************'
  echo '** installing XC Drupal Toolkit finished **'
  echo '*******************************************'
}

# all things together
drupal() {
  echo '**********************************'
  echo '** installing XC Drupal Toolkit **'
  echo '**********************************'
  welcome
  read_variables
  createdb
  drupal_download
  drupal_profile
  drupal_modules
  echo '*******************************************'
  echo '** installing XC Drupal Toolkit finished **'
  echo '*******************************************'
}

help() {
  welcome
#  echo "Usage: $0 {all|drupal|createdb|solr_start|solr_stop|solr_spellcheck|help}"
  echo "Usage: $0 {all|drupal|createdb|droptables|solr_start|solr_stop|help}"
  echo "  all - prepare Drupal and Apache Solr files for XC"
  echo "  drupal - prepare Drupal files for XC"
  echo "  createdb - create database for Drupal"
  echo "  droptables - drop all tables from Drupal database"
  echo "  solr_start - start Apache Solr"
  echo "  solr_stop - stop Apache Solr"
  echo "  help - this help info"
#  echo "  solr_spellcheck - create spellcheck index for Apache Solr"
  echo ""
  echo "If you just start, select the 'all' task. Please adjust the configuration section of this script."
}

case "$1" in
  createdb)
    createdb
    ;;
  all)
    all
    ;;
  drupal)
    drupal
    ;;
  solr_start)
    solr_start
    ;;
  solr_stop)
    solr_stop
    ;;
  droptables)
    droptables
    ;;
  help)
    help
    ;;
  *)
    help
esac

exit $?

Checking problems

The Drupal Toolkit has some usage prerequisits, such as DOM and cURL PHP libraries. To check whether your PHP installation meets this needs, please go to the Drupal Status report page (admin/reports/status), and check whether you have any notices or errors reported. You can find more information at the following pages: about enabling cURL at http://php.net/manual/en/curl.setup.php about enabling DOM at http://www.php.net/manual/en/dom.setup.php. On you PHP settings you can find information at the PHP info page (admin/reports/status/php).

One of our user, Michael Levy reported, that

CentOS comes with PHP 5.1.6, which does not include the XML functions.

This problem was fixed by running:
yum install php-xml

PHP 5.1 also lacks the JSON functions, which are required by the Apache Solr library. If you encounter this problem, please consult the following resources:

http://www.php.net/manual/en/json.setup.php
http://benlancaster.wordpress.com/2009/09/15/installing-php-json-centos-...

Solr under Tomcat

If you would like to use Solr under Tomcat, the Solr installation is somewhat different. Here are the steps in short:

  1. stop Tomcat
  2. Create a directory for the Solr home. Now we will use /home/solr/configuration. Copy the content from your downloaded Solr package's example/solr directory to this new directory. We call your attention to the lib directory inside example/solr. If you don't have that, follow the directions we gave above when we talked about ICUFoldingFilterFactory. The files in lib directory should be readable, otherwise Tomcat will not able to use them and will throw an exception, which makes impossible to use Solr.
  3. Create a file called solr.xml in Tomcat's conf/Catalina/localhost. This will be the context file for the Solr web application. The purpose of this file is to register the Solr home directory into Tomcat. The content of the file is
    <Context path="/solr" debug="0" privileged="true" allowLinking="true" crossContext="true">  
      <Environment name="solr/home" type="java.lang.String" value="/home/solr/configuration" override="true" />
    </Context>
    
  4. Copy the Solr package's example/webapps/solr.war into Tomcat's webapps directory.
  5. restart Tomcat

This documentation is not about the details of every posible Solr installation, so if this description would not provide enough details to start, please consult the following Solr wiki page: http://wiki.apache.org/solr/SolrTomcat, or other sources, like http://blog.ireneros.com/solr-tomcat-6-install-setup-guide, http://www.tc.umn.edu/~brams006/solr_ubuntu.html or http://justin-hayes.com/2009-04-08/installing-apache-tomcat-6-and-solr-n.... There are lots of ways to install Tomcat and Solr, if you would not find the solution for your situation, please send us a message, and we will help you.

Help improve this page

Page status: Not set

You can: