Install miniBB forum on CentOS 7

minibbminiBB or Mini Bulletin Board is a PHP based standalone, open source program for building your own Internet forums. In this tutorial we will install miniBB on a CentOS 7 VPS with Apache, PHP and MariaDB.

Log in to your CentOS server via SSH as user root

ssh rooot@your_IP

and first of all make sure that all packages installed on your server are up to date:

yum -y update

miniBB requires and empty database, so we will have to install a database server. Run the following command to install MariaDB server:

yum install mariadb mariadb-server

Start the MariaDB database server and enable it to start at the boot time:

systemctl start mariadb
systemctl enable mariadb

Run the ‘mysql_secure_installation’ script to secure the database server and set your MariaDB root password.

Log in to the MariaDB server using the MySQL ‘root’ user and create new database and user for miniBB:

mysql -u root -p

CREATE DATABASE minibb;
CREATE USER 'minibbuser'@'localhost' IDENTIFIED BY 'PASSWORD';
GRANT ALL PRIVILEGES ON `minibb`.* TO 'minibbuser'@'localhost';
FLUSH PRIVILEGES;

Don’t forget to replace ‘PASSWORD’ with a strong password.

Install Apache web server

yum install httpd

Start the web server and add it to automatically start on the system start-up:

systemctl start httpd
systemctl enable httpd

miniBB is a PHP based application and it requires PHP. So, install PHP on your server:

yum install php php-common

Download the latest stable release of miniBB forum from their official website. At the moment of writing this article it is version 3.2.1.

Unpack the downloaded zip archive to the document root directory on your server:

unzip minibb.zip -d /var/www/html

If you are not sure where is your document root directory you can use the following command to find out:

grep -i '^documentroot' /etc/httpd/conf/httpd.conf
DocumentRoot "/var/www/html"

Change the ownership of the miniBB files:

chown -R apache:apache /var/www/html/minibb

Now, open the ‘setup_options.php’ file which contains almost every common option of miniBB. We will enter the information of the MySQL database we created in this post and create a new administrator user.

Need a fast and easy fix?
✔ Unlimited Managed Support
✔ Supports Your Software
✔ 2 CPU Cores
✔ 2 GB RAM
✔ 50 GB PCIe4 NVMe Disk
✔ 1854 GeekBench Score
✔ Unmetered Data Transfer
NVME 2 VPS

Now just $43 .99
/mo

GET YOUR VPS
vim /var/www/html/minibb/setup_options.php

$DBhost='localhost';
$DBname='minibb';
$DBusr='minibbuser';
$DBpwd='PASSWORD';
$admin_usr = 'ADMIN_USR';
$admin_pwd = 'ADMIN_PASSWORD';
$admin_email = 'admin@yourdomain.com';
$main_url='http://yourdomain.com';

More information about the options available in the configuration file you can find at miniBB’s official website

Next, create Apache virtual host for your domain. Create ‘/etc/httpd/conf.d/vhosts.conf’ file with the following content

vim /etc/httpd/conf.d/vhosts.conf

IncludeOptional vhosts.d/*.conf

and create the virtual host

vim /etc/httpd/vhosts.d/yourdomain.com.conf

<VirtualHost YOUR_SERVER_IP:80>
ServerAdmin webmaster@yourdomain.com
DocumentRoot "/var/www/html/minibb/"
ServerName yourdomain.com
ServerAlias www.yourdomain.com
ErrorLog "/var/log/httpd/yourdomain.com-error_log"
CustomLog "/var/log/httpd/yourdomain.com-access_log" combined

<Directory "/var/www/html/minibb/">
DirectoryIndex index.html index.php
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

Restart the Apache web server for the changes to take effect.

systemctl restart httpd

Now, navigate your favorite web browser to http://yourdomain.com/_install.php to finish the miniBB installation.

Of course you don’t have to do any of this if you use one of our Linux VPS Hosting services, in which case you can simply ask our expert Linux admins to install miniBB for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

12 thoughts on “Install miniBB forum on CentOS 7”

  1. I can’t create the virtual host although i’m root. What happend???
    “/etc/httpd/vhosts.d/domain” E212: Can’t open file for writing.

    Reply
      • I didn’t get your point. I wasn’t be able to create that file, how could i give you the output of it? When i exit using :wq it said “E212: Can’t open file for writing.”
        Let me tell you a little:
        I’m running one instance Amazon EC2 with centos7 installed and one public IP attached to it. i don’t have any domain.
        Here’s the work-flow.
        1.Login to my server with root account using Tera Term software.
        2.Install mariadb and create database, username, password for minibb.
        3.Install apache, php….
        4.Download minibb.zip file (201kb) from homepage to local machine.
        5. Use WinSCP to transfer zip file from local machine into my server.
        6. Extract zip file into /var/www/html foldera and give permission to apache:apache.
        chown -R apache:apache /var/www/html (In my case, it didn’t create the minibb folder so i couldn’t follow your command: chown -R apache:apache /var/www/html/minibb)
        In setup_options.php, at $main_url line i input my IP because i don’t have any domain.
        7. Create vhosts.conf: vim /etc/httpd/conf.d/vhosts.conf with this content
        IncludeOptional vhosts.d/*.conf
        8. Create mydomain.conf: vi /etc/httpd/vhosts.d/mydomain.conf
        and paste the following content.

        ServerAdmin my-email@gmail.com
        DocumentRoot “/var/www/html/”
        ServerName My-server-ip

        DirectoryIndex index.html index.php
        Options FollowSymLinks
        AllowOverride All
        Require all granted

        That’s it.

        Reply
          • It didn’t work. Here’s the output when using that command.
            tee: /etc/httpd/vhosts.d/mydomain.conf: No such file or directory

            shell returned 1

            Press ENTER or type command to continue

            So i think it could be something wrong with the vhosts.conf or something because even root user couldn’t do that,

          • Here’s the content of error_log under /var/log/httpd directory. At first i thought it was related to Selinux so i turned it off and reboot Centos, but seems like it still didn’t work.

            [Mon Feb 22 07:42:25.323571 2016] [core:notice] [pid 3051] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
            [Mon Feb 22 07:42:25.324360 2016] [suexec:notice] [pid 3051] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
            [Mon Feb 22 07:42:25.334042 2016] [auth_digest:notice] [pid 3051] AH01757: generating secret for digest authentication …
            [Mon Feb 22 07:42:25.334707 2016] [lbmethod_heartbeat:notice] [pid 3051] AH02282: No slotmem from mod_heartmonitor
            [Mon Feb 22 07:42:25.336763 2016] [mpm_prefork:notice] [pid 3051] AH00163: Apache/2.4.6 (CentOS) configured — resuming normal operations
            [Mon Feb 22 07:42:25.336780 2016] [core:notice] [pid 3051] AH00094: Command line: ‘/usr/sbin/httpd -D FOREGROUND’
            [Mon Feb 22 10:11:22.682534 2016] [mpm_prefork:notice] [pid 3051] AH00170: caught SIGWINCH, shutting down gracefully
            [Tue Feb 23 00:55:15.150138 2016] [core:notice] [pid 787] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
            [Tue Feb 23 00:55:15.154493 2016] [suexec:notice] [pid 787] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
            [Tue Feb 23 00:55:15.220581 2016] [auth_digest:notice] [pid 787] AH01757: generating secret for digest authentication …
            [Tue Feb 23 00:55:15.221548 2016] [lbmethod_heartbeat:notice] [pid 787] AH02282: No slotmem from mod_heartmonitor
            [Tue Feb 23 00:55:15.247298 2016] [mpm_prefork:notice] [pid 787] AH00163: Apache/2.4.6 (CentOS) configured — resuming normal operations
            [Tue Feb 23 00:55:15.247316 2016] [core:notice] [pid 787] AH00094: Command line: ‘/usr/sbin/httpd -D FOREGROUND’
            [Tue Feb 23 01:01:24.581766 2016] [cgi:error] [pid 853] [client 61.160.213.56:2552] script not found or unable to stat: /var/www/cgi-bin/chs
            [Tue Feb 23 01:12:27.688607 2016] [mpm_prefork:notice] [pid 787] AH00170: caught SIGWINCH, shutting down gracefully
            [Tue Feb 23 01:12:28.743265 2016] [core:notice] [pid 2449] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
            [Tue Feb 23 01:12:28.744034 2016] [suexec:notice] [pid 2449] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
            [Tue Feb 23 01:12:28.764673 2016] [auth_digest:notice] [pid 2449] AH01757: generating secret for digest authentication …
            [Tue Feb 23 01:12:28.765356 2016] [lbmethod_heartbeat:notice] [pid 2449] AH02282: No slotmem from mod_heartmonitor
            [Tue Feb 23 01:12:28.775153 2016] [mpm_prefork:notice] [pid 2449] AH00163: Apache/2.4.6 (CentOS) PHP/5.4.16 configured — resuming normal operations
            [Tue Feb 23 01:12:28.775174 2016] [core:notice] [pid 2449] AH00094: Command line: ‘/usr/sbin/httpd -D FOREGROUND’
            [Tue Feb 23 01:12:48.953689 2016] [:error] [pid 2454] [client 203.174.65.44:25114] PHP Fatal error: Call to undefined function mysqli_connect() in /var/www/html/setup_mysqli.php on line 8
            [Tue Feb 23 01:16:10.038339 2016] [cgi:error] [pid 2451] [client 61.160.213.247:1260] script not found or unable to stat: /var/www/cgi-bin/chs
            [Tue Feb 23 01:18:18.151256 2016] [mpm_prefork:notice] [pid 2449] AH00170: caught SIGWINCH, shutting down gracefully
            [Tue Feb 23 01:19:30.626149 2016] [suexec:notice] [pid 787] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
            [Tue Feb 23 01:19:30.761893 2016] [auth_digest:notice] [pid 787] AH01757: generating secret for digest authentication …
            [Tue Feb 23 01:19:30.762447 2016] [lbmethod_heartbeat:notice] [pid 787] AH02282: No slotmem from mod_heartmonitor
            [Tue Feb 23 01:19:30.849851 2016] [mpm_prefork:notice] [pid 787] AH00163: Apache/2.4.6 (CentOS) PHP/5.4.16 configured — resuming normal operations
            [Tue Feb 23 01:19:30.849880 2016] [core:notice] [pid 787] AH00094: Command line: ‘/usr/sbin/httpd -D FOREGROUND’
            [Tue Feb 23 01:19:47.916820 2016] [mpm_prefork:notice] [pid 787] AH00170: caught SIGWINCH, shutting down gracefully
            [Tue Feb 23 01:19:48.968037 2016] [suexec:notice] [pid 2300] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
            [Tue Feb 23 01:19:48.988740 2016] [auth_digest:notice] [pid 2300] AH01757: generating secret for digest authentication …
            [Tue Feb 23 01:19:48.989256 2016] [lbmethod_heartbeat:notice] [pid 2300] AH02282: No slotmem from mod_heartmonitor
            [Tue Feb 23 01:19:49.001363 2016] [mpm_prefork:notice] [pid 2300] AH00163: Apache/2.4.6 (CentOS) PHP/5.4.16 configured — resuming normal operations
            [Tue Feb 23 01:19:49.001400 2016] [core:notice] [pid 2300] AH00094: Command line: ‘/usr/sbin/httpd -D FOREGROUND’
            [Tue Feb 23 01:19:55.860394 2016] [:error] [pid 2305] [client 203.174.65.44:23178] PHP Fatal error: Call to undefined function mysqli_connect() in /var/www/html/setup_mysqli.php on line 8

            Could you please take a look at it and tell me what happend?

Leave a Comment