Developers > Installation and Setup > Plug-in Installation Guide

Plug-in Installation Guide

Plug-ins are distributed and installed separately from the base ExSite system. There are two methods for installing plug-ins into a website.

Method 1: Makefile

The Makefile that is distributed with the base distribution (in the install directory) can be used to install plug-ins.  The configuration section of the Makefile must be edited to reflect your local setup.  Once that is done, put a copy of the Makefile in your cgi-bin directory.  Then the following commands will work:
make PLUGIN
where "PLUGIN" is the name of the plug-in you want to install.  For example:
make PhotoAlbum
To install multiple plug-ins at once, simply give all their names to make:
make PLUGIN1 PLUGIN2 PLUGIN3
Note that these commands install the basic website files, but do not reconfigure the database.  For that, see below.

Method 2: Manual Installation

Each plug-in is distributed in a directory with the following contents:

README  
brief description of the plug-in module
html/*static files such as images, stylesheets, JS scripts
cgi/*
plug-in code and configuration files

If your plug-in repository is $BASE, and the plug-in subdirectory is $BASE/Plugin, then change to your website's cgi-bin directory, and execute the following commands:
cp -r $BASE/Plugin/cgi/Modules/* Modules
mkdir dbmap/Plugin
cp -r $BASE/Plugin/cgi/dbmap/* dbmap/Plugin
cp -r $BASE/Plugin/cgi/conf/Plugin.conf conf
If you want to keep the original files in the repository and symlink to them instead, use the following commands:
ln -s $BASE/Plugin/cgi/Modules/* Modules
mkdir dbmap/Plugin
ln -s $BASE/Plugin/cgi/dbmap/* dbmap/Plugin
cp -r $BASE/Plugin/cgi/conf/Plugin.conf conf
(The symlink method makes it easier to upgrade your plugins by replacing the whole plug-in repository at once. It also makes it easier to share plug-ins on a server with multiple web sites.)

You should also change to your website's base htdocs directory, and execute the following commands:
mkdir _Modules/Plugin
cp -r $BASE/Plugin/html/* _Modules/Plugin/
(You can change the cp -r to ln -s if you prefer the symlink method.)

Database Configuration

If your plugin has files in its cgi/dbmap directory, then it modifies the database, and there is an extra setup step to complete the installation.  Starting from your cgi-bin directory, execute the following command:
$BIN/makesql.pl > make.sql
where $BIN is the location of the bin directory in your ExSite base distribution.  This will create a script, make.sql, which sets up your database tables.  (This script will include your old tables plus the new ones that the plug-in requires.  However, the old tables will not be affected if you run this script.)  To run the script, type:
mysql -u root -p your_db < make.sql
(you will need to enter the mysql password.)  Change "your_db" in the above command to your  database name.  If you have a personal mysql account to do this work, you should also change "root" to your account name.

Note: it is always wise to make a backup of your database before doing any work that reconfigures it:
mysqldump -u root -p your_db > db-backup.sql


Topics