Install eXpansion on Debian 8 (jessie)

Install Mysql

eXpansion uses mysql to store records and other data.

$ sudo apt-get -y install mysql-server mysql-client

This will add for a root password at one point, enter a secure password and note this password.

Install & Configure PHP

Debian jessie comes with PHP 5.6 which is “expired” you will therefore need to install a newer version.

The easiest way to install PHP 7.0 is to use Ondrej Sury packages.

sudo apt install apt-transport-https ca-certificates
sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
sudo sh -c 'echo "deb https://packages.sury.org/php/ stretch main" > /etc/apt/sources.list.d/php.list'
sudo apt update

You will need to install php and the dependencies.

$ sudo apt-get install -y php7.0 php7.0-cli php7.0-common 
$ sudo apt-get install -y php7.0-intl php7.0-xml php7.0-mysql php7.0-mcrypt php7.0-zip php7.0-json

Some distributions may also need:

$ sudo apt-get install -y php7.0-pdo_mysql

We can now edit the php.ini file, open with your favorite editor /etc/php/7.0/cli/php.ini and change the memory limit

memory_limit = 1gb

If you intend to run 200+ players on the server go for 2gb to handle peak usages.

Let’s check now that our php is well installed

$ php -v

Should output something like

PHP 7.0.20 ...

Install Composer

Composer installation is really simple and can be done with a single command:

$ curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer

This will download and install Composer as a system-wide command named composer, under /usr/local/bin. The output should look like this:

#!/usr/bin/env php
All settings correct for using Composer
Downloading...

Composer successfully installed to: /usr/local/bin/composer
Use it: php /usr/local/bin/composer

Now test your installation by running:

$ composer

Which should output:

   ______
  / ____/___  ____ ___  ____  ____  ________  _____
 / /   / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__  )  __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
                    /_/
Composer version 1.4.2 2017-05-17 08:17:52



Usage:
 command [options] [arguments]

Configure eXpansion

eXpansion2 is a symfony application before anything else, there are therefore a lot of symfony related configurations. We will ignore all this configuration and only bother about what is necessary by eXpansion.

Configuration can be found in app/config directory. Configuration that interests us are in the fallowing files :

  • parameters.yml
  • expansion.yml
  • bundles.yml

If you have not done so already rename the :

  • parameters.yml.dist to parameters.yml.
  • expansion.yml.dist to expansion.yml.
  • bundles.yml.dist to bundles.yml.

The following part of the parameters.yml file interests us at first:

parameters:
    database_driver: mysql
    database_host: mysql
    database_port: ~
    database_name: expansion
    database_user: root
    database_password: ~

    dedicated_host: dedicated
    dedicated_port: 5000
    dedicated_timeout: 5
    dedicated_user: SuperAdmin
    dedicated_password: SuperAdmin
    dedicated_connection_type: local

Database configurations

  • database_driver : Database driver to use. eXpansion was tested on mysql but should work with other databases as well (mysql/sqlite/pgsql/oracle)

  • database_host : Host or Ip to connect to the database. If you are using wamp/xamp it’s probably localhost or 127.0.0.1

  • database_port : if at null(~) default will be used

  • database_name : Name of the database to use. eXpansion should have it’s own database and not share it!

  • database_user : User to connect to the database, this user should be able to create tables as eXpansion intalls it’s own schema |

  • database_password : Password to connect to thed database.

Dedicated server configurations

  • dedicated_host : Host or ip to connect to the dedicated. If you are using wamp/xampp it’s probably localhost or 127.0.0.1

  • dedicated_port : The xmlrpc port configured in the dedicated config file

  • dedicated_timeout : Max timeout time, should not be changed

  • dedicated_password : Unless specific use case it’s needs to be SuperAdmin

  • dedicated_connection_type : local if the dedicated is on the same machine as eXpansion. remote if not See section below if you configured it as remote.

Configure a MasterAdmin

In this file replace login1 by your own login. You may add as many logins as you wish on multiple lines. The admins configured here are constant, they can’t be altered ingame. You will be able to add new admins ingame. Example:

/app/config/expansion.yml

e_xpansion_admin_groups:
    groups:
        master_admin:
            label: Master Admin
            logins:
                - login1
                - login2
            permissions: [] # Master_admin has always all permissions.
        admin:
            label: Admin
            logins: []
            permissions:
              - next
              - restart

Enabling disabling Bundles

You can enable and disable a bundle in the bundles.yml file. The bundles.yml.dist File contains the list of all available bundles.

Lines starting with # are commented and therefore those bundles will not be loaded

Example :

#  - \eXpansion\Bundle\LocalMapRatings\LocalMapRatingsBundle

For more information check : Configure eXpansion

Startup eXpansion

We can now start eXpansion

$ bin/run.sh

This command will empty caches and check if the database structure needs to be updated.

Optionally Update eXpansion

eXpansion uses composer to handle all dependencies. Installing/Updating eXpansion is really easy.

First let’s check that our composer is well up to date.

$ sudo composer self-update

This should display something like

Updating to version 1.6.2 (stable channel).
   Downloading (100%)         
Use composer self-update --rollback to return to version 1.4.2

Now we can install/update eXpansion, todo so just use the update command

$ composer update

This might take sometime.