1232: Installing a site in a subdirectory does not display pages formatted with CSS

e2f***@gmai***** (Google Code) (Is this you? Claim this profile.)
chipx86
chipx86
Sept. 15, 2009
What version are you running?
ReviewBoard-1.0-py2.4

What's the URL of the page containing the problem?
N/A

What steps will reproduce the problem?
1. Install Review Board site using Apache and mod_python by following
directions at
http://www.review-board.org/docs/manual/dev/admin/sites/creating-sites/ and
specify "/reviews/" for the Root Path.
2. Browse to the site, e.g. http://reviews.example.com/reviews/"

What is the expected output? What do you see instead?
I expect to see the login screen and Dashboard rendered with CSS. Instead,
I just see plain text.

What operating system are you using? What browser?
Ubuntu Linux 9.04 on x86, Firefox 3.0.11

Please provide any additional information below.
The generated apache-modpython.conf file does not use the specified root
path subdirectory in the virtual host override rules nor in the alias.

I've attached an untested patch that attempts to fix it. I don't know if
Site.site_root defaults to '/' so there may need to be some tweaking of
this patch; I'm also not a Python programmer!
--- apache-modpython.conf.in	2009-07-22 17:03:43.000000000 -0400
+++ apache-modpython.conf.in.new	2009-07-22 17:06:45.000000000 -0400
@@ -20,10 +20,10 @@
 
 	# Serve static media without running it through mod_python
 	# (overrides the above)
-	<Location "/media">
+	<Location "@siteroot@media">
 		SetHandler None
 	</Location>
-	<Location "/errordocs">
+	<Location "@siteroot@errordocs">
 		SetHandler None
 	</Location>
 
@@ -32,6 +32,6 @@
 	</Directory>
 
 	# Alias static media requests to filesystem
-	Alias /media "@sitedir@/htdocs/media"
-	Alias /errordocs "@sitedir@/htdocs/errordocs"
+	Alias @siteroot@media "@sitedir@/htdocs/media"
+	Alias @siteroot@errordocs "@sitedir@/htdocs/errordocs"
 </VirtualHost>
--- rbsite.py	2009-07-22 17:04:57.000000000 -0400
+++ rbsite.py.new	2009-07-22 17:06:16.000000000 -0400
@@ -394,6 +394,7 @@
             'sitedomain': self.domain_name,
             'sitedomain_escaped': domain_name_escaped,
             'siteid': self.site_id,
+            'siteroot
#1 e2f***@gmai***** (Google Code) (Is this you? Claim this profile.)
One more thing: to avoid clobbering other sites that are installed on the Apache
server, the Location should be specified too in the VirtualHost section, like this:

@@ -6,7 +6,7 @@
 	ErrorDocument 500 /errordocs/500.html
 
 	# Serve django pages
-	<Location "/">
+	<Location "@siteroot@">
 		PythonPath "['@sitedir@/conf'] + sys.path"
 		SetEnv DJANGO_SETTINGS_MODULE reviewboard.settings
 		SetEnv PYTHON_EGG_CACHE "@sitedir@/tmp/egg_cache"
chipx86
#2 chipx86
Please submit this patch to http://reviews.review-board.org/
  • +Confirmed
  • -Priority-Medium
    +Priority-High
    +Milestone-Release1.0.x
    +Component-Deployment
#3 e2f***@gmai***** (Google Code) (Is this you? Claim this profile.)
I'm having trouble creating a patch that RB will accept.

I first tried to upload a standard unified diff, but RB said it couldn't recognize 
it. After looking at other examples, I realized it required a git-style diff. So I 
downloaded the source using git, made the changes in my local copy, ran `git diff', 
then tried to upload that. But RB then said it couldn't find the files in the 
repository.

What am I doing wrong?
chipx86
#4 chipx86
You need to use git diff --full-index to generate full (instead of shortened) SHA1s.
#5 e2f***@gmai***** (Google Code) (Is this you? Claim this profile.)
Thanks. Submitted as http://reviews.review-board.org/r/1044/
chipx86
#6 chipx86
Thanks. Committed in rf3ecbd5.
  • -Confirmed
    +Fixed
  • +chipx86