Skip to content

Installation on Linux

Stefan Heyder edited this page Aug 14, 2016 · 22 revisions

Requirements

  • MySQL Database

  • Apache Server

  • PHP >= 5.4

  • Mcrypt PHP Extension

  • OpenSSL PHP Extension

  • Mbstring PHP Extension

  • Tokenizer PHP Extension

  • Composer

  • Laravel 5.0 is already included in this repository.

Installation on a CentOS production server##

"$>" stands for console commands

  1. Install the server, e.g.: $> yum install httpd mariadb-server php php-ldap php-mysql

  2. Install Composer:

  • open directory: $> cd /usr/local/bin/
  • download composer: $> php -r "readfile('https://getcomposer.org/installer');" | php
  • add a symbolic link: $> ln –s /usr/local/bin/composer.phar /usr/local/bin/composer.
  1. Install git: $> yum install git

  2. Copy lara-vedst files with git:

  • open directory: $> cd /var/www/
  • clone repository with git: $> git clone https://github.com/4D44H/lara-vedst.git
  1. Update dependencies: $> composer update (this one can take some time - don't worry, make some tea)

  2. Change permissions:

  • $> cd /var/www
  • $> chown -R apache:apache lara-vedst/
  • $> chmod -R 755 lara-vedst/
  • $> chmod -R 777 lara-vedst/storage
  1. To hide "/lara-vedst/public" path:
  • open the Apache Server config (actual filename may vary): $> vi /etc/httpd/conf.d/laravel.conf
  • type i to enter editing mode
  • change DocumentRoot to DocumentRoot "var/www/lara-vedst/public"
  • hit <ESC> to exit editing mode
  • type :x and hit <Return> to exit vi
  1. Restart the server: $> /etc/init.d/httpd restart

  2. Create a MySQL database named "lara-vedst":

  • switch to MySQL: $> mysql –u root –p
  • create new database named "lara-vedst": $> create database lara-vedst
  • update database schema from /lara-vedst folder: $> php artisan migrate --seed
  1. Edit environment variables in the file .env located in /var/www/lara-vedst/:
  • set "APP_ENV=production"
  • set "APP_DEBUG=false"
  • enter new random key to "APP_KEY=" (32 signs)
  • set "DB_HOST", "DB_DATABASE", "DB_USERNAME" and "DB_PASSWORD" to your database credentials
  1. For development purposes a workaround is built into the LoginController which assigns a random dummy-user at each login event, ignoring login/password input from user. Change it to the your actual authentification routine.

  2. Install Node(https://nodejs.org/en/) then run (in the lara-vedst directory):

  • $> npm install
  • $> npm install --global gulp
  • $> gulp
  • This will install typescript and gulp and running gulp will compile the typescript sources to the bundle.js file in /public/bin/. Note that installing all dependencies may take a while but you can already proceed with the next steps.
  1. Run this once: $> php artisan config:cache

  2. Do this on deploying to PRODUCTION ONLY:

  • remove /logs route from /App/Http/routes.php
  • remove rap2hpoutre/laravel-log-viewer from composer.json and config/app.php
  • update dependencies: $> composer update
  1. ATTENTION: Do this on deploying to DEVELOPMENT ONLY or ONLY on the very FIRST PRODUCTION DEPLOYMENT:

IF YOU RUN ANY OF THE FOLLOWING COMMANDS ON A PRODUCTION SERVER YOU WILL DELETE THE WHOLE DATABASE! STOP HERE IF YOU ARE IN PRODUCTION. YOU HAVE BEEN WARNED.


$> php artisan migrate:refresh --seed