How to install Vanilla Forum on Fedora 29

How to install Vanilla Forum on Fedora 29

Vanilla is a free open source discussion forum written in PHP. Vanilla forum software is distributed under the GNU GPL2 license. Its source code is available on Github. It has a rich add-on system that you can use to add custom features in the Vanilla forum. The vanilla forum content can be written in Markdown. In this tutorial, we will complete the installation and setup of the Vanilla Forum on Fedora 29 by using Nginx as the web server and MySQL as the database server, and you can choose to use acme.sh client and Let’s Encrypt certificate authority to protect Transport layer adds SSL support.

Claim

Vanilla requires a server with PHP, MySQL, and web server software (such as Apache or NGINX). You may need to have a domain, and if you are installing on a production server, you have already configured it with DNS on the server, but if not, you don’t need a domain.

The minimum requirements for the vanilla forum are:

  • PHP 7.0 or higher.
  • PHP extensions mbstring, cURL, GD and PDO, MySQLi, OpenSSL.
  • MySQL 5.0 or higher (or Percona / MariaDB equivalent).
  • Web server software (Nginx, Apache …).
  • MySQL strict mode is disabled.

The Vanilla Forum strongly recommends:

  • PHP version 7.2 or higher.
  • PHP extensions mbstring, cURL, GD and PDO, MySQLi, OpenSSL.
  • MySQL 5.7 or higher (or Percona / MariaDB equivalent).
  • Web server software (Nginx, Apache …).
  • SSL encryption.

note: PHP 7.0 has reached the end of its useful life and will no longer receive security patches, so it is highly recommended to use a newer PHP version. Vanilla support for PHP 7.0 is coming to an end!

prerequisites

  • An operating system running Fedora 29.
  • A non-root user with sudo privileges.

Preliminary steps

Check your Fedora system version:

cat /etc/fedora-release# Fedora release 29 (Twenty Nine)

Set time zone:

timedatectl list-timezonessudo timedatectl set-timezone 'Region/City'

Update your operating system package (software). This is an important first step because it ensures that you have the latest updates and security fixes for the operating system’s default packages:

sudo dnf upgrade -y

Install some basic packages that are required for basic management of the Fedora operating system:

sudo dnf install -y curl wget vim git sudo zip unzip socat bash-completion

Step 1-install PHP and necessary PHP extensions

Install PHP and necessary PHP extensions:

sudo dnf install -y php-cli php-fpm php-common php-mbstring php-curl php-gd php-mysqlnd php-json

To display PHP compiled in the module, run:

php -mctypecurlexiffileinfo. . .. . .

Check PHP version:

php --version# PHP 7.2.16 (cli) (built: Mar  5 2019 11:05:59) ( NTS )# Copyright (c) 1997-2018 The PHP Group# Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

Start and enable the PHP-FPM service:

sudo systemctl start php-fpm.servicesudo systemctl enable php-fpm.service

We can move on to the next step, which is database installation and setup.

Step 2-install MariaDB and create database for Vanilla forum

The Vanilla forum supports MySQL, MariaDB and Percona databases. In this tutorial, we will use MariaDB as the database server.

Install MariaDB by running the following command:

sudo dnf install -y mariadb-server

Check MariaDB version:

mysql --version# mysql  Ver 15.1 Distrib 10.3.12-MariaDB, for Linux (x86_64) using readline 5.1

Start and enable MariaDB service:

sudo systemctl start mariadb.servicesudo systemctl enable mariadb.service

Run mysql_secure installation Script to improve MariaDB security and set MariaDB password root user:

sudo mysql_secure_installation

Answer each question:

Enter current password for root (enter for none): Press EnterSet root password? [Y/n] YNew password: your_secure_passwordRe-enter new password: your_secure_passwordRemove anonymous users? [Y/n] YDisallow root login remotely? [Y/n] YRemove test database and access to it? [Y/n] YReload privilege tables now? [Y/n] Y

Connect to MariaDB Shell as root user:

sudo mysql -u root -p# Enter password

Create an empty MariaDB database and user for the Vanilla forum and remember the credentials:

MariaDB [(none)]> CREATE DATABASE dbname;MariaDB [(none)]> GRANT ALL ON dbname.* TO 'username' IDENTIFIED BY 'password';MariaDB [(none)]> FLUSH PRIVILEGES;

Exit from MariaDB:

MariaDB [(none)]> exit

Replace dbname, username with password Use your own name.

Step 3-Installation acme.sh Client and get “Let’s Encrypt” certificate (optional)

You don’t have to use HTTPS to protect your website, but it is a good habit to protect your website traffic. In order to obtain a TLS certificate from Let’s Encrypt, we will use the acme.sh client. Acme.sh is a pure UNIX Shell software for obtaining TLS certificates from Let’s Encrypt with zero dependencies.

Download and install acme.sh:

sudo su - rootgit clone https://github.com/Neilpang/acme.sh.gitcd acme.sh ./acme.sh --install --accountemail [email protected]source ~/.bashrccd ~

Check the acme.sh version:

acme.sh --version# v2.8.0

Gain RSA with ECC / ECDSA Your domain / hostname certificate:

# RSA 2048acme.sh --issue --standalone -d example.com --keylength 2048# ECDSAacme.sh --issue --standalone -d example.com --keylength ec-256

If you want to test with a fake certificate, you can add --staging Mark the above command.

After running the above command, your certificate and key will be located at:

  • For RSA: /home/username/example.com table of Contents.
  • For ECC / ECDSA: /home/username/example.com_ecc table of Contents.

To list the certificates you issued, you can run:

acme.sh --list

Create a directory to store your certificates. We will use /etc/letsencrypt table of Contents.

mkdir -p /etc/letsecnrypt/example.comsudo mkdir -p /etc/letsencrypt/example.com_ecc

Install / copy the certificate into the / etc / letsencrypt directory.

# RSAacme.sh --install-cert -d example.com --cert-file /etc/letsencrypt/example.com/cert.pem --key-file /etc/letsencrypt/example.com/private.key --fullchain-file /etc/letsencrypt/example.com/fullchain.pem --reloadcmd "sudo systemctl reload nginx.service"# ECC/ECDSAacme.sh --install-cert -d example.com --ecc --cert-file /etc/letsencrypt/example.com_ecc/cert.pem --key-file /etc/letsencrypt/example.com_ecc/private.key --fullchain-file /etc/letsencrypt/example.com_ecc/fullchain.pem --reloadcmd "sudo systemctl reload nginx.service"

All certificates will be automatically renewed every 60 days.

After obtaining the certificate, log out from the root user and return to the normal sudo user:

exit

Step 4-install NGINX and configure NGINX for vanilla forum

The Vanilla forum works with many popular web server software. In this tutorial, we chose NGINX. If you prefer Apache web server over NGINX, visit https://docs.vanillaforums.com/developer/backend/server-apache/ understand more.

Download and install NGINX from the Fedora repository:

sudo dnf install -y nginx

Check NGINX version:

nginx -v# nginx version: nginx/1.14.2

Start and enable the NGINX service:

sudo systemctl start nginx.servicesudo systemctl enable nginx.service

Configure NGINX for Vanilla by running:

sudo vim /etc/nginx/conf.d/vanilla.conf

And populate the file with the following configuration:

server {  listen 80;  listen 443 ssl http2;  server_name example.com;  root /var/www/vanilla;  index index.php;  # RSA  ssl_certificate /etc/letsencrypt/example.com/fullchain.pem;  ssl_certificate_key /etc/letsencrypt/example.com/private.key;  # ECC/ECDSA  ssl_certificate /etc/letsencrypt/example.com_ecc/fullchain.pem;  ssl_certificate_key /etc/letsencrypt/example.com_ecc/private.key;  location ~* /.git { deny all; return 403; }  location /build/ { deny all; return 403; }  location /cache/ { deny all; return 403; }  location /cgi-bin/ { deny all; return 403; }  location /uploads/import/ { deny all; return 403; }  location /conf/ { deny all; return 403; }  location /tests/ { deny all; return 403; }  location /vendor/ { deny all; return 403; }  location ~* ^/index.php(/|$) {    include default.d/php.conf;    fastcgi_param SCRIPT_NAME /index.php;    fastcgi_param SCRIPT_FILENAME $realpath_root/index.php;    fastcgi_param X_REWRITE 1;    fastcgi_pass unix:/run/php-fpm/www.sock;  }  location ~* .php(/|$) {    rewrite ^ /index.php$uri last;  }  location / {    try_files $uri $uri/ @vanilla;  }  location @vanilla {    rewrite ^ /index.php$uri last;  }}

note: Vanilla access for complete and production-ready Nginx configuration https://docs.vanillaforums.com/developer/backend/server-nginx/.

Check the NGINX configuration for syntax errors:

sudo nginx -t

Reload the NGINX service:

sudo systemctl reload nginx.service

Step 5-install vanilla forum

Create the document root directory where the Vanilla forum should reside:

sudo mkdir -p /var/www/vanilla

Change ownership /var/www/vanilla Directory to {jour_user}:

sudo chown -R {your_user}:{your_user} /var/www/vanilla

note:replace{jour_user} Use the non-root user username you originally created.

Navigate to the document root:

cd /var/www/vanilla

Download Vanilla Forum zip archive:

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

Extract and delete Vanilla zip archive:

unzip vanilla-core-2.8.1.ziprm vanilla-core-2.8.1.zipmv vanilla-2.8.1/* . && mv vanilla-2.8.1/.* .

Provide proper ownership:

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

Run sudo vim /etc/php-fpm.d/www.conf And set users and groups to nginx. Initially, they will be set to apache:

sudo vim /etc/php-fpm.d/www.conf# user = nginx# group = nginx

Navigate to the folder where Vanilla was uploaded in your web browser and follow the on-screen instructions.

Step 6-Complete the installation and setup of the Vanilla Forum

After opening the website in a web browser, you should be redirected to the following page:

Fill in the required information and click “Continue →” Button to complete the installation and setup. After that, the Vanilla forum management interface will appear.

Vanilla Forum on Ubuntu 18.04 LTS

Sidebar