Windows下ReviewBoard安装与配置

安装准备

安装文件清单

安装步骤

1. 安装Mysql

安装完成后,注意修改默认编码格式为UTF-8

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
show variables like 'character%';

#显示如下信息
+--------------------------+---------------------------------------------------------+
| Variable_name | Value |
+--------------------------+---------------------------------------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | C:\Program Files\MySQL\MySQL Server 5.6\share\charsets\ |
+--------------------------+---------------------------------------------------------+

2. 安装Apache

完成后确认在Windows服务中启动并且在浏览器中输入localhost检查是否启动正常。

3. 安装Python

注意要把python27和python27/scripts目录放到环境变量中

4. 安装mod_python-3.3.1.win32-py2.7.exe

注意:安装mod_python的时候,需要停掉apache,安装后请检查apache的modules目录下是否有mod_python.so,如果没有请检查安装是否过程是否有问题

5. 安装py27-pysvn-svn1811-1.7.10-1584.exe

6. 安装setuptools-0.6c11.win32-py2.7.exe

7. 安装patch-2.5.9-7-setup.exe

8. 安装memcached

1
2
3
4
5
6
#1.解压memcached-win64-1.4.4-14.zipE:\Tools\memcached

#2.进入E:\Tools\memcached

#3.执行命令,安装memcached为系统服务
memcached.exe -d install

9. 安装python-memcached

1
2
3
4
#1. 解压python-memcached-latest.tar.gz

#2. 执行安装命令
python setup.py install

10. 安装MySQL-python-1.2.5.win32-py2.7.exe

11. 安装pycrypto-2.6.1.win32-py2.7.exe

解决编译安装时出现以下错误:

1
2
3
4
5
6
7
8
9
10
Downloading https://pypi.python.org/packages/source/p/pycrypto/pycrypto-2.6.1.ta
r.gz#md5=55a61a054aa66812daf5161a0d5d7eda
Processing pycrypto-2.6.1.tar.gz
Running pycrypto-2.6.1\setup.py -q bdist_egg --dist-dir c:\users\ch\appdata\loca
l\temp\easy_install-sby0sc\pycrypto-2.6.1\egg-dist-tmp-wvzthp
warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.

gcc: error: unrecognized command line option '-mno-cygwin'
error: Setup script exited with error: command 'C:\\cygwin64\\bin\\gcc.exe' fail
ed with exit status 1

12. 安装ReviewBoard

1
2
3
4
5
#执行命令
easy_install ReviewBoard

#安装指定版本ReviewBoard
easy_install "ReviewBoard<2.0"

ReviewBoard配置

1. 创建数据库及用户名

1
2
3
4
5
6
7
8
#创建数据库
create database reviewboard character set utf8;

#创建用户(下面会用到)
create user 'reviewboard'@'localhost' identified by 'reviewboard';

#给用户授权
grant all privileges on reviewboard.* to 'reviewboard'@'localhost';

2. 创建站点

1
2
3
4
# 执行命令
rb-site install e:\tools\reviews

#按要求填写相关要素即可

3. Apache配置

  • add mod_python.so 到httpd.conf中
    LoadModule python_module modules/mod_python.so

  • add mod_wsgi-win32-ap22py27-3.3.so 到httpd.conf中
    LoadModule wsgi_module modules/mod_wsgi-win32-ap22py27-3.3.so

  • 将e:\tools\reviews\conf\apache-wsgi.conf内容添加到 vhosts到httpd-vhosts.conf中

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    <VirtualHost *:84>
    ServerName reviews.com
    DocumentRoot "E:/Tools/reviews/htdocs"

    # Error handlers
    ErrorDocument 500 /errordocs/500.html

    WSGIPassAuthorization On
    WSGIScriptAlias "/" "E:/Tools/reviews/htdocs/reviewboard.wsgi/"

    <Directory "E:/Tools/reviews/htdocs">
    AllowOverride All
    Options -Indexes +FollowSymLinks
    Allow from all
    </Directory>

    # Prevent the server from processing or allowing the rendering of
    # certain file types.
    <Location "/media/uploaded">
    SetHandler None
    Options None

    AddType text/plain .html .htm .shtml .php .php3 .php4 .php5 .phps .asp
    AddType text/plain .pl .py .fcgi .cgi .phtml .phtm .pht .jsp .sh .rb

    <IfModule mod_php5.c>
    php_flag engine off
    </IfModule>
    </Location>

    # Alias static media requests to filesystem
    Alias /media "E:/Tools/reviews/htdocs/media"
    Alias /static "E:/Tools/reviews/htdocs/static"
    Alias /errordocs "E:/Tools/reviews/htdocs/errordocs"
    Alias /favicon.ico "E:/Tools/reviews/htdocs/static/rb/images/favicon.png"
    </VirtualHost>
  • 修改E:\Tools\reviews\conf\settings_local.py

    1
    2
    3
    4
    5
    # DEBUG模式改为False
    DEBUG = False # 由TrueFalse,这个我也做对了

    # 添加可访问主机
    ALLOWED_HOSTS = ['reviews.com','localhost','192.168.0.112']
  • 重启Apache服务器

  • 访问ReviewBoard站点

    1
    2
    客户端:http://[ip]:[port]
    管理端:http://[ip]:[port]/admin