MQ-Jr
MQ-Jr
unixcop Admin

How to Install Vanila Forum on CentOS 8

Introduction

Vanilla is a Canadian software company founded in 2009 in Montreal, Quebec, Canada. It is both a cloud-based (SaaS) community forum software and an open source community supported software. The company’s main product is Vanilla Cloud.

Its open source product, Vanilla OSS, is a lightweight Internet forum package written in the PHP scripting language using the Garden framework. The software is released under the GNU GPL. Vanilla Forums is free software, standards-compliant, customizable discussion forums. Since 2009 there is also a cloud-hosted version (offered by Vanilla).

Installation

Just follow the steps below:

  • So Install php, php-fpm and its modules
dnf instal php php php-mysqlnd php-opcache php-xml php-xmlrpc php-gd php-mbstring php-json php-fpm php-curl php-pear php-openssl php-intl unzip -y
  • Start and enable php-fpm.
 systemctl start php-fpm
 systemctl enable php-fpm
  • Install nginx and start it.
dnf install nginx -y && systemctl start nginx
  • Install, start and enable mariadb.
dnf install -y mariadb mariadb-server && systemctl start mariadb && systemctl enable mariadb
  • Configure MariaDB Database and secure your MariaDB.
mysql_secure_installation
  • Answer all questions as shown below
Enter current password for root (enter for none):
Set root password? [Y/n] Y
New password:
Re-enter new password:
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y
  • log in to the MariaDB shell
mysql -u root -p
  • Create database and database user then grant all privileges.
CREATE DATABASE vanilla_db CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE USER 'vanilla_usr'@'localhost' IDENTIFIED BY 'unixcopPassword';
GRANT ALL PRIVILEGES ON vanilla_db.* TO 'vanilla_usr'@'localhost';
FLUSH PRIVILEGES;
\q;
  • Download Vanilla Forum.
wget https://open.vanillaforums.com/get/vanilla-core-3.3.zip

You can download the latest vanilla-forum from the official website.

Note: The latest product maintained by the Vanilla Forums staff and core team.

  • unzip the downloaded file.
unzip vanilla-core-3.3.zip
  • Move the extracted directory to the Nginx web root directory.
mv package /var/www/html/vanilla
  • Set the ownership of vanilla directory to Nginx
chown -R nginx:nginx /var/www/html/vanilla
  • Configure PHP-FPM Pool, you can do it by editing the file /etc/php-fpm.d/www.conf
vim /etc/php-fpm.d/www.conf
  • Change the following lines to nginx.
user = nginx
group = nginx
  • create a session directory for PHP and change its ownership
mkdir -p /var/lib/php/session
chown -R nginx:nginx /var/lib/php/session
  • Restart the PHP-FPM service
systemctl restart php-fpm
  • Configure Nginx for Vanilla by creating Nginx virtual host file.
vim /etc/nginx/conf.d/vanilla.conf
  • Then add the following lines
server {

  listen 80;
  server_name vanilla.unixcop.com;
  root /var/www/html/vanilla;
  index index.php;

  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(/|$) {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    try_files $fastcgi_script_name =404;
    set $path_info $fastcgi_path_info;
    fastcgi_param PATH_INFO $path_info;
    fastcgi_index index.php;
    include fastcgi.conf;
    fastcgi_param SCRIPT_NAME /index.php;
    fastcgi_param SCRIPT_FILENAME $realpath_root/index.php;
    fastcgi_param X_REWRITE 1;
    fastcgi_pass unix:/var/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;
  }

}
  • Restart the Nginx service
systemctl restart nginx
  • Allow port 80 and 443 on the firewall.
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
rewall-cmd --reload
  • Also you will need to configure SELinux for Vanilla forum
setsebool httpd_can_network_connect on -P
chcon -R -u system_u -t httpd_sys_rw_content_t -r object_r /var/www/html/vanilla
  • Access Vanilla Forum by opening your web browser and visit the URL https://vanilla.unixcop.com.
  • Provide your Database info and other required inputs then click continue.
  • you should see the Vanilla dashboard as shown above.

Conclusion

In this installation guide, we illustrated how to install Vanilla-Forums on CentOS 8.

That’s all. Thank you.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest articles

Join us on Facebook