Table of Contents
VuFind on Fedora
These instructions assume that you are starting with a clean installation of Fedora. If you already have a Fedora server, you will be able to skip some steps, but you may have to reconfigure some existing software.
These instructions were most recently tested on Fedora 30 but should also work with other recent versions with little or no modification. If you are using an older Fedora distribution, make sure it meets the requirements (such as minimum PHP version) of the VuFind release you are installing.
A Note on SELinux
One of the key features that distinguishes Fedora from some other Linux distributions is its use of the SELinux security module. You can read a basic introduction to SELinux here (pdf). The greater security level makes installation a bit more complicated. The instructions below should get VuFind working without forcing you to take down your security; however, I'm not an expert on this, so feel free to edit the document and improve my suggested commands if there is a better way.
Also note that SELinux can block a lot of things – if security is misconfigured, it will prevent Apache from talking to Solr and your ILS; if library files have the wrong permissions, it won't let code load or execute; etc. If you run into problems during installation, be sure to add SELinux to your troubleshooting checklist, and remember that you can temporarily turn it off if you need to confirm whether or not it is really the cause of your troubles. (But be sure to turn it back on again after you're done testing – I encourage you to solve things by working within the system, even though the temptation to turn it off for good may be strong at times!) These instructions should get you through without any trouble, but if you run into problems outside the scope of the instructions, hopefully some of the commands used here will help you do further research on your own.
1. Install Fedora
You can obtain a free copy of the software and find installation instructions at fedoraproject.org. If you prefer a bare-bones web server over the GUI features provided by the default Live CD, you can install the Minimal system from the DVD available here. If you do boot up from the Live CD, be sure you install the operating system to your hard drive BEFORE installing VuFind; it may not work well if you try to run it entirely from the bootable CD.
2. Get to the System Terminal
Fedora puts you in a graphical desktop by default – to enter all of the commands described below, you will need to go to a command prompt, which you can access by selecting “Terminal” under Applications (in earlier versions, this was found in the System Tools submenu).
3. Log in as the Root User
The commands below assume that you have root access to the system. If you are logged in as a user account, you can gain root access by entering:
You will be prompted for the system's root password.
Root access can be dangerous, so be sure to exit out of the root account as soon as you are done with the necessary work!
4. Update the System
Make sure you have the latest patches installed.
dnf vs. yum - With release 22, Fedora switched its package manager from yum to dnf; dnf is also available in some earlier Fedora releases. If you run a dnf command in an older Fedora release and it does not work, try substituting yum.
It is a good idea to reboot after installing updates.
shutdown -r now
Quick Installation with RPM Package
Detailed Installation Instructions
Following these steps will give you a running instance of VuFind. All instructions below assume you are at a terminal prompt, logged in as root (see steps 2 and 3 under Getting Started above).
1. Install Apache HTTP Server
Now install the Apache web server. This will facilitate communication between VuFind and web browsers. In some distributions, this is pre-installed, but attempting to install it again is harmless.
dnf install httpd
VuFind depends on mod_rewrite being enabled; this is turned on by default, but if you have disabled it in a pre-existing Fedora installation, you need to re-enable it for VuFind.
IMPORTANT: If your VuFind instance will include records with slashes in their IDs, you need to add “AllowEncodedSlashes on” to the appropriate <VirtualHost> section of your Apache configuration!
2. Install MySQL/MariaDB
VuFind uses the MySQL database for storing user comments, tags and other information. You should install this component next. Some versions of Fedora have replaced MySQL with the functionally equivalent MariaDB.
Fedora 22 or newer:
dnf install mariadb-server
Older Fedora versions:
dnf install mysql-server
Once MySQL/MariaDB is installed, you should start it up:
Fedora 30 or newer:
systemctl start mariadb
Older Fedora versions:
service mariadb start
For security reasons, it's also a good idea to set a root password for the database; this command will guide you through the process (regardless of whether you have MariaDB or MySQL):
3. Install PHP
Most of VuFind is written using the PHP language. We must install this next, being sure to enable modules for key technologies used by VuFind (MySQL, LDAP, etc.)
dnf install php php-devel php-intl php-ldap php-mysqli php-xsl php-gd php-mbstring php-json php-soap
If you are using a version of Fedora older than 25 and you get an error about php-mysqli being unavailable, try installing the php-mysql package instead.
Starting with VuFind 4.0, the php-mcrypt module is no longer needed. Instead, you will need php-openssl, which should be automatically installed as part of the command above.
Note that the php-ldap library is only needed if you will be using LDAP authentication; you can exclude this package if you like. The php-soap library is only used by the Symphony ILS driver (as of this writing), but it is required by one of VuFind's composer dependencies and will need to be installed if you plan to run composer manually for any reason. The php-gd package is also optional, though including it will ensure better support for cover images.
If you are a Voyager library, you will also need to install the PHP OCI Driver for Oracle – see this page for detailed instructions.
If you will be accessing a Sybase database (e.g. for the Horizon LMS), also install php-mssql.
dnf install php-mssql
4. Install the Java JDK
Next install JDK (the Java Development Kit) on the server – VuFind's searching back-end and MARC indexing tools rely on Java. Note that some VuFind components may be able to run using only the JRE (Java Runtime Environment), but the JDK is strongly recommended, and required for proper MARC indexing after release 3.1.
dnf install java-*-openjdk-devel
If you are using Fedora 28 or newer and VuFind 4.x or earlier, installing java-*-openjdk-devel may give you an incompatible version of Java. You should specifically “dnf install java-1.8.0-openjdk-devel” to be sure you get an appropriate version.
5. Download VuFind
All the prerequisites are in place, so now for the fun part – downloading and installing VuFind itself!
Instructions for obtaining VuFind can be found on the download page. You can either download a particular release in tar.gz or zip format, or you can load the latest development code directly from Git.
Starting with VuFind 3.0, when loading code from Git, you will also need to install dependencies using Composer.
You can choose whatever download method you prefer; here is a sample approach for downloading a pre-packaged .tar.gz file (note that this requires installing the wget tool for retrieving files over HTTP):
dnf install wget cd /tmp wget https://github.com/vufind-org/vufind/releases/download/v6.0/vufind-6.0.tar.gz tar xzvf vufind-6.0.tar.gz mv vufind-6.0 /usr/local/vufind
6. Install VuFind
The groundwork is set, so you can now run VuFind's install script to set up your basic configuration. You can accept the defaults for now – you can run the installer again later if you need to make changes.
cd /usr/local/vufind php install.php
Appropriate security permissions need to be set up so Apache can access the VuFind code. The chcon line sets file permissions so Apache is allowed to load the files. The first setsebool command allows Apache to communicate with itself internally, which is necessary to access the search back-end. The second setsebool command allows Apache to send email, which is necessary for VuFind's message-sending functions.
chcon -R unconfined_u:object_r:httpd_sys_content_t:s0 /usr/local/vufind/ setsebool -P httpd_can_network_relay=1 setsebool -P httpd_can_sendmail=1
Note: The chcon statement above allows Apache read access to more files than is strictly necessary; this is for simplicity, but by providing a longer list of directories, the security settings could be made more targeted.
It is also necessary to make a few directories writeable by Apache so VuFind can generate cache files and base configurations:
chown -R apache:apache /usr/local/vufind/local/cache chcon -R unconfined_u:object_r:httpd_sys_rw_content_t:s0 /usr/local/vufind/local/cache chown -R apache:apache /usr/local/vufind/local/config chcon -R unconfined_u:object_r:httpd_sys_rw_content_t:s0 /usr/local/vufind/local/config
If you plan to use VuFind's command line tools, you also need a separate cache for that:
mkdir /usr/local/vufind/local/cache/cli chmod 777 /usr/local/vufind/local/cache/cli
Note: making the cache world-writable is a simple but less-than-secure approach to enabling proper caching. You may wish to limit ownership to a specific VuFind CLI user or use ACL's using techniques described in Symfony's Installation Manual.
7. Link VuFind to Apache
Apache needs to have some extra VuFind settings loaded. Run these commands to set the appropriate security context for VuFind's configuration and then link it with Apache.
chcon system_u:object_r:httpd_config_t:s0 /usr/local/vufind/local/httpd-vufind.conf ln -s /usr/local/vufind/local/httpd-vufind.conf /etc/httpd/conf.d/vufind.conf
Apache needs to be restarted so the changes can take effect:
Issues with php-fpm
If you are using Fedora 27 or newer with VuFind 4.1.x or earlier, Apache will fail to restart due to an incompatibility between VuFind's httpd-vufind.conf and the php-fpm process manager.
Follow these steps:
1.) Edit /usr/local/vufind/local/httpd-vufind.conf, and comment out the line “php_value short_open_tag On”
2.) Edit /etc/php.ini and change short_open_tag=Off to short_open_tag=On
3.) Run “service php-fpm restart” and “service httpd restart”
Now everything should work.
See VUFIND-1257 for further discussion of this issue.
8. Set Up Environment Variables
Some environment variables need to be set so that VuFind-related scripts can find required resources. If you plan on running VuFind under a specific user account, you should set these only for that user. If you want to make the settings global for all accounts (the easiest, but not necessarily the best, approach), just run this code to create a script in the /etc/profile.d directory:
echo export VUFIND_HOME="/usr/local/vufind" > /etc/profile.d/vufind.sh echo export VUFIND_LOCAL_DIR="/usr/local/vufind/local" >> /etc/profile.d/vufind.sh
After creating this file, unless you log out and back into your account first, you must manually load it for the changes to take effect immediately.
9. Final Configuration
Everything is set up - proceed to Configuring and Starting VuFind below.
Configuring and Starting VuFind
Regardless of the method you used to set up VuFind, you will need to follow these steps to configure final details and get the code running.
1. Start Solr
To start VuFind's Solr index:
cd /usr/local/vufind/ ./solr.sh start
solr.sh was called vufind.sh prior to release 3.0; if you are installing an old version, please adjust accordingly.
Newer versions of Solr will not run under the root account by default; you should change the ownership of /usr/local/vufind/solr and run the service as a different user for better security.
If you get a warning about limit settings, see the starting and stopping Solr page for details on how to fix it.
For more information on managing the operation of the Solr server, including troubleshooting notes and instructions for starting it automatically, see the Starting and Stopping Solr page.
2. Configure VuFind
Open a web browser, and browse to this URL:
(Replace “your-server-name” with the address you wish to use to access VuFind; replace “vufind” with your custom base path if you changed the default setting during installation).
If you get a 403 forbidden error, this may be caused by using Apache 2.3 or later with VuFind 2.1.1 or earlier; you can fix this by adjusting VuFind's Apache configuration and restarting Apache. See VUFIND-917.
White Screen of Death
If you see a blank white screen, something is wrong.
The troubleshooting page has several suggestions that may help.
If you are still stuck, try one of the mailing lists on the support page; the community is always willing to help new arrivals.
If installation was successful, you should now see an Auto Configure screen.
Some items on the list will be marked “Failed” with “Fix” links next to them.
Click on each Fix link in turn and follow the on-screen instructions.
After an issue is successfully resolved, you can click the “Auto Configure” breadcrumb to go back to the main list and proceed to the next problem.
- To set up VuFind's database, you will need to have the root password you set when installing MySQL.
Locking Down Configurations
Once all configuration issues are successfully resolved, you will see a “Disable Auto Configuration” link on the “Auto Configure” page. Click this to prevent future access to the install script. If you need access again in the future, you can re-enable it by manually editing your config.ini file.
After disabling auto configuration, you should also disable Apache's ability to write to your configuration directory:
chown -R root:root /usr/local/vufind/local/config chcon -R unconfined_u:object_r:httpd_sys_content_t:s0 /usr/local/vufind/local/config
(Replace “root:root” with a different user/group if you have set up a particular Linux user for the purposes of running VuFind; replace /usr/local/vufind with your VuFind base path if you have customized the location of your installation).
3. Import Records
VuFind won't do much good without any data – see the indexing page for more details on loading your content into the system.
4. Secure Your System
Congratulations – you now have a running copy of VuFind. However, you should be aware of security concerns. See the Security page for some VuFind-specific notes, and take some time to learn about general issues in Unix security if you are not already familiar with the topic; LinuxSecurity.com is one good source for news and tutorials.
Do not forget this step before going into production – an improperly secured system on the open Internet can quickly come under attack.