reviewboard3.0.14部署在ubuntu16.04
Reviewboard依赖python开发环境
python环境的安装
apt-get install python python-setuptools python-dev
apt install memcached
easy_install python-memcached
sudo apt install apache2 libapache2-mod-wsgi
sudo a2enmod wsgi #/* 修改apache2的配置,让python mod处于enable状态 */
apt install patch
apt install mysql-server python-mysqldb libmemcache-dev #默认安装的是mysql-5.7
sudo apt install patch subversion python-svn
apt install libffi-dev
sudo apt install libssl-dev
pip install pillow
apt-get install python-yaml
easy_install reviewboard #安装reviewboard
数据库配置
编辑mysql配置文件
/etc/mysql/mysql.conf.d/mysqld.cnf
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0
[mysqld]
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
character_set_server = utf8
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking
key_buffer_size = 16M
max_allowed_packet = 16M
thread_stack = 192K
thread_cache_size = 8
myisam-recover-options = BACKUP
query_cache_limit = 1M
query_cache_size = 16M
log_error = /var/log/mysql/error.log
expire_logs_days = 10
max_binlog_size = 100M
创建数据库并授权访问用户
create database reviewboard default charset utf8 collate utf8_general_ci;
create user 'reviewboard'@'localhost' identified by '$passwd'; #-- 其中reviewboard为用户名
grant all on reviewboard.* to 'reviewboard'@'localhost'; #-- 前一个reviewboard为数据库名,后一个reviewboard为用户名
初始化配置reviewboard
root@reviewboard-10-243:~# rb-site install /var/www/reviewboard
Domain = reviewboard.devopsman.cn
Root Path = / (默认)
Database Type = mysql
Database Name = reviewboard
Database server = localhost
Database username = reviewboard
Database password = reviewboard
Confirm password = reviewboard
Memcached Server = localhost:11211 (默认)
Username = admin (默认)
Password = 密码
Confirm Password = 密码
E-mail = xxx@qq.com
Company/Organization = 随意
Allow us to collect support data = n
安装完成后的显示信息
Setting up support ... OK
* The site has been installed
The site has been installed in /var/www/reviewboard
Sample configuration files for web servers and cron are available
in the conf/ directory.
You need to modify the ownership of the following directories and
their contents to be owned by the web server:
* /var/www/reviewboard/htdocs/media/uploaded
* /var/www/reviewboard/htdocs/media/ext
* /var/www/reviewboard/htdocs/static/ext
* /var/www/reviewboard/data
For more information, visit:
https://www.reviewboard.org/docs/manual/3.0/admin/installation/creating-sites/
* Get more out of Review Board
To enable PDF document review, enhanced scalability, GitHub
Enterprise support, and more, download Power Pack at:
https://www.reviewboard.org/powerpack/
Your install key for Power Pack is:
e65b089794f8ede728984df0235072b951df5702
Support contracts for Review Board are also available:
https://www.beanbaginc.com/support/contracts/
开机自启服务
systemctl enable memcached
systemctl enable mysql
systemctl enable apache2
apache中配置reviewboard的配置文件
cd /etc/apache2/sites-available
cp /var/www/reviewboard/conf/apache-wsgi.conf reviewboard.conf
cd ../sites-enabled
ln -s ../sites-available/reviewboard.conf .
a2ensite reviewboard
修改配置目录权限
chown -R www-data /var/www/reviewboard/htdocs/media/uploaded
chown -R www-data /var/www/reviewboard/data
chown -R www-data /var/www/reviewboard/htdocs/media/ext
chown -R www-data /var/www/reviewboard/htdocs/static/ext
apache加载reviewboard
sudo a2dissite 000-default
sudo a2ensite reviewboard
sudo /etc/init.d/apache2 reload
sudo /etc/init.d/apache2 restart
访问reviewboard
通过浏览器访问reviewboard需要在reviewboard中允许外部网络访问,配置文件为:/var/www/reviewboard/conf/settings_local.py
ALLOWED_HOSTS = ["localhost"] 修改成 ALLOWED_HOSTS = ["*"]