About Features Downloads Getting Started Documentation Events Support GitHub

Love VuFind®? Consider becoming a financial supporter. Your support helps build a better VuFind®!

Site Tools


Warning: This page has not been updated in over over a year and may be outdated or deprecated.
installation:installing_multiple_instances

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
installation:installing_multiple_instances [2019/09/06 10:22] demiankatzinstallation:installing_multiple_instances [2023/11/28 20:25] (current) – [Apache Configuration for Directory-Based Multisite] demiankatz
Line 1: Line 1:
 ====== Installing Multiple Instances ====== ====== Installing Multiple Instances ======
  
-There are a few reasons you might want to have several instances of VuFind.  Two real-life examples:+There are a few reasons you might want to have several instances of VuFind®.  Two real-life examples:
  
   * You need to present the same index in slightly different ways at different URLs (i.e. filter differently or offer different themes for members of a consortium)   * You need to present the same index in slightly different ways at different URLs (i.e. filter differently or offer different themes for members of a consortium)
-  * You use VuFind as the basis for several distinct, separate systems running on the same server (i.e. a bibliography project distinct from your library catalog)+  * You use VuFind® as the basis for several distinct, separate systems running on the same server (i.e. a bibliography project distinct from your library catalog)
  
-Regardless of your use case, you probably do not need to actually install multiple copies of VuFind.  VuFind 2's flexible configuration options allow you to create multiple configurations for a single instance.+Regardless of your use case, you probably do not need to actually install multiple copies of VuFind®.  VuFind®'s flexible configuration options allow you to create multiple configurations for a single instance.
  
  
Line 36: Line 36:
  
 Note:  Note: 
-  * If you have already installed a copy of VuFind in single site mode, you need to reconfigure it by re-running install.php with the --multisite switch in order to generate a multisite-capable Apache configuration. The "--multisite" switch is important, as this allows your Apache configuration to properly handle multiple sites. **Configuration files from non-multisite VuFind instances can interfere with the functioning of subsequent multisite configurations -- be sure they are updated or removed in order to avoid problems when switching to multi-site mode.** +  * If you have already installed a copy of VuFind® in single site mode, you need to reconfigure it by re-running install.php with the --multisite switch in order to generate a multisite-capable Apache configuration. The "--multisite" switch is important, as this allows your Apache configuration to properly handle multiple sites. **Configuration files from non-multisite VuFind® instances can interfere with the functioning of subsequent multisite configurations -- be sure they are updated or removed in order to avoid problems when switching to multi-site mode.** 
-  * Windows users should be aware that running install.php creates a new "vufind.bat" file every time.  This vufind.bat file is used to set up the environment variables for other VuFind-related scripts like import-marc.bat.  If you are using custom import rules, this can affect where SolrMarc looks for your settings.  Be sure to adjust vufind.bat as needed to ensure correct importing.+  * Windows users should be aware that running install.php creates a new "vufind.bat" file every time.  This vufind.bat file is used to set up the environment variables for other VuFind®-related scripts like import-marc.bat.  If you are using custom import rules, this can affect where SolrMarc looks for your settings.  Be sure to adjust vufind.bat as needed to ensure correct importing.
  
 ===== 2 Configure Apache ===== ===== 2 Configure Apache =====
 ==== Apache Configuration for Directory-Based Multisite ==== ==== Apache Configuration for Directory-Based Multisite ====
  
-// This workaround is required for **VuFind 2.5 and earlier**. Later releases use <Location> sections instead of RewriteBase directives, which eliminates the need for unique symlinks for different instances. You can skip this section for those newer versions. //+// :!: This workaround is required for **VuFind® 2.5 and earlier**. Later releases use <Location> sections instead of RewriteBase directives, which eliminates the need for unique symlinks for different instances. You can skip this section for those newer versions. //
  
-Due to the way VuFind's current default configuration uses the RewriteBase directive, having multiple VuFind configurations that all point to the same directory in their <Directory> sections prevents multisite VuFind instances from loading correctly. The following creates a symbolic link to the public directory for each instance of vufind. //(In recent versions of Windows, "mklink /D" is equivalent to the Linux "ln -s" command)//+Due to the way VuFind®'s current default configuration uses the RewriteBase directive, having multiple VuFind® configurations that all point to the same directory in their <Directory> sections prevents multisite VuFind® instances from loading correctly. The following creates a symbolic link to the public directory for each instance of vufind. //(In recent versions of Windows, "mklink /D" is equivalent to the Linux "ln -s" command)//
  
   - Create a symbolic link to the 'public' directory e.g. <code> ln -s $VUFIND_HOME/public $VUFIND_HOME/public-springfield </code>   - Create a symbolic link to the 'public' directory e.g. <code> ln -s $VUFIND_HOME/public $VUFIND_HOME/public-springfield </code>
Line 53: Line 53:
 ==== Apache Configuration for Host-Based Multisite ==== ==== Apache Configuration for Host-Based Multisite ====
  
-If you are pointing multiple hostnames at a single server and using these to distinguish between VuFind instances, you can't simply link up the httpd-vufind.conf configurations generated by install.php.  Instead, you also need to set up virtual hosts.  Here is an example virtual host configuration for Apache, assuming hostnames of test1 and test2 and local settings directories of ms1 and ms2:+If you are pointing multiple hostnames at a single server and using these to distinguish between VuFind® instances, you can't simply link up the httpd-vufind.conf configurations generated by install.php.  Instead, you also need to set up virtual hosts.  Here is an example virtual host configuration for Apache, assuming hostnames of test1 and test2 and local settings directories of ms1 and ms2:
  
 <code> <code>
Line 84: Line 84:
  
 ===== 4 Set up a new Solr Core - if required ===== ===== 4 Set up a new Solr Core - if required =====
-Solr Cores hold the searchable records within VuFind. Follow these steps if you want this instance to search different records to other instances of vufind on your system. +Solr Cores hold the searchable records within VuFind®. Follow these steps if you want this instance to search different records to other instances of vufind on your system. 
  
 The most common setup, outlined here is an additional core on the existing Solr instance, though there are other options, see further down this page. The most common setup, outlined here is an additional core on the existing Solr instance, though there are other options, see further down this page.
  
   * Shut down Solr (see [[administration:starting_and_stopping_solr#stopping_solr_manually|stopping Solr manually]])   * Shut down Solr (see [[administration:starting_and_stopping_solr#stopping_solr_manually|stopping Solr manually]])
-  * Copy the existing core (usually biblio) under VuFind's solr directory to a new directory of your choice. e.g. <code>+  * Copy the existing core (usually biblio) under VuFind®'s solr directory to a new directory of your choice. e.g. <code>
 cd $VUFIND_HOME/solr cd $VUFIND_HOME/solr
 cp -pr biblio springfield cp -pr biblio springfield
 </code> </code>
   * If you don't want your new core to contain the records of the core you just copied from (e.g. biblio), go in to the new directory and delete (or move if you are cautious) the index folder <code>cd springfield; rm -r index</code>   * If you don't want your new core to contain the records of the core you just copied from (e.g. biblio), go in to the new directory and delete (or move if you are cautious) the index folder <code>cd springfield; rm -r index</code>
-  * If you are using an old version of VuFind (pre-3.0) you may have to edit solr/solr.xml to make the new core active (<nowiki><core name="springfield" instanceDir="springfield"/></nowiki>); newer versions will load the core automatically. +  * If you are using an old version of VuFind® (pre-3.0) you may have to edit solr/solr.xml to make the new core active (<nowiki><core name="springfield" instanceDir="springfield"/></nowiki>); newer versions will load the core automatically. 
   * Edit conf/solrconfig.xml (in the new core directory) to adjust incorrect paths. If you have copied the biblo folder, use your text editor to search for 'biblio' and replace all occurrences (there should be one or two).   * Edit conf/solrconfig.xml (in the new core directory) to adjust incorrect paths. If you have copied the biblo folder, use your text editor to search for 'biblio' and replace all occurrences (there should be one or two).
   * edit $VUFIND_HOME/<instance_name>/config/vufind/config.ini, change the default_core setting under [index] to use the new core. E.g.:   default_core    = springfield   * edit $VUFIND_HOME/<instance_name>/config/vufind/config.ini, change the default_core setting under [index] to use the new core. E.g.:   default_core    = springfield
Line 104: Line 104:
 ==== Basic Configuration ==== ==== Basic Configuration ====
  
-If your new instance is configured almost exactly like your previous instance but with a few minor modifications, consider using the [Parent_Config] section of config.ini to inherit settings from a shared base configuration.  This will make maintenance easier over time.  The [Parent_Config] section is supported by all of VuFind's .ini files, so you can use this technique on any files that need to be customized.+If your new instance is configured almost exactly like your previous instance but with a few minor modifications, consider using the [Parent_Config] section of config.ini to inherit settings from a shared base configuration.  This will make maintenance easier over time.  The [Parent_Config] section is supported by all of VuFind®'s .ini files, so you can use this technique on any files that need to be customized.
  
 ==== Custom Code ==== ==== Custom Code ====
Line 112: Line 112:
 ==== Custom Theme ==== ==== Custom Theme ====
  
-VuFind's theme is determined by [[configuration:files:config.ini]] settings.  Since each instance of VuFind has its own [[configuration:files:config.ini]] in its [[configuration:local_settings_directory|local settings directory]], you can easily configure separate themes for separate instances.  Since themes can inherit from one another, it is possible to create a base theme for shared customizations and isolate minor, distinctive changes to very small, instance-specific themes.  See [[development:architecture:user_interface|Customizing the User Interface]] for more details.+VuFind®'s theme is determined by [[configuration:files:config.ini]] settings.  Since each instance of VuFind® has its own [[configuration:files:config.ini]] in its [[configuration:local_settings_directory|local settings directory]], you can easily configure separate themes for separate instances.  Since themes can inherit from one another, it is possible to create a base theme for shared customizations and isolate minor, distinctive changes to very small, instance-specific themes.  See [[development:architecture:user_interface|Customizing the User Interface]] for more details.
  
 ===== Further information on MySQL Databases and Solr instances ===== ===== Further information on MySQL Databases and Solr instances =====
 ==== Sharing (or not sharing) a MySQL Database ==== ==== Sharing (or not sharing) a MySQL Database ====
  
-If you simply create a new instance with install.php and the web-based install script, VuFind will attempt to create a separate MySQL database for each instance.  This may be desirable if each instance has its own distinct user base and tags/favorites should not flow between instances.  However, it is more common that you will want to share a database.  In this situation, just manually copy the database settings from your original instance's [[configuration:files:config.ini]] file into the new instance instead of using the "fix" link in the automatic installer.  If you use a shared base configuration as suggested [[#Basic Configuration|above]], you can even avoid duplicating credentials in multiple places.+If you simply create a new instance with install.php and the web-based install script, VuFind® will attempt to create a separate MySQL database for each instance.  This may be desirable if each instance has its own distinct user base and tags/favorites should not flow between instances.  However, it is more common that you will want to share a database.  In this situation, just manually copy the database settings from your original instance's [[configuration:files:config.ini]] file into the new instance instead of using the "fix" link in the automatic installer.  If you use a shared base configuration as suggested [[#Basic Configuration|above]], you can even avoid duplicating credentials in multiple places.
  
 ==== Using Multiple Solr Instances : Create a New Solr Instance ==== ==== Using Multiple Solr Instances : Create a New Solr Instance ====
Line 123: Line 123:
 The steps above setup a new Solr core in an existing Solr instance, which will probably be suitable for most systems. However another option is to create a New Solr Instance: The steps above setup a new Solr core in an existing Solr instance, which will probably be suitable for most systems. However another option is to create a New Solr Instance:
  
-Creating a new core usually makes more sense than creating a copy of Solr, but if your index is too large to fit on a single server, you could also copy VuFind's Solr index and startup script to another server, and reconfigure your instance to point there (using the url setting in the [Index] section of [[configuration:files:config.ini]] and, if necessary, the solr.path = REMOTE and solr.hosturl settings of SolrMarc's import.properties file).+Creating a new core usually makes more sense than creating a copy of Solr, but if your index is too large to fit on a single server, you could also copy VuFind®'s Solr index and startup script to another server, and reconfigure your instance to point there (using the url setting in the [Index] section of [[configuration:files:config.ini]] and, if necessary, the solr.path = REMOTE and solr.hosturl settings of SolrMarc's import.properties file).
 ===== Example shell transcript of setting up a new instance ===== ===== Example shell transcript of setting up a new instance =====
 The following example creates a new instance called springfield, with a new Solr core, on server vufindserver as user libadmin. The following example creates a new instance called springfield, with a new Solr core, on server vufindserver as user libadmin.
Line 210: Line 210:
 libadmin@vufindserver:/usr/local/vufind$ ./import-marc.sh testfile.mrc libadmin@vufindserver:/usr/local/vufind$ ./import-marc.sh testfile.mrc
 </code> </code>
 +
 +===== Additional Resources =====
 +
 +  * [[installation:installing_multiple_instances:automation_example|Multiple Instances Automation Example]]
 ---- struct data ---- ---- struct data ----
 +properties.Page Owner : 
 ---- ----
  
installation/installing_multiple_instances.1567765378.txt.gz · Last modified: 2019/09/06 10:22 by demiankatz