Askbot is a Question and Answer (Q&A) forum whose design is inspired by StackOverflow and YahooAnswers and other similar projects (to lesser extent).
Askbot is written in Python on top of Django_ platform. Code of Askbot grew out of CNPROG project originally written by Mike Chen and Sailing Cai.
If you have any questions installing or tweaking askbot - please do not hesitate to ask at the forum or email to admin@askbot.org.
To install and run Askbot the following are required:
For the production deployment you will also need a webserver capable to run python web applications (see section Deployment).
To simplify future deployment, please make sure to use the same python interpreter for the installation and testing as the one assigned (or will be assigned) to the webserver.
If you are using the easy_install tool, make sure that it was also originally installed with the python interpreter mentioned above, otherwise use the second method:
If you are planning to use askbot on Windows, please install mysql-python windows binary package manually.
Chances are that steps above will complete your installation. If so, then proceed to the Configuration section. Below are extra installation notes that cover some special cases.
To install in non-standard locations add parameter –prefix=/path/to/some/dir to both commands.
Askbot depends on about a dozen other packages. Normally those dependencies will be automatically resolved. However, if something does not go well - e.g. some dependency package site is not accessible, please download and install some of those things ( django-1.1.2, django-debug-toolbar, South, recaptcha-client, markdown2, html5lib, python-openid, django-keyedcache, django-threaded-multihost, mysql-python ) manually.
If any of the provided links do not work please try to look up those packages or notify askbot maintainers at admin@askbot.org.
and answer questions.
The startforum script will attempt to create necessary directories and copy files.
If you are creating a new Django project, you will need to edit file
In the case you are adding askbot to an existing Django project, you will need to merge askbot files settings.py and urls.py into your project files manually.
within single quotes - login credential to your mysql database. Assuming that the database exists, you can now install the tables by running:
python manage.py syncdb
python manage.py migrate forum
hostname -i is a Unix command returning the IP address of your system, you can also type the IP manually or replace it with localhost if you are installing askbot on a local machine.
Your basic installation is now complete. Many settings can be changed at runtime by following url /settings.
If you choose to host a real website, please read section Deployment. For advice on hosting Askbot, please take a look at section Hosting_.
If you know user name or the group name under which the webserver runs, you can make those directories writable by setting the permissons accordingly:
For example, if you are using Linux installation of apache webserver running under group name ‘apache’ you could do the following:
chown -R yourlogin:apache /path/to/askbot-site
chmod -R g+w /path/to/askbot-site/forum/upfiles
chmod -R g+w /path/to/askbot-site/log
If your account somehow limits you from running such commands - please consult your system administrator.
Apache/mod_wsgi combination is the only type of deployment described in this document at the moment. mod_wsgi is currently the most resource efficient apache handler for the Python web applications.
The main wsgi script is in the file django.wsgi it does not need to be modified
Settings below are not perfect but may be a good starting point:
WSGISocketPrefix /path/to/socket/sock #must be readable and writable by apache
WSGIPythonHome /usr/local #must be readable by apache
WSGIPythonEggs /var/python/eggs #must be readable and writable by apache
#NOTE: all urs below will need to be adjusted if
#settings.FORUM_SCRIPT_ALIAS !='' (e.g. = 'forum/')
#this allows "rooting" forum at http://example.com/forum, if you like
<VirtualHost ...your ip...:80>
ServerAdmin forum@example.com
DocumentRoot /path/to/askbot-site
ServerName example.com
#run mod_wsgi process for django in daemon mode
#this allows avoiding confused timezone settings when
#another application runs in the same virtual host
WSGIDaemonProcess askbot
WSGIProcessGroup askbot
#force all content to be served as static files
#otherwise django will be crunching images through itself wasting time
Alias /m/ /path/to/askbot-site/forum/skins/
Alias /upfiles/ /path/to/askbot-site/forum/upfiles/
<Directory /path/to/askbot-site/forum/skins>
Order deny,allow
Allow from all
</Directory>
#this is your wsgi script described in the prev section
WSGIScriptAlias / /path/to/askbot-site/django.wsgi
#this will force admin interface to work only
#through https (optional)
#"nimda" is the secret spelling of "admin" ;)
<Location "/nimda">
RewriteEngine on
RewriteRule /nimda(.*)$ https://example.com/nimda$1 [L,R=301]
</Location>
CustomLog /var/log/httpd/askbot/access_log common
ErrorLog /var/log/httpd/askbot/error_log
</VirtualHost>
#(optional) run admin interface under https
<VirtualHost ..your ip..:443>
ServerAdmin forum@example.com
DocumentRoot /path/to/askbot-site
ServerName example.com
SSLEngine on
SSLCertificateFile /path/to/ssl-certificate/server.crt
SSLCertificateKeyFile /path/to/ssl-certificate/server.key
WSGIScriptAlias / /path/to/askbot-site/django.wsgi
CustomLog /var/log/httpd/askbot/access_log common
ErrorLog /var/log/httpd/askbot/error_log
DirectoryIndex index.html
</VirtualHost>
Database can be prepared via your hosting control panel, if available or can be created manually (provided that you have a mysql account with a sufficient privilege)
where dbname, dbuser and dbpassword should be replaced with the real values. MySQL will create a user with those credentials if it does not yet exist.
There are routine tasks that should be performed periodically from the command line. They can be automated via cron jobs
File askbot_cron_job has a sample script that can be run say hourly
The script currently does two things: (1) sends delayed email alerts and (2) awards badges. These two actions can be separated into two separate jobs, if necessary
Sitemap to your forum will be available at url /<settings.FORUM_SCRIPT_ALIAS>sitemap.xml e.g yoursite.com/forum/sitemap.xml or yoursite.com/sitemap.xml
Google will be pinged each time question, answer or comment is saved or a question deleted.
If you register you sitemap through Google Webmasters Tools Google will have be indexing your site more efficiently.