Install ReviewBoard on javastuserver

Source: Internet
Author: User
Tags time zone names install django
The ReviewBoard was successfully installed on the lab server before returning home, providing a good platform for the project team to review code in the future. More than a month has passed, and now we have time to record the installation process. 1. Background and installation goals for ReviewBoard introduction. For more information, see my previous log. The operating system of our server is UbuntuServer, and mys has been installed.

The ReviewBoard was successfully installed on the lab server before returning home, providing a good platform for the project team to review code in the future. More than a month has passed, and now we have time to record the installation process.

1. Background and installation Objectives

For more information about ReviewBoard, see my previous log. The operating system of our Server is Ubuntu Server, and mysql and apache have been installed. The purpose of this installation is to install the ReviewBoard in the LAN of the lab and support code review in Git format.

2. Preparations

ReviewBoard is developed with Django. Therefore, you must first install Django. Django is actually a series of python software packages. The installation command is as follows:

$ Sudo apt-get install build-essential subversion python-imaging python-flup python-dev memcached libmemcache-dev

Then manually install cmemcache (Python's memcached binding ):

Download the latest http://gijsbert.org/downloads/cmemcache/ here; then install it from the source code.

Because the original mysql on the server does not have a python module, you need to install it:

$ Sudo apt-get install python-mysqldb

In addition, install Git:

$ Sudo apt-get install git-core

Now the preparation has been completed.

3. Install ReviewBoard

Using the python-setuptools tool, it is very easy to install ReviewBoard:

$ Sudo apt-get install python-setuptools

$ Sudo easy_install ReviewBoard

A time zone issue needs to be mentioned here. the installation process was smooth when ReviewBoard was installed for the first time, but the time zone of the last created site was the default US Pacific time, instead of Beijing time. when I try to modify the time zone on the site configuration page, the entire site will be suspended. it was reinstalled several times later. finally, find a temporary solution, that is, before creating the site, manually modify the file:/usr/lib/python2.5/site-packages/ReviewBoard-0.9.dev_20090115-py2.5.egg/reviewboard/settings. py (note that the ReviewBoard_xxx.egg part in this directory varies with your ReviewBoard version and installation time ),

TIME_ZONE = 'us/Pacific'

Change

TIME_ZONE = 'Asia/Shanghai'

Note that entering Asia/Beijing here will cause an error, because it seems that the list of existing time zone names was formulated 49 years ago, while the Beijing time zone was created after the establishment of the great motherland. therefore, you can enter Asia/Shanghai, Asia/Chongqing, or even Asia/Urumqi, but you cannot enter Asia/Beijing. after modification, you can continue the following work.


4. Create a ReviewBoard site

It is easy to create your ReviewBoard site. You only need one command:

$ Sudo rb-site install/var/www/reviews.cgcad.com

The last directory name is the directory where you want to store website-related files. this command will pop up a series of prompts to guide you to fill in website information step by step, such as website name, website URL, database used, database name, cache mechanism used, and so on. the important one is the database. Make sure that you have created a database instance for your ReviewBoard site before running this command, the user name and password you entered have the write permission on the database instance.


5. Configure the ReviewBoard site

After the site is created, configure the site. First, make sure that your web server has the write permission on the directory of the website:

$ Chown-R www-data: www-data/var/www/reviews.cgcad.com/htdocs/media/uploaded

Www-data is the default username and user group name of apache, And the/xx/media/uploaded directory is the directory name that stores the uploaded files on the website.

Next, copy the configuration file generated by ReviewBoard for you to the apache directory:

$ Sudo cp/var/www/reviews.cgcad.com/conf/apache_modpython.conf/etc/apache2/conf. d/reviews. conf

For convenience, change the name of the configuration file to reviews. conf. You can keep the name of the original configuration file.

Generally, the default configuration file can make a website work normally. specific to my situation, because I want to use the ReviewBoard site as the sub-directory form of a main site in our lab (the url I entered during rb-site install is also the URL of the main site, instead of a new URL created specifically for the ReviewBoard), you need to modify the configuration file:

Original configuration file:

View plaincopy to clipboardprint?

ServerName reviews.cgcad.com
DocumentRoot/var/www/reviews.cgcad.com/htdocs
# Error handlers
ErrorDocument 500/errordocs/500.html
# Serve django pages

PythonPath "['/var/www/reviews.cgcad.com/conf'] + sys. path"
SetEnv DJANGO_SETTINGS_MODULE reviewboard. settings
SetHandler mod_python
PythonHandler django. core. handlers. modpython
PythonAutoReload Off
PythonDebug Off
# Used to run multiple mod_python sites in the same apache
PythonInterpreter reviewboard_reviews_cgcad_com

# Serve static media without running it through mod_python
# (Overrides the above)

SetHandler None


SetHandler None

# Alias static media requests to filesystem
Alias/media/var/www/reviews.cgcad.com/htdocs/media
Alias/errordocs/var/www/reviews.cgcad.com/htdocs/errordocs


ServerName reviews.cgcad.com
DocumentRoot/var/www/reviews.cgcad.com/htdocs
# Error handlers
ErrorDocument 500/errordocs/500.html
# Serve django pages
 
PythonPath "['/var/www/reviews.cgcad.com/conf'] + sys. path"
SetEnv DJANGO_SETTINGS_MODULE reviewboard. settings
SetHandler mod_python
PythonHandler django. core. handlers. modpython
PythonAutoReload Off
PythonDebug Off
# Used to run multiple mod_python sites in the same apache
PythonInterpreter reviewboard_reviews_cgcad_com
 
# Serve static media without running it through mod_python
# (Overrides the above)
 
SetHandler None
 
 
SetHandler None
 
# Alias static media requests to filesystem
Alias/media/var/www/reviews.cgcad.com/htdocs/media
Alias/errordocs/var/www/reviews.cgcad.com/htdocs/errordocs

 


The modified configuration file:

View plaincopy to clipboardprint?
#
# ServerName dev.cgcad.com
# DocumentRoot/var/www/reviews/htdocs
#
# Error handlers
# ErrorDocument 500/errordocs/500.html
# Serve django pages

PythonPath "['/var/www/reviews/conf'] + sys. path"
SetEnv DJANGO_SETTINGS_MODULE reviewboard. settings
SetHandler mod_python
PythonHandler django. core. handlers. modpython
PythonAutoReload Off
PythonDebug Off
# Used to run multiple mod_python sites in the same apache
PythonInterpreter reviewboard_reviews

# Serve static media without running it through mod_python
# (Overrides the above)

SetHandler None


SetHandler None

# Alias static media requests to filesystem
Alias/media/var/www/reviews.cgcad.com/htdocs/media
Alias/errordocs/var/www/reviews.cgcad.com/htdocs/errordocs
#
#
# ServerName dev.cgcad.com
# DocumentRoot/var/www/reviews/htdocs
#
# Error handlers
# ErrorDocument 500/errordocs/500.html
# Serve django pages

PythonPath "['/var/www/reviews/conf'] + sys. path"
SetEnv DJANGO_SETTINGS_MODULE reviewboard. settings
SetHandler mod_python
PythonHandler django. core. handlers. modpython
PythonAutoReload Off
PythonDebug Off
# Used to run multiple mod_python sites in the same apache
PythonInterpreter reviewboard_reviews

# Serve static media without running it through mod_python
# (Overrides the above)

SetHandler None


SetHandler None

# Alias static media requests to filesystem
Alias/media/var/www/reviews.cgcad.com/htdocs/media
Alias/errordocs/var/www/reviews.cgcad.com/htdocs/errordocs
#
 


Restart apache and enter the URL you set in the browser. The ReviewBoard site should work properly :)

 

---------------------------------------- Angry split line ----------------------------------------------

Since it was installed more than a month ago, when I wrote it, I recalled and wrote it. Sometimes I searched the online materials and finally wrote the results for two hours, when I press "post an article", all the text is missing and there is no prompt, including the error message or successful message. this is too much! I struggled with my patience and focused on writing it again. The angry mood was still hard to restore.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.