13

I want to install OSQA on a local Windows system. I've downloaded bitnami-djangostack-1.1.1-2-windows-installer.exe, which has django, python, mysql and apache built in.

I've run a django example given on the django website and it's working fine.

But I'm confused how to install OSAQ. I've downloaded the source code from the OSQA site and read the installation instructions (it requires django 1.1.1), but I can't make it work.

sth
  • 222,467
  • 53
  • 283
  • 367
Pankaj Khurana
  • 3,243
  • 10
  • 50
  • 79

6 Answers6

14
  1. Download http://svn.osqa.net/svnroot/osqa/trunk to a folder {OSQA_ROOT} eg, c:\osqa

  2. Rename {OSQA_ROOT}\settings_local.py.dist to {OSQA_ROOT}\settings_local.py

  3. set following in {OSQA_ROOT}\settings_local.py

    DATABASE_NAME = 'osqa'             # Or path to database file if using sqlite3.
    DATABASE_USER = 'root'               # Not used with sqlite3.
    DATABASE_PASSWORD = 'PASSWD'               # Not used with sqlite3.  put bitnami here
    DATABASE_ENGINE = 'mysql'  #mysql, etc
    
    • Default MySQL credentials in bitnami are: -u root -p bitnami

  4. add following {DJANGOSTACK}\apps\django\conf\django.conf, / means root folder like http://localhost

    <location '/'>
        SetHandler python-program
        PythonHandler django.core.handlers.modpython
        PythonPath "['{OSQA_ROOT}'] + sys.path"
        SetEnv DJANGO_SETTINGS_MODULE osqa.settings
        PythonDebug On
    </location>
    
  5. instasll markdown2 and html5lib with easy_install.exe, which is inside {DJANGOSTACK}\python\Scripts\

    easy_install markdown2
    easy_install html5lib
    
  6. create new db called osqa with mysqladmin.exe which is in {DJANGOSTACK}\mysql\bin

    mysqladmin create osqa
    
  7. syncdb

    {DJANGOSTACK}\python\python.exe manage.py syncdb
    
    • manage.py is in apps\django\django\conf\project_template as of 5/8/11
    • You must update settings.py with mysql, root, and bitnami (pw), and osqa as db name

  8. enjoy!

alt text http://img87.imageshack.us/img87/723/osqabitnamidjangostack.png

Note:

  • {OSQA_ROOT} => osqa trunk directory
  • {DJANGOSTACK} => BitNami DjangoStack install directory
Brian Webster
  • 30,033
  • 48
  • 152
  • 225
YOU
  • 120,166
  • 34
  • 186
  • 219
  • Hi mark thanks for replying but for step no 5 & 6 i have to execute the command through command prompt & for step 7 i have to execute through osqa_root? i have run the server through python osqa/manage.py runserver but still localhost does not show anything pls help – Pankaj Khurana May 03 '10 at 06:57
  • Pankaj Khurana, Yeah, 5 & 6 need to run through command prompt. step 7 does not need to be inside osqa_root folder, but need to run `manage.py syncdb` under that. – YOU May 03 '10 at 08:28
  • Hi Mark, for step 7 i meant running python osqa/manage.py syncdb under bitnami django stack project. When i started the server python osqa/manage.py runserver and typed http://localhost:8000 in the browser, its working now. Thanks for your help. Why is the url http://localhost:8000 instead of just http://localhost? Can you please help me figure out? – Pankaj Khurana May 03 '10 at 12:40
  • @Pankaj Khurana, you could just run `python osqa/manage.py runserver 80` for just `http://localhost` instead of default port 8000. Btw, manage.py runserver is running on built-in web server, you don't need apache and mod_python and its settings in step 4 for that case. – YOU May 04 '10 at 04:16
  • Hi mark thanks for the reply.Now i want to install osqa on a site hosted on host gator. Can you please tell me these steps will remain same or change as hosting company told us that python and django are pre configured but you have to put them in cgi-bin folder. Thanks – Pankaj Khurana May 10 '10 at 10:31
  • @Pankaj, could you check your hosting documents for that case? for example, like [this](http://support.hostgator.com/articles/django-with-fastcgi) because those configurations are quite different from running on normal pc. – YOU May 10 '10 at 11:21
  • @Pankaj, If fcgi is supported by your hosting you could refer this wiki from osqa.net - http://wiki.osqa.net/display/docs/Installing+OSQA+on+BlueHost+Using+fast-cgi – YOU May 10 '10 at 12:54
  • Hi Mark, thanks for your suggestions. With the help of hostgator, i have installed osqa on my server. But openid is not functioning at all. I have posted the issue on osqa.net but not received any reply till now. Can you please help me on this? – Pankaj Khurana May 18 '10 at 11:05
  • @Pankaj Khurana, I noticed that login with blogger and wordpress openid have some issues, which openid provider you are currenting trying? at least google and yahoo openid should work. you getting some error? how about setting debug = TRUE on settings.py or settings_local.py and if you get errors, post new questions to osqa.net or here in stackoverflow with some detail informations? – YOU May 18 '10 at 11:12
  • Hi mark i am getting Page not found (404) when i try to login through google acounts. In settings_local.py debug=true is already there & i have already posted on the osqa.net but i am not able to get any reply from there. – Pankaj Khurana May 18 '10 at 11:24
  • really, 404 is quite strange, may be some issues in urls.py – YOU May 18 '10 at 11:44
  • Step 6 gives error: forum.user: 'subscriptions' has an m2m relation wiht model Node, which has either not been installed or is abstract. Solution: easy_install.exe http://sourceforge.net/projects/python-markdown/files/markdown/2.0.3/Markdown-2.0.3.zip/download – James Jun 04 '10 at 01:41
  • Actually, I can't get the markdown module to work at all. "easy_install markdown2" works fine, but "easy_install markdown" fails, unless I specify a URL directly (see previous comment). Even after this, however, trying to access OSQA in my browser gives: ImproperlyConfigured: Error importing middleware forum.middleware.extended_user: "No module named markdown". Any suggestions? – James Jun 04 '10 at 01:49
  • @James, Yeah, I also noticed that some errors regarding markdown. But IIRC, I did `import markdown2 as markdown` and errors gone. but I still think they might need to fix, could you post it in osqa forum too? – YOU Jun 04 '10 at 01:58
  • i followed the instructions here and it worked however I get the following result. Blank contents for answers and questions.. I could edit the question though. Please check http://meta.osqa.net/questions/7882/no-text-showing-in-body-new-install-on-windows-xp – Aivan Monceller Apr 08 '11 at 11:39
  • I did `import markdown2 as markdown` and here is an error on my logs that keeps the body from displaying `markdown() got an unexpected keyword argument 'extensions'` – Aivan Monceller Apr 08 '11 at 12:32
6

You can download a Windows installer here:

http://bitnami.org/stack/osqa

Just tried it and it works great, the installer prompts for the information it needs and at the end it will launch the site, and it all just works! 10/10

musefan
  • 47,875
  • 21
  • 135
  • 185
4

Please check this very simple guide: Installing OSQA on Windows with IIS in production

Yaroslav
  • 1,241
  • 10
  • 13
1

http://meta.osqa.net/question/121/installing-osqa-on-windows-2008-server-with-iis7

user341312
  • 11
  • 1
1

I have just tried integrating OSQA with the latest version of Bitnami. Because mod_python.so is no longer included, I couldn't get step 4 as outlined by YOU above to work.

Instead, follow the Basic Configuration instructions from the Django documentation here to set up OSQA on Apache with mod_wsgi instead. As stated here, the mod_python project is dead so it would be worth switching to mod_wsgi anyway.

For the remainder of the setup, following the steps outlined by YOU should work fine.

taheris
  • 80
  • 7
  • Just a quick update to let you know we released a OSQA BitNami stack http://bitnami.org/stack/osqa, so no need to install manually :) – Daniel Lopez Aug 03 '11 at 08:43
1

As Sigma0 mentioned, mod_python is deprecated. Since version 1.2.3-0 the BitNami DjangoStack includes mod_wgsi. The latest version (released today) also includes the dependencies required for OSQA (markdown2, html2lib and also South, python-openid and ElementTree).

Today we have also released the full BitNami OSQA Stack. It is configured with PostgreSQL for getting all the benefits of the full text search that PostgreSQL provides. The stack includes Python 2.6, Apache with mod_wgsi, PosgreSQL 9.04, Django 1.3 and OSQA Fantasy Island 0.9. beta 3 (latest release).

After working on integrating OSQA in the BitNami Library I have a few comments on the steps provided in previous answers when installing on OSQA on top of BitNami Django Stack.

  • For security reasons it is recommended that each application use his own database and database user for accessing the database. That user should only have access to the application database. Click in the "Use DjangoStack" shortcut in the Windows Start Menu to open a windows console. On Windows Vista and above you will need to click it with the right mouse button and click in "Run as Administrator".

    {DJANGOSTACK}\mysql\bin\mysql -u root -pbitnami -e "create database osqa"

    {DJANGOSTACK}\mysql\bin\mysql -u root -pbitnami -e "grant all privileges on osqa.* to 'osqa_user'@'localhost' identify by 'osqa_user_password'

(NOTE: it is also a good practice to change the default password for the 'root' user :) )

  • If you are using BitNami DjangoStack 1.3-1 or above you don't need to install any python dependency. If you are using an older version you can execute the following from the command prompt:

    {DJANGOSTACK}\python\Scripts\easy_install.exe install South Markdown html5lib python-openid ElementTree.

  • Once you have created that database and user and download the code, you need to modify the setting_local.py. Notice that you will also need to set the right value in the APP_URL setting in that file. The default on Windows when using the BitNami DjangoStack would be APP_URL = 'http://127.0.0.1'

  • We recommend to keep the application apache configuration in a separate file. If {OSQA_ROOT} is the folder where the OSQA file exist, I recomend to create {OSQA_ROOT}/conf and {OSQA_ROOT}/scripts folders.

Copy osqa.wgsi.dist in {OSQA_ROOT}/scripts/osqa.wgsi and substitute the /path/to_dir_above and /path/to_dir_above/osqa with the right value.

Create {OSQA_ROOT}/conf/osqa.conf file (this will be the apache configuration file). The file should be similar to the below:


WSGIScriptAlias / '{OSQA_ROOT}/scripts/osqa.wsgi'

<Directory '{OSQA_ROOT}/scripts'>
   Order allow,deny
   Allow from all
</Directory>
<Directory '{OSQA_ROOT}/forum'>
   Order allow,deny
   Allow from all
</Directory>

Alias /admin_media/  "{DJANGOSTACK}/apps/django/django/contrib/admin/media"
Alias /m/ "{OSQA_ROOT}/forum/skins/"
Alias /upfiles/ "{OSQA_ROOT}/forum/upfiles/"
<Directory '/home/bitrock/osqa-0.9.0beta3-0D/apps/osqa/forum/skins'>
   Order allow,deny
   Allow from all
</Directory>

In {DJANGOSTACK}\apache2\conf\httpd.conf add the following line at the end:

Include "{OSQA_ROOT}/osqa/conf/osqa.conf"
  • Now you can run "{DJANGOSTACK}\python\python.exe manage.py syncdb --no-input" in the console and once you restart the services everything should be ready.
kaysa
  • 1,491
  • 13
  • 9