Skip to the content
Documentation

Installing Exponential on a Linux/UNIX based system

No ratings yet

A complete installation of Exponential 6 on Linux (or another UNIX-like system), from the PHP packages to a site served over HTTPS. Run the commands as the user who will own the site, not as root, unless a step says otherwise.

1. Install PHP and Composer

Red Hat Enterprise Linux 9, AlmaLinux 9, Rocky Linux 9:

sudo dnf install php php-fpm php-mysqlnd php-gd php-intl php-mbstring php-xml php-pdo php-opcache php-process

Debian and Ubuntu (replace 8.3 with the version your release ships):

sudo apt install php8.3-cli php8.3-fpm php8.3-xml php8.3-mbstring php8.3-intl php8.3-sqlite3 php8.3-gd php8.3-curl php8.3-opcache

Then install Composer 2 as described on getcomposer.org/download, and check: php -v, php -m, composer --version. The details: Requirements.

2. Get the code

cd /var/www
composer create-project se7enxweb/exponential example.com
cd example.com
php bin/php/console --version

The last command names the version, for example console (Exponential) 6.0.15stable. Composer also installs Exponential Velocity, the extensions and the class maps.

3. Prepare the database

For SQLite there is nothing to do: the database becomes a file under var/storage/sqlite3/. For a database server, create an empty database and a user first. MariaDB or MySQL, for example:

CREATE DATABASE exponential CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'exponential'@'localhost' IDENTIFIED BY 'a-long-secret';
GRANT ALL PRIVILEGES ON exponential.* TO 'exponential'@'localhost';

PostgreSQL needs the pgcrypto extension in the database (CREATE EXTENSION pgcrypto; by the owner or a superuser) when the installer cannot create it itself.

4. Install

Check first: without --apply, exp:install changes nothing, tests the database and the packages and ends with PASS or FAIL.

# SQLite
php bin/php/console exp:install --url=https://www.example.com --random-password
php bin/php/console exp:install --apply --url=https://www.example.com --random-password

# MariaDB or MySQL
EXP_INSTALL_DB_PASSWORD='a-long-secret' php bin/php/console exp:install --apply --db=mysql \
    --db-host=127.0.0.1 --db-name=exponential --db-user=exponential \
    --url=https://www.example.com --random-password

The summary names the site, admin and editor addresses (by default /site, /admin and /editor below the URL), the user admin and its password, which is also written to var/log/initial-admin-password. The installer writes the cron job into the crontab of the user that owns the installation. Every option: Normal installation.

5. Permissions

The user that runs PHP for the web (the PHP-FPM pool or the Velocity workers) must be able to write design, extension, settings and var. When that is not the user who ran Composer, hand the files over, or give both users a common group:

sudo chmod -R ug+rwx design extension settings var
sudo chown -R <web user>:<web group> design extension settings var

6. Serve the site

With Exponential Velocity, the recommended server (as root, for the ports below 1024):

php bin/php/console exp:velocity config set --apply ServerSettings Engine qbix --allow-root-user
php bin/php/console exp:velocity config set --apply ServerSettings Host 0.0.0.0 --allow-root-user
php bin/php/console exp:velocity config set --apply ServerSettings Port 80 --allow-root-user
php bin/php/console exp:velocity config set --apply ServerSettings HTTPSPort 443 --allow-root-user
php bin/php/console exp:velocity start --allow-root-user
php bin/php/console exp:velocity status --allow-root-user

HTTPS with your certificate, Apache or nginx instead of Velocity: Virtual host setup.

7. Sign in and check

curl -s -o /dev/null -w '%{http_code}\n' https://www.example.com/site/          # 200
curl -s -o /dev/null -w '%{http_code}\n' https://www.example.com/.git/config    # 404
php bin/php/console exp:installcrontab --show
tail var/log/error.log

Sign in at https://www.example.com/admin/user/login as admin, change the password at once (Change password in the user menu, at least 10 characters), and delete var/log/initial-admin-password. Then continue with After installing and Security hardening for production.

Contributors

Comments

Add a comment

Comments are read by a moderator before they appear.