Skip to content

Commit

Permalink
rb-site WSGI support
Browse files Browse the repository at this point in the history
Patch from Jan Koprowski. This change adds a config template and rb-site support
for deploying using mod_wsgi. Tested on Ubuntu 10.04.

Reviewed at http://reviews.reviewboard.org/r/1665/
Fixes bug 1136.
  • Loading branch information
davidt committed Jun 14, 2010
1 parent 9fe599c commit e4aa4ff
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions reviewboard/cmdline/rbsite.py
Expand Up @@ -234,13 +234,17 @@ def setup_settings(self):
def generate_config_files(self):
web_conf_filename = ""
enable_fastcgi = False
enable_wsgi = False

if self.web_server_type == "apache":
if self.python_loader == "modpython":
web_conf_filename = "apache-modpython.conf"
elif self.python_loader == "fastcgi":
web_conf_filename = "apache-fastcgi.conf"
enable_fastcgi = True
elif self.python_loader == "wsgi":
web_conf_filename = "apache-wsgi.conf"
enable_wsgi = True
else:
# Should never be reached.
assert False
Expand All @@ -263,6 +267,11 @@ def generate_config_files(self):
self.process_template("cmdline/conf/reviewboard.fcgi.in",
fcgi_filename)
os.chmod(fcgi_filename, 0755)
elif enable_wsgi:
wsgi_filename = os.path.join(htdocs_dir, "reviewboard.wsgi")
self.process_template("cmdline/conf/reviewboard.wsgi.in",
wsgi_filename)
os.chmod(wsgi_filename, 0755)

# Generate a secret key based on Django's code.
secret_key = ''.join([
Expand Down Expand Up @@ -1117,7 +1126,7 @@ def add_options(self, parser):
group.add_option("--web-server-type",
help="web server (apache or lighttpd)")
group.add_option("--python-loader",
help="python loader for apache (modpython or fastcgi)")
help="python loader for apache (modpython, fastcgi or wsgi)")
group.add_option("--admin-user", default="admin",
help="the site administrator's username")
group.add_option("--admin-password",
Expand Down Expand Up @@ -1383,7 +1392,7 @@ def ask_python_loader(self):
ui.text(page, "Based on our experiences, we recommend using "
"modpython with Review Board.")

ui.prompt_choice(page, "Python Loader", ["modpython", "fastcgi"],
ui.prompt_choice(page, "Python Loader", ["modpython", "fastcgi", "wsgi"],
save_obj=site, save_var="python_loader")

def ask_admin_user(self):
Expand Down

0 comments on commit e4aa4ff

Please sign in to comment.