Table of Contents
Vagrant is a tool for managing consistent development environments. While it is not intended for production use, VuFind developers may find it helpful for quickly setting up a VuFind system, and it may also be useful for evaluation purposes.
Starting with VuFind 4.1, the software ships with a default Vagrantfile that will get an instance of VuFind running on an Ubuntu image.
Setting Up the Virtual Machine
To get started, make sure that Vagrant is installed on your system, then simply go to your VuFind directory (preferably a fresh, clean checkout from Git with Composer dependencies already installed, if you're just getting started) and run:
This will take quite some time to install and set up everything. Once the installation completes, VuFind's web interface will be visible on the host machine's port 4567.
You will have to do a bit of manual work to get everything running….
Completing the Installation
Access the web-based installation process at http://localhost:4567/vufind/Install to finalize configuration and initialize the database. Note that the MySQL root password is “root” on the test box ( this is obviously not secure; the VM is intended only for development purposes).
Managing Solr and Indexing Records
To log into the virtual machine to run commands, you can execute:
You will need to run:
cd $VUFIND_HOME; ./solr.sh start
to get Solr running for the first time. You can then use the standard ./import-marc.sh script to index records into your test instance.
If you want to view Solr in a web browser on your host machine, it should be port-mapped to port 4568, so you can view the admin at http://localhost:4568/solr.
Notes on File Mapping / Locations
Your host machine's VuFind directory will be mounted within the Vagrant SSH session as /vagrant. Any changes you make there will affect your host machine as well (and vice versa).
Because Apache does not have write access to the special mounted /vagrant directory, the system is using /vufindlocal as its $VUFIND_LOCAL_DIR; these files are only accessible from within the VM. You will have to use “vagrant ssh” to log in and examine/modify them.
Managing the Virtual Machine
Once everything is set up, you can issue a few commands to control the VM:
- vagrant suspend - save the current state of the VM, but stop it from running until you issue “vagrant up” again.
- vagrant halt - shut down the VM; it will boot back up the next time you issue “vagrant up”.
- vagrant destroy - completely destroy the VM; you will have to reinstall it (see above) if you want it back.
If you are on a version of VuFind older than 4.1, or if you want to explore other options, here are some other VuFind/Vagrant options: