Skip to content
Jos Ahrens edited this page Aug 10, 2015 · 14 revisions

Web Installation

Note: You can skip this section by making use of wiki: Vagrant

Requirements

  • A webserver (i.e. nginx or apache)
  • SSL configuration
  • PHP 5.6+
  • php-mongo extension
  • date.timezone setting must be set
  • MongoDB
  • Composer
  • Ruby (or libsass)
  • SASS
  • node.js
  • UglifyJS

Linux is a plus
Hosts file pointing korobi.dev at localhost is recommended.

Installation

Database imports

  1. First you will need some of the database imports. Contact Kashike in the IRC channel.
  2. Ensure mongod is running.
  3. Import the files using the following commands (this will take a while):
mongoimport --db korobi --collection channels --file channels.json --jsonArray
mongoimport --db korobi --collection chat_indexes --file chat_indexes.json --jsonArray
mongoimport --db korobi --collection chats  --file chats.json --jsonArray
mongoimport --db korobi --collection networks --file networks.json --jsonArray

The database is now imported.

Cloning the repository

Simply run git clone https://github.com/korobi/Web.git or git clone git@github.com:korobi/Web.git

Webserver Configuration

  • Generate a certificate to use for localhost SSL.
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout korobi.key -out korobi.crt
  • Place them in a place you in a place you can remember (usually an ssl folder in the root directory of the webserver)
  • Configure your webserver.

Installing Symfony

  • In the root directory of your git-clone, run composer install.
  • Run php app/console assetic:dump

Done.

Try visiting https://korobi.dev or https://localhost if you did not configure your hosts file. - all should work.


Example Configs

Symfony params.yml

  • Windows
# This file is auto-generated during the composer install
parameters:
    database_host: 127.0.0.1
    database_port: 27017
    database_name: korobi
    mailer_transport: smtp
    mailer_host: 127.0.0.1
    mailer_user: null
    mailer_password: null
    locale: en
    secret: 1d64dce239c4437b7736041db089e1b9
    github.client_id: meow
    github.client_secret: meow
    github.hook_hmac_secret: meow
    github.oauth_token: meow
    akio.enabled: false
    akio.path: null
    akio.key: null
    sass_path: 'C:\Ruby21\bin\sass'
    uglifyjs_path: '%appdata%\npm\node_modules\uglifyjs\bin\uglifyjs'
    channel_stats_root: null
    influx.host: 127.0.0.1
    influx.port: 8086
    influx.user: user
    influx.pass: pass
    influx.db: database
    bin_path.ruby: 'C:\Ruby21\bin\ruby.exe'
  • Linux
# This file is auto-generated during the composer install
parameters:
    database_host: 127.0.0.1
    database_port: 27017
    database_name: korobi
    mailer_transport: smtp
    mailer_host: 127.0.0.1
    mailer_user: null
    mailer_password: null
    secret: 1d64dce239c4437b7736041db089e1b9
    locale: en
    github.client_id: meow
    github.client_secret: meow
    github.hook_hmac_secret: meow
    github.oauth_token: meow
    akio.enabled: false
    akio.path: null
    akio.key: null
    sass_path: /usr/bin/sass
    uglifyjs_path: /usr/bin/uglifyjs
    channel_stats_root: null
    influx.host: 127.0.0.1
    influx.port: 8086
    influx.user: user
    influx.pass: pass
    influx.db: database
    bin_path.ruby: /usr/bin/ruby

Example config Webserver

  • apache
<VirtualHost *:443>
    SSLEngine on
    SSLCertificateFile /path/to/korobi.crt
    SSLCertificateKeyFile /path/to/korobi.key
    
    ServerName korobi.dev
    DocumentRoot "/path/to/korobi-web/web"
    <Directory "/path/to/korobi-web/web">
        AllowOverride None 
        Require all granted
        <IfModule mod_rewrite.c>
            Options -MultiViews
            RewriteEngine On
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteRule ^(.*)$ app_dev.php [QSA,L]
        </IfModule>
    </Directory>
</VirtualHost>