Review Board Creating a Review Board Site
2016-04-05 09:52
453 查看
Creating a Review Board Site
Once Review Board is installed, a site must be created. Each site maps toa domain, subdomain, or directory installation.To create a site, you will use the
rb-site installcommand.
You will need to decide on a place to install the site. In the exampleshere, we will use
/var/www/reviews.example.com. The directoryshould not exist yet.
rb-site will create it.
Creating the Database
Before you create the Review Board site, you’ll need to create a database. Theparticular steps for this depend on the database server software that youintend to use.SQLite should only be used for test installations.
While useful and portable, SQLite does not handle large loads with manyconcurrent users very well. We strongly recommend using MySQL orPostgreSQL for a real deployment.
We don’t officially support converting a database from SQLite to otherdatabases, so it’s important that you choose something that will workfor you long-term.
MySQL
In MySQL, before creating your database, make sure that your server isconfigured to use the UTF-8 encoding for text. In the filemy.cnf, addthe following settings:
[client] default-character-set=utf8 [mysqld] character-set-server=utf8
After making these changes, restart your MySQL server.
Next, start up the mysql command prompt as your root user, and create a newdatabase and user (replacing
myuserand
myspasswordwith your desiredusername and password, respectively):
$ mysql -u root -p mysql> CREATE DATABASE reviewboard CHARACTER SET utf8; mysql> CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'mypassword'; mysql> GRANT ALL PRIVILEGES ON reviewboard.* to 'myuser'@'localhost';
PostgreSQL
To create a Postgres database, you’ll need to run several commands as thepostgresuser. Start by running the following command (the particularusername may depend on your choice of operating system):
$ sudo su - postgres
Next, as the postgres user, create a database and a user to access it:
$ createdb reviewboard $ createuser -P
The second of these commands will ask you several questions. For the last threequestions (relating to permissions), reply ‘n’.
Finally, grant permissions for this user to your new database:
$ psql => GRANT ALL PRIVILEGES ON DATABASE reviewboard to myuser
Beginning Installation
Begin installation by running the following command:$ rb-site install /var/www/reviews.example.com
You will now be asked a series of questions about your site setup. It isexpected that you will know the answers to these questions. If not, you’llhave to decide what software you want to use for your services and refer totheir documentation on how to set
them up and configure them.
We recommend mod_wsgi and memcached
If you’re using Apache, we highly recommend using mod_wsgi. fastcgihas been known to have several issues (including memory leaks and problemswhen using the LDAP authentication backend), and mod_python is no longerdeveloped or shipped with Apache.
We also strongly recommend installing and using memcached. This willgreatly improve performance of your Review Board installation. Ifpossible, put this on a server with a lot of RAM.
Apache should use the Prefork MPM
The Worker MPM uses multiple threads, which can cause numerous problemswith Review Board’s dashboard and extensions implementations. In order forReview Board to work correctly, it should use the single-threaded PreforkMPM.
Once you have answered all the questions and completed the installation,you’ll need to change some directory permissions and install your web serverconfiguration files.
Changing Permissions
Review Board expects to be able to write tositedir/htdocs/media/uploadedand
sitedir/dataandtheir subdirectories.
Since Review Board is run by your web server, these directories and allsubdirectories and files must be writable by the user your web server runsas.
This user varies by operating system, distribution and web server, so you mayneed to look it up. If your web server is currently running, you can look atwhat user it’s running as.
Once you’ve figured this out, go ahead and change the permissions on thedirectories. For example, in Linux/UNIX/MacOS X with a
www-datauser:
$ chown -R www-data /var/www/reviews.example.com/htdocs/media/uploaded $ chown -R www-data /var/www/reviews.example.com/data
If you’re using SQLite as your database, you will also need to change theownership of the site’s
dbdirectory to match the web server’suser. Otherwise, you may receive an Internal Server Error when accessingthe site.
Web Server Configuration
rb-site provides sample web server configuration files in the newlycreatedconf/directory under your new site directory. In many installs,these files will work out of the box, but they may require modificationdepending on the rest of your web server configuration.
The configuration file will be based on the web server type and Python loaderyou’ve specified. For example, if you used Apache and wsgi, you woulduse
apache-wsgi.conf.
Installing these files is also dependent on the web server and operatingsystem/distribution.
Apache
There are two possible Apache configuration files that will be generated,depending on whether you selectedmod_wsgi,
mod_pythonor
fastcgiduring
rb-site install.
If you selected
mod_wsgi, your configuration file will be
conf/apache-wsgi.conf.
If you selected
mod_python, your configuration file will be
conf/apache-modpython.conf.
If you selected
fastcgi, your configuration file will be
conf/apache-fastcgi.conf.
Depending on your operating system or Linux distribution, the configurationfile can be installed in a couple different ways.
If you have a
sites-availabledirectory in your Apacheconfiguration directory (for example,
/etc/apache2/sites-available,then you should rename your configuration file to match your site(e.g.,
reviews.example.com.conf) and put it in that directory. Thencreate a symbolic link from that file to the
sites-enableddirectory. This is the most common setup on Debian or Ubuntu-baseddistributions. So for example:
$ cd /etc/apache2/sites-available $ cp /var/www/reviews.example.com/conf/apache-wsgi.conf reviews.example.com.conf $ cd ../sites-enabled $ ln -s ../sites-available/reviews.example.com.conf .
If you do not have a
sites-availableor
sites-enableddirectory, you’ll need to embed the configuration file in your globalApache configuration file (usually
/etc/httpd/httpd.confor
/etc/httpd/apache2.conf).
Note
On Fedora, you can do$ ln -s /path/to/apache-wsgi.conf /etc/httpd/conf.d/reviewboard-sitename.conf
Of course, the configuration file can be placed anywhere so long as it’sat some point included by your main Apache configuration file.
Once you’ve installed the configuration file, restart Apache and thentry going to your site.
Note
Some Apache installations (such as the default installs on Debianand Ubuntu) by default define a global virtual host that shares
/var/wwwas the document root. This may lead to problemswith
your install. If you access your site and see nothing buta directory listing, then you’re affected by this problem.
The solution is to remove the “default” site from your
/etc/apache2/sites-enableddirectory. This may becalled something like
defaultor
000-default.
Note
On Fedora and Red Hat-derived systems, the following commandsshould be run (as root) to avoid SELinux denials::$ setsebool -P httpd_can_sendmail 1$ setsebool -P httpd_can_network_memcache 1
lighttpd
The generated configuration file for lighttpd will be saved asconf/lighttpd.conf.
You should either add the contents of this file to your
/etc/lighttpd/lighttpd.conf, or include it directly from
lighttpd.conf
using the
includedirective. See thelighttpd documentation for more information.
相关文章推荐
- 日志搜索工具
- nodejs v8引擎c++编译版本升级教程
- 安装/还原Xp系统提示decompression error abort的解决方法
- Review Board Installing on Linux
- 转载光荣之路:与领导沟通那点事儿
- Git版本控制
- C# 利用ICSharpCode.SharpZipLib实现在线压缩和解压缩
- iOS APP上架流程(发布到 APP Store)
- easyUI
- HttpURLConnection 访问服务器,GET和POST方法.
- Java 多线程之 synchronized 和 volatile 的比较
- style,currentStyle,getComputedStyle的区别和用法
- 1294 全排列——http://codevs.cn/problem/1294/
- Java 多线程之 synchronized 和 volatile 的比较
- AWT组件(3)
- iOS--xcodebuild命令记录
- 如何给grldr.mbr和grldr改名
- style,currentStyle,getComputedStyle的区别和用法
- 几种代价函数
- js中计算一个时间点加上一个时间段后的时间