How to Install an Institutions Directory Instance
This page in Español | Português
Note: For a complete Installation, configuration and operation guide, please visit the Downloads section
Install pre-requisites
Before installing the Institutions Directory application, install the software listed below.
Server software
software | product URL | installation method | debian/ubuntu package name |
PHP 5.2 or 5.3 | http://www.php.net | OS package manager | php5 |
php5-cli - command line | http://www.php.net | OS package manager | php5-cli |
php5-mysql - MySQL module for php5 | http://br2.php.net/manual/en/book.pdo.php | OS package manager | php5-mysql |
Java Runtime Environment 6 - JRE | http://java.sun.com | OS package manager | sun-java6-jre |
GNU compiler and tools | OS package manager | build-essential | |
Apache HTTP server 2.2 | http://httpd.apache.org | OS package manager | apache2 |
MySQL 5.1 database server | http://dev.mysql.com | OS package manager | mysql-server-5.1 |
1. Install each package below using the recommended installation method above.
Note: The Institutions Directory application is built above the symfony framework, who delivers a script to check if all the pre-requisites have been installed correctly. It is highly recommended for you to run this script at CLI and Server environments.
Configure the database
2. Create a database user and a institutions_directory database. The user name and password will be used in step 5.
- The database user must have all privileges on the institutions_directory database
- The database user should have CREATE DATABASE privileges, to run the automated tests
Log in to the MySQL shell as root:
Paste this code in the MySQL shell:
CREATE DATABASE institutions_directory; CREATE USER 'institutionsdir'@'localhost' IDENTIFIED BY 'popcorn'; GRANT ALL PRIVILEGES ON institutions_directory.* TO 'institutionsdir'@'localhost';
Download the Institutions Directory application
3. Go to a suitable installation directory and check out the application source
version under development
$ svn co http://svn.reddes.bvsalud.org/institutions_directory/trunk
stable versions
$ svn co http://svn.reddes.bvsalud.org/institutions_directory/tags/<version>
user: anonymous password: 4guests@
4. Make the symfony.php script executable
$ cd trunk $ chmod +x symfony.php
5. Configure the databases.yml
$ cd config $ vi databases.yml # edit the database settings.
6. Create database tables
$ ./symfony doctrine:build --all
Configure the virtual host configuration file (apache2)
7. Add the application specific configuration to apache. i.e:
<VirtualHost *:80> ServerName insdir.local DocumentRoot "/home/gustavo/Projects/institutions_directory/trunk/web" DirectoryIndex index.php <Directory "/home/gustavo/Projects/institutions_directory/trunk/web"> AllowOverride All Allow from All </Directory> Alias /sf /home/gustavo/Projects/institutions_directory/trunk/lib/vendor/symfony/data/web/sf <Directory "/home/gustavo/Projects/institutions_directory/trunk/lib/vendor/symfony/data/web/sf"> AllowOverride All Allow from All </Directory> </VirtualHost>
Note: You must change the ServerName and all paths according to your environment
Configure the Solr Lucene Service
Solr in a production environment In a production environment, you should run Solr as a daemon. The right way to do depends on your server's system, however, some startup scripts are included in the lib/vendor/scripts directory.
On a debian server
$ sudo cp plugins/tjSolrDoctrineBehaviorPlugin/lib/vendor/scripts/debian/solr /etc/init.d/solr $ sudo chmod 755 /etc/init.d/solr $ sudo update-rc.d solr defaults
If necessary change the PROJECT_NAME and PROJECT_DIR:
$ sudo vim /etc/init.d/solr
Start the daemon:
$ sudo /etc/init.d/solr start
Check this URL to be sure everything went fine.
http://localhost:8983/solr/admin/
Click here for technical details about this topic.
On another Unix-like server
The following lines start the Solr service manually:
$ cd plugins/tjSolrDoctrineBehaviorPlugin/lib/vendor/solr $ sudo nohup sh solr.sh &
Check this URL to be sure everything went fine.
http://localhost:8983/solr/admin/
8. Load initial data
$ ./symfony doctrine:data-load
Troubleshoot
1. java.io.FileNotFoundException?
Error message when access http://localhost:8983/solr/admin/:
HTTP ERROR: 500 Severe errors in solr configuration. Check your log files for more detailed information on what may be wrong. If you want solr to continue after configuration errors, change: <abortOnConfigurationError>false</abortOnConfigurationError> in null ... Caused by: java.io.FileNotFoundException: no segments* file found in org.apache.lucene.store.NIOFSDirectory....
Solution: Check if the directory data/solr/index/ is empty and delete then in affirmative case. Restart the solr service.
2. 404 Not Found - /guard/login
The requested URL /guard/login was not found on this server. Apache/2.2.16 (Ubuntu) Server at insdir.local Port 80
Solution: Enable the Apache's module mod_rewrite