From ARK
Revision as of 11:58, 22 September 2021 by John Layt (talk | contribs) (Debian Stable (Stretch))

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Git / Github

Development is hosted on GitLab, so you will need a free GitLab account to contribute code.

If you are new to Git, you may find a desktop application easier to use such as SourceTree and GitKraken, or the support built-in to your IDE like Atom.


To develop ARK requires the following tools to be installed:

You will also require PHP, a web server (Apache/PHP), a database server (MySQL/PostreSQL/SQLite), a web browser (Chrome/Firefox), and a an API client (Postman).

The following tools are recommend to adhere to ARK code quality standards:

  • php-cs-fixer
  • PHP CodeSniffer


On macOS, while you can install the requirements via standalone packages such as MAMP, we recommend using HomeBrew as it makes installing and updating all the tools used easier. Using macOS is only recommended for local hosting or development purposes only, internet-connected production sites should be run on a properly supported server installation, such as Debian Stretch.

  • Install XCode from the App Store and run it to accept the license, or from the command line:
    sudo xcodebuild -license accept
  • Check you have the Command Line Tools (including Git) installed and enabled:
    sudo xcode-select --install
  • Download and install HomeBrew:
    /usr/bin/ruby -e "$(curl -fsSL"
  • Modify your ~/.profile file to add brew packages to your $PATH and to enable Git completion
 export PATH=/usr/local/bin:/usr/local/sbin:$PATH
 source /Library/Developer/CommandLineTools/usr/share/git-core/git-completion.bash
 source /Library/Developer/CommandLineTools/usr/share/git-core/
 PS1='\u@\h \W$(__git_ps1 " (%s)") \$ '
  • Source your modified ~/.profile file to start using it:
    source ~/.profile
  • Install the required packages from Brew:
 brew install httpd mariadb imagemagick icu4c
 brew install php@7.4
 pecl install apcu imagick xdebug
 brew install composer php-code-sniffer php-cs-fixer@2 phpdocumentor phplint phpmyadmin
 brew install node@14
  • Modify /usr/local/etc/httpd/httpd.conf to enable PHP-FPM, aliases, vhosts and rewrite by uncommenting the following lines:
 LoadModule proxy_module lib/httpd/modules/
 LoadModule proxy_fcgi_module lib/httpd/modules/
 LoadModule vhost_alias_module lib/httpd/modules/
 LoadModule alias_module lib/httpd/modules/
 LoadModule rewrite_module lib/httpd/modules/
  • Add the following after the DocumentRoot section to enable PhpMyAdmin:
Alias /phpmyadmin /usr/local/share/phpmyadmin
<Directory /usr/local/share/phpmyadmin/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Require all granted
  • Modify the DirectoryIndex section to appear as follows:
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
<IfModule dir_module>
    DirectoryIndex index.html index.php

<IfModule proxy_fcgi_module>
    <FilesMatch ".+\.ph(ar|p|tml)$">
        SetHandler "proxy:fcgi://"
  • Start the required services:
 brew services start mariadb
 brew services start php@7.4
 brew services start httpd
  • Point your browser to localhost and you should see the default Apache page
  • Point your browser to localhost/phpmyadmin and sign in to confirm that PHP and MariaDB are running correctly


Since Debian Stretch, Debian has enabled the parallel install of multiple PHP versions using PHP-FM. However each release of Debian ships with a different default version and only that version is officially supported in that release. In order to install other versions such as PHP 5.6 and 7.4 you need to use the packages made available by the Debian Maintainer in his personal development repo. Check your version of Debian to determine what you need. LP Archaeology use this solution for our servers and we strongly recommend you use this method for both simplicity and reliability.

Instructions for NodeJS:

Instructions for adding PHP repo: See also

Summary of install commands for PHP 7.4 current requirement:

sudo apt-get install build-essential git apache2 mariadb-client mariadb-server
sudo apt-get install php7.4 php7.4-apcu php7.4-apcu-bc php7.4-bcmath php7.4-bz2 php7.4-cli php7.4-common php7.4-fpm php7.4-gd \
  php7.4-geoip php7.4-imagick php7.4-intl php7.4-json php7.4-mbstring php7.4-mysql php7.4-opcache php7.1-readline php7.4-sqlite3 \
  php7.4-tidy php7.4-uuid php7.4-yaml php7.4-xml php7.4-zip phpmyadmin php-pear
curl -sL | sudo -E bash -
sudo apt-get install -y nodejs
curl -sS -o composer-setup.php
php composer-setup.php --install-dir=/usr/local/bin --filename=composer

Enabled FPM

sudo service php7.4-fpm start
sudo systemctl enable  php7.4-fpm
sudo a2enconf php7.4-fpm
sudo a2enmod proxy_fcgi rewrite

Once ARK is installed (see below), configure Apache to serve the site, using either alias or symlink.

sudo vim /etc/apache2/sites-available/mysite.conf

Using a simple alias on a subdirectory:

 <VirtualHost *:80>
     ServerName localhost
     ServerAdmin sysadmin@localhost
     DirectoryIndex index.html index.php
     LogLevel debug
     Alias "/mysite"
     <Directory "/srv/www/lib/ark2/sites/mysite/web">
         Options FollowSymLinks
         Require all granted
         AllowOverride None
         AcceptPathInfo On
         RewriteEngine On
         RewriteCond %{REQUEST_FILENAME} !-f
         RewriteRule ^(.*)$ /index.php [QSA,L]

Using a vhost on a subdomain

 <VirtualHost *:80>
     DocumentRoot /srv/www/lib/ark2/sites/mysite/web
     DirectoryIndex index.html index.php
     LogLevel warn
     ErrorLog /path/to/logs/<site>/error.log
     CustomLog /path/to/logs/<site>/access.log combined
     <Directory "/srv/www/lib/ark2/sites/mysite/web">
         Options FollowSymLinks
         Require all granted
         AllowOverride None
         AcceptPathInfo On
         RewriteEngine On
         RewriteCond %{REQUEST_FILENAME} !-f
         RewriteRule ^(.*)$ /index.php [QSA,L]
sudo a2ensite mysite
sudo apache2ctl -t
sudo systemctl reload apache2
sudo apache2ctl -S


To install using git, create the folder where the library code will be located, then clone the ARK2 repository.

For example, for Debian stretch:

mkdir -p /srv/www/lib
cd /srv/www/lib
git clone

Alternatively download and unzip the file from

Then run composer to install the required PHP libraries:

cd arkserver/
composer install
<may need github token...>

Run the Sysadmin console to check your install:

./bin/sysadmin system:about

Check the database server config file is correct for your install:

less sites/servers.json

If you need to add different server details:

./bin/sysadmin database:server:add

To create a new site:

./bin/sysadmin site:create <site>

Now edit the site config files to reflect your site settings. Most settings will have the correct default, but some may need tweaking:

vim sites/<site>/config/site.json

If using vhosts, see above for instructions.

If not using vhosts, for local development, edit your Apache config to alias the site folder:

Alias /<site> /path/to/ark2/sites/<site>/web
<Directory /path/to/ark2/sites/<mysite>/web>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Require all granted

To rebuild the frontend

cd build
npm install
./build frontend:all <frontend>