在 Windows(本地系统)上安装 OSQA

发布于 2024-08-31 08:10:55 字数 247 浏览 8 评论 0原文

我想在本地 Windows 系统上安装 OSQA。我已经下载了 bitnami-djangostack-1.1.1-2-windows-installer.exe,它内置了 django、python、mysql 和 apache。

我已经运行了 django 网站上给出的 django 示例,它工作正常。

但我很困惑如何安装 OSAQ。我已经从 OSQA 网站下载了源代码并阅读了安装说明(它需要 django 1.1.1),但我无法使其工作。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

烟花易冷人易散 2024-09-07 08:10:55
  1. 下载http://svn.osqa.net/svnroot/osqa/trunk到文件夹 {OSQA_ROOT} 例如,c:\osqa

  2. {OSQA_ROOT}\settings_local.py.dist 重命名为 {OSQA_ROOT}\settings_local.py

  3. {OSQA_ROOT}\settings_local.py

    中设置以下内容

    DATABASE_NAME = 'osqa' # 如果使用 sqlite3,则为数据库文件的路径。
    DATABASE_USER = 'root' # 不与 sqlite3 一起使用。
    DATABASE_PASSWORD = 'PASSWD' # 不与 sqlite3 一起使用。将比特纳米放在这里
    DATABASE_ENGINE = 'mysql' #mysql 等
    
    • bitnami 中的默认 MySQL 凭据为:-u root -p bitnami
  4. 添加以下{DJANGOSTACK}\apps\django\conf\django.conf/表示根文件夹,例如http://localhost< /代码>

    <位置'/'>
        SetHandler python 程序
        PythonHandler django.core.handlers.modpython
        PythonPath "['{OSQA_ROOT}'] + sys.path"
        SetEnv DJANGO_SETTINGS_MODULE osqa.settings
        Python调试打开
    
    

  5. insstasll markdown2 和 html5lib 以及 easy_install.exe,位于 {DJANGOSTACK}\python\Scripts\

    easy_install markdown2
    Easy_install html5lib
    
  6. 创建名为 osqa 的新数据库与位于 {DJANGOSTACK}\mysql\bin

    中的 mysqladmin.exe

    mysqladmin 创建 osqa
    
  7. syncdb

    {DJANGOSTACK}\python\python.exe manage.pysyncdb
    
    • manage.py 截至 2011 年 5 月 8 日位于 apps\django\django\conf\project_template
    • 您必须使用 mysql、root 和 bitnami (pw) 以及 osqa 作为数据库名称来更新 settings.py
  8. 享受!

替代文本 http://img87.imageshack.us/img87/723/osqabitnamidjangostack.png

注意:

  • {OSQA_ROOT} => osqa 主干目录
  • {DJANGOSTACK} => BitNami DjangoStack 安装目录
  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
梦里人 2024-09-07 08:10:55

您可以在此处下载 Windows 安装程序:

http://bitnami.org/stack/osqa

刚刚尝试过,效果很好,安装程序会提示输入所需的信息,最后它将启动该网站,一切正常! 10/10

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

最佳男配角 2024-09-07 08:10:55

请查看这个非常简单的指南:在带有 IIS 的 Windows 上安装 OSQA生产

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

过气美图社 2024-09-07 08:10:55

我刚刚尝试将 OSQA 与最新版本的 Bitnami 集成。因为 mod_python.so 不再包含在内,所以我无法按照您上面概述的步骤 4 进行工作。

相反,请按照此处中的 Django 文档中的基本配置说明进行设置使用 mod_wsgi 在 Apache 上启动 OSQA。正如此处所述,mod_python 项目已经死了,所以无论如何还是值得切换到 mod_wsgi 。

对于其余的设置,按照您概述的步骤进行操作应该可以正常工作。

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.

调妓 2024-09-07 08:10:55

正如 Sigma0 提到的,mod_python 已被弃用。从版本 1.2.3-0 开始,BitNami DjangoStack 包含 mod_wgsi。最新版本(今天发布)还包括 OSQA 所需的依赖项(markdown2、html2lib 以及 South、python-openid 和 ElementTree)。

今天我们还发布了完整的 BitNami OSQA 堆栈。它配置了 PostgreSQL,以获得 PostgreSQL 提供的全文搜索的所有好处。该堆栈包括 Python 2.6、带有 mod_wgsi 的 Apache、PosgreSQL 9.04、Django 1.3 和 OSQA Fantasy Island 0.9。 beta 3(最新版本)。

在将 OSQA 集成到 BitNami 库 中之后,我对在 OSQA 上安装时先前答案中提供的步骤有一些评论位于 BitNami Django Stack 之上。

  • 出于安全原因,建议每个应用程序使用自己的数据库和数据库用户来访问数据库。该用户应该只能访问应用程序数据库。单击 Windows 开始菜单中的“使用 DjangoStack”快捷方式打开 Windows 控制台。在 Windows Vista 及更高版本上,您需要使用
    鼠标右键并单击“以管理员身份运行”。

    {DJANGOSTACK}\mysql\bin\mysql -u root -pbitnami -e "创建数据库 osqa"

    {DJANGOSTACK}\mysql\bin\mysql -u root -pbitnami -e "将 osqa.* 上的所有权限授予 'osqa_user'@'localhost' 标识为 'osqa_user_password'

(注意:更改 'root' 用户的默认密码也是一个好习惯:))

  • 如果您使用的是 BitNami DjangoStack 1.3-1 或更高版本,则不需要要安装任何 python 依赖项,如果您使用的是旧版本,您可以从命令提示符执行以下命令:

    {DJANGOSTACK}\python\Scripts\easy_install.exe 安装 South Markdown html5lib
    python-openid ElementTree。

  • 创建数据库和用户并下载代码后,您需要修改setting_local.py。请注意,您还需要在该文件的 APP_URL 设置中设置正确的值。使用 BitNami DjangoStack 时,Windows 上的默认设置为 APP_URL = 'http://127.0.0.1'

  • 我们建议将应用程序 apache 配置保存在单独的文件中。如果 {OSQA_ROOT} 是 OSQA 文件所在的文件夹,我建议创建 {OSQA_ROOT}/conf 和 {OSQA_ROOT}/scripts 文件夹。

复制 {OSQA_ROOT}/scripts/osqa.wgsi 中的 osqa.wgsi.dist 并将 /path/to_dir_above 和 /path/to_dir_above/osqa 替换为正确的值。

创建 {OSQA_ROOT}/conf/osqa.conf 文件(这将是 apache 配置文件)。该文件应类似于以下内容:


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>

在 {DJANGOSTACK}\apache2\conf\httpd.conf 末尾添加以下行:

Include "{OSQA_ROOT}/osqa/conf/osqa.conf"
  • 现在您可以运行“{DJANGOSTACK} \python\python.exe manage.pysyncdb --no-input" 在控制台中,一旦重新启动服务,一切都应该准备就绪。

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.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文