Guides 11792 Published by

This guide walks you through installing Vanilla Forums on a brand‑new CentOS 8 server in under an hour using Apache, MariaDB and PHP 7.4 from Remi’s repository. It begins by updating the system, enabling EPEL and Remi, then installs and configures Apache, MariaDB, php-fpm, Composer and all necessary extensions. Next it creates a dedicated database user, sets file permissions for Apache, builds an Apache virtual host that forwards PHP requests to the php‑fpm socket, and restarts the services before launching the web installer. A brief troubleshooting note about opcache memory usage is added at the end, reminding users to check logs if their server stalls.



Install Vanilla Forums on CentOS 8 – The Quick & Dirty Way

If you’ve just dropped a brand‑new CentOS 8 server into your rack, this guide will get Vanilla Forums running in under an hour. We’ll use Apache, MariaDB, and PHP 7.4 from Remi’s repo. No unnecessary bells and whistles—just the essentials.

Prepare the system

1. Update everything – sudo dnf update -y

Keeps your OS stable and avoids weird dependency clashes later on.

2. Enable EPEL and Remi

   sudo dnf install epel-release -y
   sudo dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm -y

The vanilla stack needs PHP 7.4, which lives in the Remi repo on CentOS 8.

Install Apache, MariaDB and PHP
sudo dnf module enable php:remi-7.4 -y
sudo dnf install httpd mariadb-server php-fpm php-mysqlnd php-opcache composer -y

Apache is the webserver; MariaDB stores forum data; PHP‑fpm runs the code; Composer pulls Vanilla’s dependencies.

Configure PHP for Vanilla Forums

1. Edit /etc/php-fpm.d/www.conf and set listen = /run/php-fpm/www.sock.

The socket lets Apache talk to PHP‑fpm without using a network port.

2. Ensure php_admin_value[memory_limit] = 256M – Vanilla likes a decent memory pool.

Restart the pool: sudo systemctl restart php-fpm.

Create database and user
sudo mysql -u root -e "CREATE DATABASE vanilla DEFAULT CHARACTER SET utf8mb4;"
sudo mysql -u root -e "GRANT ALL PRIVILEGES ON vanilla.* TO 'vanilla_user'@'localhost' IDENTIFIED BY 'StrongPassword123';"

Vanilla will complain if it can’t talk to a database. Give it a dedicated user and the right privileges.

Download Vanilla Forums via Composer
cd /var/www/
sudo composer create-project vanilla/vanilla vanilla-forums

Composer does the heavy lifting: fetches the core, pulls in all PHP packages, and writes config.php. It also sets up the folder structure you’ll need to tweak.

Set file permissions
sudo chown -R apache:apache /var/www/vanilla-forums
sudo find /var/www/vanilla-forams -type d -exec chmod 755 {} \;
sudo find /var/www/vanilla-forums -type f -exec chmod 644 {} \;

Apache must own the files. Directories need execute rights for traversal; files can be read‑only.

Configure Apache virtual host

Create /etc/httpd/conf.d/vanilla.conf with:

<VirtualHost *:80>
    ServerName forum.example.com
    DocumentRoot /var/www/vanilla-forums

    <Directory "/var/www/vanilla-forums">
        AllowOverride All
        Require all granted
    </Directory>

    ProxyPassMatch ^/(.*\.php(/|$)) http://unix:/run/php-fpm/www.sock|/$1
</VirtualHost>

The ProxyPassMatch line forwards PHP files to the socket. The rest is standard Apache config.

Restart Apache: sudo systemctl enable --now httpd.

Final tweaks & restart services
sudo systemctl restart mariadb
sudo mysql -u root -p -e "FLUSH PRIVILEGES;"

Now point your browser at http://forum.example.com. The Vanilla installer will ask for database credentials—use the ones you just created. Follow the wizard, and you’re done.

A real‑world hiccup

I once had a CentOS 8 host that had PHP 7.3 from the default repo. Vanilla ran fine until I tried to enable opcache via php.ini. The server froze because opcache.memory_consumption was set too high for the container’s RAM. Lowering it to 128M and restarting fixed the issue in seconds.

If you hit a snag, check /var/log/httpd/error_log and /var/log/php-fpm/www-error.log; they usually give the straight answer—missing extension, wrong permissions, or a typo in config.php.