Note

These instructions assume a clean 64-bit server installation of the applicable Linux operating system.

Ubuntu 14.04 LTS (Trusty)

TL;DR

Important

Substitute the name of the virtual host for “example.org” in these instructions.

These steps install and configure the requirements for development and a superset of the requirements for production:

sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install apache2 cmake curl git libapache2-mod-php5 memcached mysql-server nano php5 php5-curl php5-gd php5-json php5-memcached php5-mysqlnd php5-pgsql php5-sqlite php5-xdebug postgresql python python-jinja2 python-markdown python-pip python-yaml sqlite3 subversion
sudo pip install mkdocs
sudo a2enmod rewrite
echo -e "<Directory /var/www/example.org/html>\nOptions FollowSymLinks\nAllowOverride All\n</Directory>\n<VirtualHost *:80>\nServerAdmin webmaster@example.org\nServerName example.org\nServerAlias www.example.org\nDocumentRoot /var/www/example.org/html\nErrorLog \${APACHE_LOG_DIR}/error.log\nCustomLog \${APACHE_LOG_DIR}/access.log combined\n</VirtualHost>" | sudo tee -a /etc/apache2/sites-available/example.org.conf
sudo a2ensite example.org.conf
sudo service apache2 restart

Package Manager and Tools

Update the package database and upgrade all the packages on the system to the latest version:

sudo apt-get update
sudo apt-get dist-upgrade

Install the cURL tool and the Nano editor:

sudo apt-get install curl nano

Web Server

Install the Apache 2.4 web server:

sudo apt-get install apache2

Enable the mod_rewrite Apache module:

sudo a2enmod rewrite

Install the PHP 5.6 preprocessor and the mod_php5 Apache module:

sudo apt-get install libapache2-mod-php5 php5

Install the GD and JSON PHP extensions:

sudo apt-get install php5-gd php5-json

Important

Substitute the name of the virtual host for “example.org” in these instructions.

Create a directory to hold the files of the virtual host:

sudo mkdir -p /var/www/example.org/html
sudo chown $USER:$USER /var/www/example.org/html

Note

The value of $DOCUMENT_ROOT in the general instructions will be /var/www/example.org/html.

Add the configuration of the virtual host, including a Directory section to allow apache to execute directives defined in .htaccess files:

sudo nano /etc/apache2/sites-available/example.org.conf

<Directory /var/www/example.org/html>
     Options FollowSymLinks
     AllowOverride All
</Directory>

<VirtualHost *:80>
    ServerAdmin webmaster@example.org
    ServerName example.org
    ServerAlias www.example.org
    DocumentRoot /var/www/example.org/html
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Add the virtual host to your HOSTS file if the host name is not otherwise resolvable to your system:

echo "127.0.0.1 example.org" | sudo tee -a /etc/hosts

Enable the virtual host:

sudo a2ensite example.org.conf

Restart the web server to load the additional PHP extensions and configuration:

sudo service apache2 restart

Memory Caching System

Note

For development, the memory caching system is optional.

Install the Memcached 1.4 memory caching system:

sudo apt-get install memcached

Install the Memcached PHP extension:

sudo apt-get install php5-memcached

Restart the web server to load the additional PHP extension:

sudo service apache2 restart

Database Server

Note

For production, install one of the database servers; for development, install all three.

MySQL

Install the MySQL 5.5 database server:

sudo apt-get install mysql-server

Install the PDO_MYSQL PHP extension:

sudo apt-get install php5-mysqlnd

This also installs the MySQL native driver for PHP.

Restart the web server to load the additional PHP extensions:

sudo service apache2 restart

PostgreSQL

Install the PostgreSQL 9.3 database server:

sudo apt-get install postgresql

Install the PDO_PGSQL PHP extension:

sudo apt-get install php5-pgsql

This also installs the PostgreSQL PHP extension.

Restart the web server to load the additional PHP extensions:

sudo service apache2 restart

SQLite

Install the SQLite 3.8 database program:

sudo apt-get install sqlite3

Install the PDO_SQLITE PHP extension:

sudo apt-get install php5-sqlite

This also installs the SQLite PHP extension.

Restart the web server to load the additional PHP extensions:

sudo service apache2 restart

Development Tools

Note

For production, the development tools are not required.

Install the CMake 2.8 cross-platform make system, Git 1.9 distributed version control system, and Subversion 1.8 version control system:

sudo apt-get install cmake git subversion

Install the cURL and Xdebug PHP extensions:

sudo apt-get install php5-curl php5-xdebug

Restart the web server to load the additional PHP extensions:

sudo service apache2 restart

Install the MkDocs Python package and its dependencies:

sudo apt-get install python python-jinja2 python-markdown python-pip python-yaml
sudo pip install mkdocs

Fedora 21

TL;DR

Important

Substitute the name of the virtual host for “example.org” in these instructions.

These steps install and configure the requirements for development and a superset of the requirements for production:

sudo yum update
sudo yum install cmake curl git httpd mariadb-server memcached nano php php-bcmath php-gd php-mysqlnd php-pdo php-pecl-jsonc php-pecl-memcached php-pecl-xdebug php-pgsql postgresql-server python python-jinja2 python-markdown python-pip python-watchdog PyYAML sqlite subversion
sudo pip install mkdocs
sudo mkdir -p /var/www/example.org/html
sudo chown $USER:$USER /var/www/example.org/html
echo -e "<VirtualHost *:80>\nServerAdmin webmaster@example.org\nServerName example.org\nServerAlias www.example.org\nDocumentRoot /var/www/example.org/html\nErrorLog \${APACHE_LOG_DIR}/error.log\nCustomLog \${APACHE_LOG_DIR}/access.log combined\n</VirtualHost>" | sudo tee -a /etc/httpd/conf.d/example.org.conf
sudo postgresql-setup initdb
sudo systemctl enable httpd.service
sudo systemctl enable mariadb.service
sudo systemctl enable memcached.service
sudo systemctl enable postgresql.service
sudo systemctl start httpd.service
sudo systemctl start memcached.service
sudo systemctl start mysqld.service
sudo systemctl start postgresql.service

Package Manager and Tools

Update the package database and upgrade all the packages on the system to the latest version:

sudo yum update

Install the cURL tool and the Nano editor:

sudo yum install curl nano

Web Server

Install the Apache 2.4 web server:

sudo yum install httpd

The mod_rewrite Apache module is enabled by default.

Install the PHP 5.6 preprocessor:

sudo yum install php

The mod_php5 Apache module is installed along with the PHP preprocessor.

Install the BC Math, GD, and JSON-C PHP extensions:

sudo yum install php-bcmath php-gd php-pecl-jsonc

Important

Substitute the name of the virtual host for “example.org” in these instructions.

Create a directory to hold the files of the virtual host:

sudo mkdir -p /var/www/example.org/html
sudo chown $USER:$USER /var/www/example.org/html

Note

The value of $DOCUMENT_ROOT in the general instructions will be /var/www/example.org/html.

Add the configuration of the virtual host:

sudo nano /etc/httpd/conf.d/example.org.conf

<VirtualHost *:80>
    ServerAdmin webmaster@example.org
    ServerName example.org
    ServerAlias www.example.org
    DocumentRoot /var/www/example.org/html
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Add the virtual host to your HOSTS file if the host name is not otherwise resolvable to your system:

echo "127.0.0.1 example.org" | sudo tee -a /etc/hosts

Enable and start the web server:

sudo systemctl enable httpd.service
sudo systemctl start httpd.service

Memory Caching System

Note

For development, the memory caching system is optional.

Install the Memcached 1.4 memory caching system:

sudo yum install memcached

Enable and start the memory caching system:

sudo systemctl enable memcached.service
sudo systemctl start memcached.service

Install the Memcached PHP extension:

sudo yum install php-pecl-memcached

Restart the web server to load the additional PHP extension:

sudo systemctl restart httpd.service

Database Server

Note

For production, install one of the database servers; for development, install all three.

MariaDB

Install the MariaDB 10.0 database server:

sudo yum install mariadb-server

MariaDB is a fork of MySQL.

Enable and start the MariaDB database server:

sudo systemctl enable mariadb.service
sudo systemctl start mariadb.service

Install the PDO_MYSQL PHP extension:

sudo yum install php-mysqlnd

This also installs the MySQL native driver for PHP.

Restart the web server to load the additional PHP extensions:

sudo systemctl restart httpd.service

PostgreSQL

Install the PostgreSQL 9.4 database server:

sudo yum install postgresql-server

Initialize the PostgreSQL database:

sudo postgresql-setup initdb

Enable and start the PostgreSQL database server:

sudo systemctl enable postgresql.service
sudo systemctl start postgresql.service

Install the PDO_PGSQL PHP extension:

sudo yum install php-pgsql

This also installs the PostgreSQL PHP extension.

Restart the web server to load the additional PHP extensions:

sudo systemctl restart httpd.service

SQLite

Install the SQLite 3.8 database program:

sudo yum install sqlite

Install the PDO_SQLITE PHP extension:

sudo yum install php-pdo

Restart the web server to load the additional PHP extension:

sudo systemctl restart httpd.service

Development Tools

Note

For production, the development tools are not required.

Install the CMake 3.0 cross-platform make system, Git 2.1 distributed version control system, and Subversion 1.8 version control system:

sudo yum install cmake git subversion

Install the Xdebug PHP extension:

sudo yum install php-pecl-xdebug

The cURL PHP extension was previously installed along with the PHP preprocessor.

Restart the web server to load the additional PHP extension:

sudo systemctl restart httpd.service

Install the MkDocs Python package and its dependencies:

sudo yum install python python-jinja2 python-markdown python-pip python-watchdog PyYAML
sudo pip install mkdocs

Centos 7.0 and Red Hat Enterprise Linux 7.0

Important

These instructions enable the Extra Packages for Enterprise Linux repository.

TL;DR

Important

Substitute the name of the virtual host for “example.org” in these instructions.

These steps install and configure the requirements for development and a superset of the requirements for production:

sudo yum install epel-release
sudo yum update
sudo yum install cmake curl git httpd mariadb-server memcached nano php php-bcmath php-gd php-mysqlnd php-pdo php-pecl-memcached php-pecl-xdebug php-pgsql postgresql-server python python-jinja2 python-markdown python-pip PyYAML sqlite subversion
sudo pip install mkdocs
sudo mkdir -p /var/www/example.org/html
sudo chown $USER:$USER /var/www/example.org/html
echo -e "<VirtualHost *:80>\nServerAdmin webmaster@example.org\nServerName example.org\nServerAlias www.example.org\nDocumentRoot /var/www/example.org/html\nErrorLog \${APACHE_LOG_DIR}/error.log\nCustomLog \${APACHE_LOG_DIR}/access.log combined\n</VirtualHost>" | sudo tee -a /etc/httpd/conf.d/example.org.conf
sudo postgresql-setup initdb
sudo systemctl enable httpd.service
sudo systemctl enable mariadb.service
sudo systemctl enable memcached.service
sudo systemctl enable postgresql.service
sudo systemctl start httpd.service
sudo systemctl start mariadb.service
sudo systemctl start memcached.service
sudo systemctl start postgresql.service

Package Manager and Tools

Enable the Extra Packages for Enterprise Linux repository:

sudo yum install epel-release

Update the package database and upgrade all the packages on the system to the latest version:

sudo yum update

Install the cURL tool and the Nano editor:

sudo yum install curl nano

Web Server

Install the Apache 2.4 web server:

sudo yum install httpd

The mod_rewrite Apache module is enabled by default.

Install the PHP 5.4 preprocessor:

sudo yum install php

The mod_php5 Apache module is installed along with the PHP preprocessor.

Install the BC Math and GD PHP extensions:

sudo yum install php-bcmath php-gd

The JSON PHP extension was previously installed along with the PHP preprocessor.

Important

Substitute the name of the virtual host for “example.org” in these instructions.

Create a directory to hold the files of the virtual host:

sudo mkdir -p /var/www/example.org/html
sudo chown $USER:$USER /var/www/example.org/html

Note

The value of $DOCUMENT_ROOT in the general instructions will be /var/www/example.org/html.

Add the configuration of the virtual host:

sudo nano /etc/httpd/conf.d/example.org.conf

<VirtualHost *:80>
    ServerAdmin webmaster@example.org
    ServerName example.org
    ServerAlias www.example.org
    DocumentRoot /var/www/example.org/html
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Add the virtual host to your HOSTS file if the host name is not otherwise resolvable to your system:

echo "127.0.0.1 example.org" | sudo tee -a /etc/hosts

Enable and start the web server:

sudo systemctl enable httpd.service
sudo systemctl start httpd.service

Memory Caching System

Note

For development, the memory caching system is optional.

Install the Memcached 1.4 memory caching system:

sudo yum install memcached

Enable and start the memory caching system:

sudo systemctl enable memcached.service
sudo systemctl start memcached.service

Install the Memcached PHP extension:

sudo yum install php-pecl-memcached

Restart the web server to load the additional PHP extension:

sudo systemctl restart httpd.service

Database Server

Note

For production, install one of the database servers; for development, install all three.

MariaDB

Install the MariaDB 5.5 database server:

sudo yum install mariadb-server

MariaDB is a fork of MySQL.

Enable and start the MariaDB database server:

sudo systemctl enable mariadb.service
sudo systemctl start mariadb.service

Install the PDO_MYSQL PHP extension:

sudo yum install php-mysqlnd

This also installs the MySQL native driver for PHP.

Restart the web server to load the additional PHP extensions:

sudo systemctl restart httpd.service

PostgreSQL

Install the PostgreSQL 9.2 database server:

sudo yum install postgresql-server

Initialize the PostgreSQL database:

sudo postgresql-setup initdb

Enable and start the PostgreSQL database server:

sudo systemctl enable postgresql.service
sudo systemctl start postgresql.service

Install the PDO_PGSQL PHP extension:

sudo yum install php-pgsql

This also installs the PostgreSQL PHP extension.

Restart the web server to load the additional PHP extensions:

sudo systemctl restart httpd.service

SQLite

Install the SQLite 3.7 database program:

sudo yum install sqlite

Install the PDO_SQLITE PHP extension:

sudo yum install php-pdo

Restart the web server to load the additional PHP extension:

sudo systemctl restart httpd.service

Development Tools

Note

For production, the development tools are not required.

Install the CMake 2.8 cross-platform make system, Git 1.8 distributed version control system, and Subversion 1.7 version control system:

sudo yum install cmake git subversion

Install the Xdebug PHP extension:

sudo yum install php-pecl-xdebug

The cURL PHP extension was previously installed along with the PHP preprocessor.

Restart the web server to load the additional PHP extension:

sudo systemctl restart httpd.service

Install the MkDocs Python package and its dependencies:

sudo yum install python python-jinja2 python-markdown python-pip PyYAML
sudo pip install mkdocs