{"id":1277,"date":"2012-07-06T17:02:21","date_gmt":"2012-07-06T13:02:21","guid":{"rendered":"http:\/\/sandalov.org\/blog\/?p=1277"},"modified":"2012-07-17T13:08:25","modified_gmt":"2012-07-17T09:08:25","slug":"osqa-install-experience","status":"publish","type":"post","link":"https:\/\/sandalov.org\/blog\/1277\/","title":{"rendered":"OSQA install experience"},"content":{"rendered":"<div class=\"2d836d85a73757df15d0de19d7bef594\" data-index=\"1\" style=\"float: none; margin:10px 0 10px 0; text-align:center;\">\n<script type=\"text\/javascript\"><!--\r\ngoogle_ad_client = \"ca-pub-2287684400845931\";\r\n\/* valerymorozov *\/\r\ngoogle_ad_slot = \"5606708872\";\r\ngoogle_ad_width = 728;\r\ngoogle_ad_height = 90;\r\n\/\/-->\r\n<\/script>\r\n<script type=\"text\/javascript\"\r\nsrc=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\">\r\n<\/script>\n<\/div>\n<p>OSQA is an opensource Q\/A engine. In this article I&#8217;ll describe the way I installed it on my VPS.<\/p>\n<p>I like Debian\/Ubuntu OS. Debian lacks new packages, that&#8217;s why I chose Ubuntu 12.04 LTS.<\/p>\n<h3>Act 1. Lighttpd<\/h3>\n<p>I had Lighttpd installed on my machine, so firstly I tried to install OSQA on Lighttpd. Googling around I found that running OSQA in fcgi mode is not OK (when you have a VPS). WSGI is the right way. Unfortunately, Lighttpd&#8217;s WSGI is very unstable, <a href=\"http:\/\/projects.unbit.it\/uwsgi\/wiki\/RunOnLighttpd\" target=\"_blank\">experimental<\/a> and unsupported. That&#8217;s why I decided to move to nginx.<\/p>\n<h3>Act 2. nginx<\/h3>\n<p>Django projects <a href=\"http:\/\/stackoverflow.com\/questions\/2591715\/deploying-django-fastcgi-apache-mod-wsgi-uwsgi-gunicorn\" target=\"_blank\">are great<\/a> with pure WSGI servers. So I decided to install nginx with WSGI server (uWSGI, GUnicorn, etc.). Spending 3 days, writing LOTS of site blocks, tuning nginx, messing around with <a href=\"http:\/\/wsgi.readthedocs.org\/en\/latest\/servers.html\" target=\"_blank\">various WSGI servers<\/a>, I finally switched to Apache.<\/p>\n<h3>Act 3. Apache<\/h3>\n<p>My Apache\/Ubuntu way was as described in <a href=\"http:\/\/wiki.osqa.net\/display\/docs\/Ubuntu+with+Apache+and+MySQL\" target=\"_blank\">article on meta.osqa.com<\/a>. After doing the steps I received <a href=\"http:\/\/meta.osqa.net\/questions\/11626\/what-causes-these-500-server-errors-ubuntu-1004-django-14\">500 errors as well as this<\/a>:<\/p>\n<pre>\r\nMiddleware module \"django.middleware.csrf\" does not \r\ndefine a \"CsrfResponseMiddleware\" class\r\n<\/pre>\n<p>OSQA is <a href=\"http:\/\/meta.osqa.net\/questions\/11832\/compatibility-with-django-14\" target=\"_blank\">not compatible<\/a> with Django 1.4.0, but works OK in 1.3.1. Check your version:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\npython\r\n&gt;&gt;&gt; import django\r\n&gt;&gt;&gt; django.VERSION\r\n<\/pre>\n<p>If necessary install 1.3.1:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsudo easy_install django==1.3.1\r\n<\/pre>\n<h3>P.S.<\/h3>\n<p>In my spare time I&#8217;ll continue playing with nginx + uWSGI (or gunicorn), I think it&#8217;s the best way of running OSQA.<\/p>\n<div class=\"2d836d85a73757df15d0de19d7bef594\" data-index=\"1\" style=\"float: none; margin:10px 0 10px 0; text-align:center;\">\n<script type=\"text\/javascript\"><!--\r\ngoogle_ad_client = \"ca-pub-2287684400845931\";\r\n\/* valerymorozov *\/\r\ngoogle_ad_slot = \"5606708872\";\r\ngoogle_ad_width = 728;\r\ngoogle_ad_height = 90;\r\n\/\/-->\r\n<\/script>\r\n<script type=\"text\/javascript\"\r\nsrc=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\">\r\n<\/script>\n<\/div>\n\n<div style=\"font-size: 0px; height: 0px; line-height: 0px; margin: 0; padding: 0; clear: both;\"><\/div>","protected":false},"excerpt":{"rendered":"<p>OSQA is an opensource Q\/A engine. In this article I&#8217;ll describe the way I installed it on my VPS. I like Debian\/Ubuntu OS. Debian lacks new packages, that&#8217;s why I chose Ubuntu 12.04 LTS. Act 1. Lighttpd I had Lighttpd installed on my machine, so firstly I tried to install &hellip; <a class=\"continue-reading-link\" href=\"https:\/\/sandalov.org\/blog\/1277\/\"> Continue reading <span class=\"meta-nav\">&rarr; <\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[118,52],"tags":[266,267,264,265,263,379,268],"class_list":["post-1277","post","type-post","status-publish","format-standard","hentry","category-linux-2","category-ubuntu","tag-apache","tag-debian","tag-lighttpd","tag-nginx","tag-osqa","tag-ubuntu","tag-vps"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/posts\/1277","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/comments?post=1277"}],"version-history":[{"count":2,"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/posts\/1277\/revisions"}],"predecessor-version":[{"id":1332,"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/posts\/1277\/revisions\/1332"}],"wp:attachment":[{"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/media?parent=1277"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/categories?post=1277"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/tags?post=1277"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}