Vanilla Forum Installation on CentOS 7 with PHP 7.1

Vanilla Forum is a PHP-based open-source forum platform. It’s fully customizable, user-friendly, and supports plugins and themes. With the ability to install responsive themes, it adjusts to various screen sizes, or you can develop your own theme to match your site design.

Vanilla offers Single Sign-On (SSO) via WordPress, jQuery, SAML, or OAuth. Additionally, social login functionality can be set up using providers like Google, Facebook, or Twitter. Integration is straightforward with tools like WordPress, MailChimp, Zendesk, GitHub, Salesforce, and others.

This documentation is tailored for Vanilla Forums version 2.3, though it may be compatible with later versions as well.

Prerequisites

  • One CentOS 7 server instance.
  • A user with sudo privileges.
  • Throughout this guide, the domain forum.example.com will be used. Replace it with your actual domain name in practice.

Start by updating your base system using the tutorial “How to Update CentOS 7.” After completing the system update, continue by installing the necessary packages.

Step 1: Install Apache

Begin by installing the Apache web server.

Start the Apache service and configure it to launch on system boot.

sudo systemctl start httpd
sudo systemctl enable httpd

Step 2: Install PHP 7.1

For optimal security and reliability, PHP version 7.1 will be used. First, enable the Remi repository.

sudo rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-7.rpm
sudo yum -y install yum-utils
sudo yum-config-manager --enable remi-php71

Install the latest PHP version along with the modules required for Vanilla Forum.

sudo yum -y install php php-gd php-mysqli php-mbstring php-curl php-cli php-pear php-devel php-openssl

Step 3: Install and Configure MariaDB

MariaDB, a MySQL-compatible database, will be used in this setup. Since the default YUM repository contains an outdated version not supported by Vanilla, you’ll need to add the official MariaDB repository manually.

Create the MariaDB YUM repository file using the command below:

echo "[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.2/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1" | sudo tee /etc/yum.repos.d/mariadb.repo

Next, install MariaDB using the following command:

sudo yum -y install mariadb mariadb-server

Start MariaDB and set it to launch automatically when the system boots:

sudo systemctl start mariadb
sudo systemctl enable mariadb

Before creating the database, it’s important to secure your MariaDB installation:

sudo mysql_secure_installation

When prompted for the current root password, just press Enter since there is no password set by default. Then, assign a secure root password and answer Y to all subsequent prompts.

To proceed, log into the MariaDB shell as root:

After entering the root password, run the following SQL commands to create the database and user for the Vanilla Forum application:

CREATE DATABASE vanilla_data CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE USER 'vanilla_user'@'localhost' IDENTIFIED BY 'StrongPassword';
GRANT ALL PRIVILEGES ON vanilla_data.* TO 'vanilla_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;

You are free to replace vanilla_data and vanilla_user with names of your choice. Make sure to choose a strong password instead of StrongPassword.

Step 4: Install Vanilla Forum

Start by downloading the compressed archive of Vanilla Forum.

wget https://open.vanillaforums.com/get/vanilla-core.zip

Install the unzip utility if it is not already present on your system:

Extract the contents of the archive into the web root directory:

sudo unzip vanilla-core.zip -d /var/www/vanilla

Update file ownership so that Apache has proper permissions:

sudo chown -R apache:apache /var/www/vanilla

Step 5: Configure Firewall Access

Enable HTTP and HTTPS traffic through the system firewall:

sudo firewall-cmd --zone=public --permanent --add-service=http
sudo firewall-cmd --zone=public --permanent --add-service=https
sudo firewall-cmd --reload

Step 6: Set Up Virtual Host

Create a virtual host configuration file for your forum domain:

sudo nano /etc/httpd/conf.d/forum.example.com.conf

Insert the following configuration into the file:

<VirtualHost *:80>
    ServerName forum.example.com
    DocumentRoot /var/www/vanilla
    <Directory /var/www/vanilla>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>
</VirtualHost>

Restart Apache for the changes to take effect:

sudo systemctl restart httpd

Wrapping Up

You have now successfully installed and configured Vanilla Forum. Open your browser and go to http://forum.example.com to begin the setup process. Fill in your database credentials and administrator account details. Once completed, the setup will store the necessary configurations in your database and redirect you to the admin panel. You can now proceed to personalize your forum as needed.

Conclusion

Setting up Vanilla Forum on CentOS 7 with Apache, PHP 7.1, and MariaDB provides a robust and scalable discussion platform. With theme and plugin support, integration options, and SSO capabilities, Vanilla is ideal for building modern community forums. After completing this guide, your forum is ready for use and further customization to match your project’s needs.

Source: vultr.com

Create a Free Account

Register now and get access to our Cloud Services.

Posts you might be interested in: