2

I'm trying to deploy Askbot on a shared host with Hostgator, without success. The Askbot documentation talks about changing settings on the webserver, which I obviously cannot do as it is a shared web host.

I initially tried deploying with fcgi, which to my knowledge is the only thing that would work on Hostgator. My .htaccess and index.fcgi are below, but unfortunately I could not make it work yet.

.htaccess

AddHandler fcgid-script .fcgi
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.fcgi/$1 [QSA,L]

index.fcgi

#!/opt/python27/bin/python2.7
import sys, os, user
from django.core.servers.fastcgi import runfastcgi

# Add a custom Python path. (optional)
sys.path.insert(0, "/home/vnaut/django/projects/project")

# Switch to the directory of your project.
os.chdir("/home/vnaut/django/projects/project")

# Set the DJANGO_SETTINGS_MODULE environment variable.
os.environ['DJANGO_SETTINGS_MODULE'] = "project.settings"

from django.core.servers.fastcgi import runfastcgi
runfastcgi(method="threaded", daemonize="false")

Has anyone had success deploying Askbot on shared hosting? Could you anyone out there share? Many thanks.

valuenaut
  • 303
  • 2
  • 4
  • 13

2 Answers2

1

I've successfully deployed Askbot before but it involved a VPS that where I could run nginx, postgresql, and the django app under uwsgi. I have no idea what Host Gator provides for your tier of hosting. Here's some important questions to answer first:

  1. Can you run a django web app in your hosting plan? There are a number of ways to do this, most using wsgi. I've had the best luck with uwsgi.

  2. What database will you use? Django supports a number of databases but PostgreSql and MySQL are the most common open-source, well-supported options. I've had the best luck with PostgreSQL.

  3. What will you use to serve your site's static assets (e.g. images, css, javascript)? There are a lot of webservers out there: Apache, Nginx, Lighttpd, etc. I've had the best luck with nginx.

You need to answer all these questions before you can deploy Askbot.

Paul Young
  • 81
  • 2
  • Thanks Paul, here are my answers: (1) I did manage to run a very simply django app, just a test one through an index.fcgi file. I'm a beginner on web deployment so I can't understand everything behind the scenes, but it worked. (2) I'm just using SQLite, the simplest of them all, and Askbot supports it. (3) I just found out my websever with HG is nginx 1.6.1. – valuenaut Sep 01 '14 at 07:41
  • BTW, on (3) I haven't really thought about how to serve the site's static assets yet. – valuenaut Sep 01 '14 at 07:48
  • The notes on the askbot page you link mostly describe how to configure the webserver. That's probably something you need to work with your host on. The four things they're doing there are: (1) setup the wsgi connection (fcgi is another option you can use with django, look at flup) (2) pointing the webserver at the static files location (3) pointing the webserver at the uploaded files location and (4) configuring SSL. – Paul Young Sep 01 '14 at 16:57
  • Thanks Paul. But because it's a shared hosting plan, I would not have access to configure the webserver. I guess I need to dig and understand a little more of Django deployment in wcgi, fcgi, etc. For me this is still not too clear in my mind. Thanks anyway. – valuenaut Sep 02 '14 at 04:43
0

Just to share, I decided to try OSQA on Webfaction instead. It has been cumbersome and I still have not succeded to deploy Askbot, and wasted a lot of time on it. The instructions come from a post that makes it a breeze to get it up and running on Webfaction.

Community
  • 1
  • 1
valuenaut
  • 303
  • 2
  • 4
  • 13