How to Install and Configure AskBot on CentOS / Ubuntu / Debian

How to Install and Configure AskBot on CentOS 7 / RHEL 7 / Ubuntu 16.04 / Debian 8. 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. This project is funded by open source community like Document Foundation to support the development of Askbot.

AskBot has a responsive layout works with all of the devices and Professional Design. The Source code of AskBot is available at Github known as askbot-devel. It is scalable and works with all large projects with ease.This guide includes setup of AskBot using NGINX Web Server with Gunicorn module, PostgreSQL Database Server, required library packages and Python modules that is required. In order to accomplish the task you need to follow all the steps carefully.

Prerequisites

To follow this tutorial, you will need:

  1. A VPS with minimum 1GB RAM.
  2. A normal user account with sudo privileges.

Step-1 (Install the required packages )

For CentOS / RHEL

Install EPEL Repository

[[email protected] ~]$ sudo yum install epel-release

Install Required packages

[[email protected] ~]$ sudo yum install python-pip python-devel postgresql-server postgresql-devel postgresql-contrib gcc nginx
For Ubuntu / Debian

Update the repositories

[[email protected] ~]$ sudo apt-get update

Install Required packages

[[email protected] ~]$ sudo apt-get install python-pip python-dev python-flup libpq-dev postgresql postgresql-contrib nginx zlib1g-dev libpng-dev libjpeg-dev gunicorn supervisor python-setuptools

Step-2 (PostgreSQL Database Configuration)

For CentOS / RHEL

Start the PostgreSQL services

[[email protected] ~]$ sudo systemctl start postgresql

Switch to postgres prompt

[[email protected] ~]$ sudo su - postgres

Enter to the PostgreSQL prompt

[[email protected] ~]$ psql
For Ubuntu / Debian

Enter to the PostgreSQL prompt

[[email protected] ~]$ sudo -u postgres psql

Step-3 (Create PostgreSQL Database)

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

postgres=# CREATE DATABASE techbrown;

We will create a database user techbrownuser which we will use to to interact with the PostgreSQL database. Ensure that Password is strong.

postgres=# CREATE USER techbrownuser WITH PASSWORD 'techbrownpassword';

We’ll set UTF-8 for the database this is required by Askbot.

postgres=# ALTER ROLE techbrownuser SET client_encoding TO 'utf8';

Now, grant all privileges to DB user techbrownuser to techbrown database

postgres=# GRANT ALL PRIVILEGES ON DATABASE techbrown TO techbrownuser;

Exit from PostgreSQL prompt

postgres=# \q

Step-4 (AskBot Installation)

Change the Directory where Askbot is to be installed

[[email protected] ~]$ cd /home/techbrown

Now, Install the Python setup tools

[[email protected] ~]$ sudo easy_install -U setuptools

Now, upgrade the Python PIP packages

[[email protected] ~]$ sudo pip install --upgrade pip

Install Askbot using PIP Installation methods

[[email protected] ~]$ sudo pip install askbot psycopg2 gunicorn

After that install the Askbot on current directory

[[email protected] ~]$ sudo askbot-setup

Step-5 (AskBot Configuration)

Now collect all files into base directory location.

[[email protected] ~]$ sudo python manage.py collectstatic

Now we can synchronize the data structures to PostgreSQL database.

[[email protected] ~]$ sudo python manage.py syncdb

Allow the port 9999 to firewall

[[email protected] ~]$ sudo ufw allow 9999

Finally it’s time to run the AskBot development server on port 9999. which checks and ensures that everything works fine:

[[email protected] ~]$ sudo python manage.py runserver 198.59.10.11:9999

Now Askbot appears in your browser.

1

 

Finally hit on Please sign in button

2

Create a new account at the site this will be your administrator account

3

Now bind the Askbot site to successfully run with gunicorn

[[email protected] ~]$ sudo gunicorn --bind 198.59.10.11:9999 wsgi:application

After that the Askbot site is successfully works with browser

5

Reference : AskBot official site: https://askbot.com

Conclusion

In this guide, we have installed and configured Askbot Question and Answer Forum using NGINX web server, Gunicorn module, PostgreSQL, Python Packages, etc. Askbot makes useful for Question Answer forums that allowing you use all its innovative features with ease. You can easily implement the AskBot project to your Question and Answer site by using all the steps above.

Related Post

Develop New SysAdmin Skills with E-books (FREE Download)