How to Setup Vanilla Forum on Ubuntu 18.04 Server

Vanilla is a popular cloud-based web application that offers reliable forum solutions for communities around the world. The powerful discussion software is packed with premium features and has an active team of developers that keeps it up to date.

If you are looking for the best forum solution that loads with lightning speed, Vanilla is an excellent solution for your needs. The software is easy to set up and run.

In this guide, we will show you how to set up Vanilla on your Ubuntu 18.04 VPS or dedicated server with Apache, MySQL server, and PHP scripting language.

Prerequisite

  • A VPS plan running Ubuntu 18.04 server
  • A non-root user with sudo-privileges

Step 1: Installing Apache

Before you begin, you need to have a group of open source software applications that are necessary to run a web server. These include Linux, Apache web server, MySQL, and PHP.

Your VPS plan should be provisioned with Ubuntu 18.04 Linux distribution. Then, SSH to your VPS server and update the package repository. To do this, use the command below:

$ sudo apt-get update

Then, install the Apache web server by running the command below:

$ sudo apt-get install apache2

Press Y and hit Enter when prompted to confirm the installation

Vanilla forum runs with mod_rewrite enabled. This module enables URL rewriting. To enable it, run the command below:

$ sudo a2enmod rewrite

In order for .htaccess file to work, you need to edit the default Apache Virtual Host configuration file;

$ sudo nano /etc/apache2/sites-available/000-default.conf

Add the text highlighted in red towards the end of the file just before the </VirtualHost> closing tag

<VirtualHost>...
<Directory /var/www/html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>

Then, copy the default .htaccess.dist file to .htaccess using the command below:

$ sudo cp /var/www/html/.htaccess.dist /var/www/html/.htaccess

Restart Apache:

$ sudo systemctl restart apache2

Step 2: Installing MySQL

Vanilla forum stores data in MySQL/MariaDb. We are going to use MySQL in this guide. To install the database server, run the command below:

$ sudo apt-get install mysql-server

Press Y and hit Enter when prompted to confirm the installation.

The default installation of MySQL database server is not secure. We need to run the command below to remove test databases, disable anonymous/remote logins and enhance the strength of passwords used for users:

$ sudo mysql_secure_installation

You will be asked a series of questions. We have prepared the correct responses that you should enter on each prompt:

$ Enable validate password Plugin? Y
$ Validation Policy Level: 2
$ Root Password: Enter password here
$ Re-enter password: Repeat password here
$ Continue with the Password provided? Y
$ Remove anonymous users? Y
$ Disallow root login remotely? Y
$ Remove test database and access to it? Y
$ Reload privileges tables now? Y

You should get a success message at the end.

Step 3: Creating Vanilla Forum Database and User

MySQL server is now set up and ready to use. We will go ahead and create a database for the Vanilla forum. First, log in to the MySQL server using the command below:

$ sudo mysql -uroot -p

Enter the root password that you setup when securing MySQL server and hit Enter to login to the MySQL command line terminal.

Next, run the SQL command below to create a database:

mysql> Create database vanilla CHARACTER SET utf8 COLLATE utf8_general_ci;

The database will be accessed via privileged user. To create one, run the command below:

mysql>Create user  'vanilla_user'@'localhost' IDENTIFIED BY 'PASSWORD';

As always, use a strong value for the password.Then, grant all privileges on the ‘vanilla’ database that we created above to our user:

mysql>Grant all privileges on vanilla.* to  'vanilla_user'@'localhost';

Reload privileges for the changes to take effect

mysql> flush privileges;

You can now exit from MySQL command line tool:

mysql>exit;

Step 4: Installing PHP

Vanilla forum is written in PHP. So to make it work, we need to install this popular server side scripting language. Run the commands below to do this:

$ sudo apt-get install php

Press Y and hit Enter when prompted to confirm the installation

We also need to install all PHP modules that are required by Vanilla forum. Run the command below:

$ sudo apt-get install libapache2-mod-php php-gd php-mysql php-mbstring php-curl php-cli php-pear php-dev

Press Y and hit Enter when prompted to confirm the installation

PHP installation should be completed in a while. Then, run the command below to restart Apache

$ sudo systemctl restart apache2

Step 5: Downloading Vanilla Forum

We now have a web server, MySQL database, and PHP scripting language. We can now go ahead and download Vanilla forum.

We will use wget Linux command to do this. Before, this, navigate to the tmp directory. This will ensure that unnecessary files that we are using for installing will be deleted when the system reboots

$cd /tmp

Next, download the file:

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

After a few seconds, ‘vanilla-core.zip’ will be downloaded on the working directory:

Then, install the unzip utility:

$ sudo apt-get install unzip

Next, unzip the archive file (‘vanilla-core.zip’) to the root of the web server using the commands below:

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

Apache installation has a default index.html at the root of the directory, you should delete it with the command below since it will override index.php file that comes with Vanilla Forum:

$ sudo rm /var/www/html/index.html

Step 6: Finalizing the Installation

Visit your server public IP address or domain name on a web browser:

http://ip_address_or_domain_name

How to Setup Vanilla Forum on Ubuntu 18.04 Server

You can now provide admin and database details that you created above to finalize the installation. The setup wizard will finish Vanilla Forum installation and you will be taken to a dashboard where you can login and manage your forum.

How to Setup Vanilla Forum on Ubuntu 18.04 Server

Conclusion

In this guide, we have taken you through the steps of installing Vanilla Forum on your Ubuntu 18.04 server. We started with installing Apache web server, went ahead and install MySQL and finalized by installing PHP scripting language. You can now start promoting your discussion forum and invite new members to your website.

Check out these top 3 VPS services:

Was this article helpful?