These steps are tested for Linux. If you're using Mac or Windows, we don't offically support them yet. Sorry.
- A Unix-Like Operation System (e.g. Linux, BSD, Unix)
- Access of super account (i.e. root) or permission to
use
sudo
command - Java 7 or above
- Nginx
- PostgreSQL 9.4+
- ElasticSearch
- PHP 5.5+ or HHVM 3.12+
Ubuntu 14.04 provides PHP 5.5 by default. However, you'd need PPA to properly install PostgreSQL. You can simply run the commands below:
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install -y php5-fpm nginx postgresql-9.5 openjdk-7-jre
Ubuntu 16.04 provides PHP 5.5 and PostgreSQL 9.5 by default. You don't need to use PPA anymore.
sudo apt-get update
sudo apt-get install -y php7-fpm nginx postgresql-9.5 openjdk-7-jre
Only PHP 7 is provided in 16.04, you may use ppa ondrej/php5-5.6
to have php5.
sudo add-apt-repository -y ppa:ondrej/php5-5.6
sudo apt-get update
sudo apt-get install -y php5-fpm
Also OpenJDK 8 is also available, replace openjdk-7-jre
with openjdk-8-jre
to use OpenJDK 8.
Find out your PostgreSQL superuser (It is usually postgres
in default distro installation). Switch to the user. Then
create your database.
The below steps assume your Linux is using sudo
permission model. If not, just login to root and run them.
export DB_USER="some_username"
export DB_NAME="some_db_name"
sudo su - postgres
createuser "$DB_USER"
createdb "$DB_NAME"
psql -c "GRANT ALL ON \"$DB_NAME\" TO \"$DB_USER\""
psql "$DB_NAME" -c 'CREATE EXTENSION "uuid-ossp";'
exit
(TBD)
Run this command
git clone https://github.com/guardian-ils/Guardian.git
cd Guardian
Edit copy the .env.example file as .env
.
cp .env.example .env
Edit the .env
file.
Set DB_HOST
, DB_DATABASE
, DB_USERNAME
, DB_PASSWORD
to fit the database setup you created in step 1. Save it.
APP_ENV=local
APP_DEBUG=false
APP_KEY=SomeRandomString
APP_LOG=errorlog
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_DATABASE=guardian
DB_USERNAME=guardian
DB_PASSWORD=secret
DB_SCHEMA=public
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
MAIL_DRIVER=mailgun
Run these commands
composer install
php artisan key:generate
php artisan migrate
Setup your Nginx so it can show Guardian correctly.
Please reference this recipe for Nginx Setup:
- [http://laravel-recipes.com/recipes/26/creating-a-nginx-virtualhost](Creating a Nginx VirtualHost)
To verify the installation, please check in the browser that you can correctly see the site.
Should you find any issue, please file a bug report in our issue tracker.