How To Install Askbot on CentOS 7

Askbot is a question and answer web forum and it looks like StackOverflow Q&A web forums. It is based on Django web framework and written in Python programming language. It is an open source Q&A web forum project maintained and developed by Evgeny Fadeev.Some most popular open source projects like Ask-Fedora and Ask-LibreOffice uses the AskBot to provide support for their users and clients.

Table of Contents

Step 1. First let’s start by ensuring your system is up-to-date.

Step 2. Installing Dependencies Askbot.

Step 3. Installing PostgreSQL.

Step 4. Create Database For Askbot.

Step 5. Installing Askbot.

Prerequisites

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation Askbot on a CentOS 7 server.
Install Askbot on CentOS 7

Step 1. First let’s start by ensuring your system is up-to-date.

yum clean all
yum -y update

Step 2. Installing Dependencies Askbot.

Install required packages:

yum group install 'Development Tools'
yum install epel-release
yum install python-pip python-devel python-six

Step 3. Installing PostgreSQL.

Askbot uses PostgreSQL as database system to store its data, so install it executing the following command:

yum install postgresql-server postgresql-devel postgresql-contrib

Start postgres and enable it to launch automatically at the boot time:

postgresql-setup initdb
systemctl start postgresql
systemctl start postgresql

Step 4. Create Database For Askbot.

First of all we will create a database techbrown for AskBot project:

postgres=# create database askbotdb;
postgres=# create user askbotusr with password 'usr_strong_passwd';
postgres=# grant all privileges on database askbotdb to askbotusr;

The next step is to edit the postgres configuration for authentication setup, which you can do by heading to the ‘pgsql/data’ directory and editing the ‘pg_hba.conf’ file with nano:

nano /var/lib/pgsql/data/pg_hba.conf

Once inside the file, change all authentication to md5, as shown below:

local all all md5
 # IPv4 local connections:
 host all all 127.0.0.1/32 md5
 # IPv6 local connections:
 host all all ::1/128 md5

Save, close the file and restart PostgreSQL:

systemctl restart postgresql

Step 5. Installing Askbot.

We will install Askbot under a user named ‘askbot’, and using the virtualenv python. So let’s begin:

useradd -m -s /bin/bash askbot
passwd askbot

Next, add this new user to the wheel group:

usermod -a -G wheel askbot

Upgrade pip to the latest version:

pip install --upgrade pip

Next, install the virtualenv package:

pip install virtualenv six

Log in as the askbot user previously created, and create a new virtual environment with virtualenv:

su - askbot
virtualenv wpcademy/

Activate this new virtual environment, by executing the following command:

source wpcademy/bin/activate

Next, install Askbot and other required packages with pip:

pip install six askbot psycopg2

Next, create a new directory for the ‘Askbot’ project. Please make sure you don’t use ‘askbot’ as the directory name:

mkdir testing

Initialize a new Askbot project by executing the following commands:

cd testing
askbot-setup

So Askbot is now installed on the ‘testing directory. Now we need to generate Askbot Django static files and the database. Run the command below to generate Askbot Django static files:

python manage.py collectstatic

Generate the database:

python manage.py syncdb

So, Askbot has been installed and the testing project configured. Test it with runserver:

python manage.py runserver 0.0.0.0:8080

With a web browser, go to the server IP address, and you should see a forum page.

Congratulation’s! You have successfully installed Askbot. Thanks for using this tutorial for installing Askbot on your CentOS 7 system. For additional help or useful information, we recommend you to check the official Askbot web site.

Leave a Reply