I should very much emphasise that adding anything after the .wsgi file name in the last argument to WSGIScriptAlias is not the norm when mounting at a suburl. It is only needed in reviewboard case because it can't handle being mounted at a sub directory with SCRIPT_NAME coming through with the suburl mount point. The reviewboard package expects SCRIPT_NAME to be an empty string, with it thinking it is still mounted at the root of the site, and with the suburl mount point still as part of PATH_INFO. The trick of putting the suburl after the .wsgi file like that achieves that.
In other words, this is the exception and if anyone else reads this later, don't believe this is normal. It is only needed because reviewboard is either not a WSGI conforming application, or they have made some strange design decision to not allow true suburl mounting. Graham On 11 March 2013 21:57, Maliken <[email protected]> wrote: > With a bit of tinkering here's the solution: > > www.mysite.com (wordpress site loads correctly)(mod_php) > www.mysite.com/reviewboard (reviewboard site loads > correctly)(mod_wsgi) > > *Important* make sure you clear your browser cache every time you restart > your apache server as I kept falling into the trap of it showing incorrect > data since I forgot to do that. > > *Important2* Make sure the "/reviewboard" follows the "reviewboard.wsgi" > to become "reviewboard.wsgi/reviewboard" otherwise it will not work and > gives a 404 error! > > Here's the working version: > > <VirtualHost *:80> > ServerAdmin [email protected] > ServerName www.mysite.com > DocumentRoot "/opt/local/apache2/htdocs/mysite" > ErrorLog "/opt/local/apache2/logs/mysite-error_log" > CustomLog "/opt/local/apache2/logs/mysite-access_log" common > > WSGIPassAuthorization On > WSGIScriptAlias /reviewboard > /opt/local/apache2/htdocs/mysite/reviewboard/htdocs/reviewboard.wsgi/reviewboard > <Directory /opt/local/apache2/htdocs/mysite/reviewboard> > Allow from all > Options -Indexes +FollowSymLinks > AllowOverride All > </Directory> > > # Alias static media requests to filesystem > Alias /reviewboard/media > "/opt/local/apache2/htdocs/mysite/reviewboard/htdocs/media" > Alias /reviewboard/static > "/opt/local/apache2/htdocs/mysite/reviewboard/htdocs/static" > Alias /reviewboard/errordocs > "/opt/local/apache2/htdocs/mysite/reviewboard/htdocs/errordocs" > Alias /reviewboard/favicon.ico > "/opt/local/apache2/htdocs/mysite/reviewboard/htdocs/static/rb/images/favicon.png" > </VirtualHost> > > > On Monday, March 11, 2013 5:43:06 PM UTC-7, Graham Dumpleton wrote: > >> My recollection is that reviewboard is broken in someway and doesn't >> properly handle being at a sub URL. That is, it doesn't honour what the >> WSGI server tells it (via SCRIPT_NAME) as to the mount point. This may mean >> it has to be fooled into thinking it is mounted at the root of the web >> site. To do that you possibly need to use AddHandler/rewrite method, but >> will mean that reviewboard.wsgi needs to be in top directory of >> DocumentRoot. Nothing else from app should be under DocumentRoot. >> >> Try changing WSGIScriptAlias first so we can confirm that reviewboard >> breaks at a sub URL. >> >> Graham >> >> >> >> >> On 11 March 2013 17:37, Maliken <[email protected]> wrote: >> >>> The reason I did that was that in my 2nd block example where I wasn't >>> trying to combine them it does it that way. That file was auto generated >>> in the install process of creating reviewboard. So I was trying to mirror >>> that, However, I was also confused by that. I will try to remove that >>> /reviewboard once I get back home from work and see if it works. I'll get >>> back to you. Thanks for the help! >>> >>> >>> On Monday, March 11, 2013 5:32:17 PM UTC-7, Graham Dumpleton wrote: >>> >>>> What happens when you change: >>>> >>>> WSGIScriptAlias "/reviewboard" "/opt/local/apache2/htdocs/**mys** >>>> ite/reviewboard/htdocs/**reviewb**oard.wsgi/reviewboard" >>>> >>>> to: >>>> >>>> WSGIScriptAlias "/reviewboard" "/opt/local/apache2/htdocs/**mys** >>>> ite/reviewboard/htdocs/**reviewb**oard.wsgi" >>>> >>>> You normally shouldn't have anything after the path of the .wsgi file. >>>> >>>> Graham >>>> >>>> >>>> >>>> On 11 March 2013 17:30, Maliken <[email protected]> wrote: >>>> >>>>> I keep my reviewboard stuff in a folder called reviewboard in my root >>>>> directory which is where I'm trying to host it from at >>>>> www.mysite.com/reviewboard. >>>>> >>>>> >>>>> On Monday, March 11, 2013 5:28:42 PM UTC-7, Maliken wrote: >>>>>> >>>>>> Sorry, I think I'm confused by your question(I'm new to this stuff). >>>>>> I didn't use AddHandler because it mentioned only needing to use that if >>>>>> you're mixing .wsgi files and static files in the same directory. >>>>>> >>>>>> On Monday, March 11, 2013 5:09:33 PM UTC-7, Graham Dumpleton wrote: >>>>>>> >>>>>>> Where is the configuration where you were using AddHandler and >>>>>>> rewrite rules as per the configuration guidelines document? >>>>>>> >>>>>>> Graham >>>>>>> >>>>>>> >>>>>>> On 11 March 2013 16:39, <[email protected]> wrote: >>>>>>> >>>>>>>> Hello, I'm trying to get my wordpress site as well as my >>>>>>>> reviewboard site working under the same domain name. >>>>>>>> >>>>>>>> Ex: >>>>>>>> >>>>>>>> www.mysite.com (this is where i host my wordpress site) >>>>>>>> www.mysite.com/reviewboard (this is where I want to host my >>>>>>>> reviewboard site) >>>>>>>> >>>>>>>> I can get one or the other to work properly depending on my >>>>>>>> httpd-vhosts.conf file as seen below. However, I cannot get both to >>>>>>>> work(this is where I need your help!) so that neither page throws an >>>>>>>> error >>>>>>>> such as 404. >>>>>>>> >>>>>>>> This is how I host my wordpress site: >>>>>>>> >>>>>>>> <VirtualHost *:80> >>>>>>>> ServerAdmin [email protected] >>>>>>>> DocumentRoot "/opt/local/apache2/htdocs/**mys****ite" >>>>>>>> ServerName www.mysite.com >>>>>>>> ErrorLog "/opt/local/apache2/logs/**mysit**** >>>>>>>> e.com-error_log" >>>>>>>> CustomLog "/opt/local/apache2/logs/**mysit****e.com-access_log" >>>>>>>> common >>>>>>>> </VirtualHost> >>>>>>>> This is how I host my reviewboard site(which then breaks my >>>>>>>> wordpress site): >>>>>>>> >>>>>>>> <VirtualHost *:80> >>>>>>>> ServerName www.mysite.com >>>>>>>> DocumentRoot "/opt/local/apache2/htdocs/**mys**** >>>>>>>> ite/reviewboard/htdocs" >>>>>>>> >>>>>>>> # Error handlers >>>>>>>> ErrorDocument 500 /errordocs/500.html >>>>>>>> >>>>>>>> WSGIPassAuthorization On >>>>>>>> WSGIScriptAlias "/reviewboard" "/opt/local/apache2/htdocs/**mys >>>>>>>> ****ite/reviewboard/htdocs/**reviewb****oard.wsgi/reviewboard" >>>>>>>> >>>>>>>> <Directory "/opt/local/apache2/htdocs/**mys**** >>>>>>>> ite/reviewboard/htdocs"> >>>>>>>> AllowOverride All >>>>>>>> Options -Indexes +FollowSymLinks >>>>>>>> Allow from all >>>>>>>> </Directory> >>>>>>>> >>>>>>>> # Alias static media requests to filesystem >>>>>>>> Alias /reviewboard/media "/opt/local/apache2/htdocs/**mys**** >>>>>>>> ite/reviewboard/htdocs/**media" >>>>>>>> Alias /reviewboard/static "/opt/local/apache2/htdocs/**mys**** >>>>>>>> ite/reviewboard/htdocs/**static" >>>>>>>> Alias /reviewboard/errordocs "/opt/local/apache2/htdocs/**mys** >>>>>>>> **ite/reviewboard/htdocs/**errordo****cs" >>>>>>>> Alias /reviewboard/favicon.ico "/opt/local/apache2/htdocs/**mys >>>>>>>> ****ite/reviewboard/htdocs/**static/****rb/images/favicon.png" >>>>>>>> </VirtualHost> >>>>>>>> >>>>>>>> So, now I want to be able to figure out how to combine these >>>>>>>> somehow so I can have reviewboard hosted at the path specified above >>>>>>>> without breaking my wordpress site. I tried using the Alias command as >>>>>>>> mentioned here: http://stackoverflow.com/**quest**** >>>>>>>> ions/1553165/multiple-**django-**s**ites-with-apache-mod-**wsgi<http://stackoverflow.com/questions/1553165/multiple-django-sites-with-apache-mod-wsgi> >>>>>>>> and here >>>>>>>> https://code.google.com/p/**modw****sgi/wiki/** >>>>>>>> ConfigurationGuidelin****es<https://code.google.com/p/modwsgi/wiki/ConfigurationGuidelines> >>>>>>>> >>>>>>>> However I can't get it to work so that both pages show the proper >>>>>>>> content without giving an error such as 404. Here's my work in >>>>>>>> progress. >>>>>>>> If you can be very specific as what I need to do in order to change >>>>>>>> this >>>>>>>> so it works that would be great since I'm new to this kind of stuff. >>>>>>>> Thanks! >>>>>>>> >>>>>>>> <VirtualHost *:80> >>>>>>>> ServerName www.mysite.com >>>>>>>> DocumentRoot "/opt/local/apache2/htdocs/**mys****ite" >>>>>>>> >>>>>>>> >>>>>>>> # Error handlers >>>>>>>> #hmm not sure where to put this since my document root is >>>>>>>> different?????? >>>>>>>> #ErrorDocument 500 /errordocs/500.html >>>>>>>> >>>>>>>> WSGIPassAuthorization On >>>>>>>> Alias /reviewboard/ /opt/local/apache2/htdocs/**mysi**** >>>>>>>> te/reviewboard/htdocs/ >>>>>>>> >>>>>>>> <Directory "/opt/local/apache2/htdocs/**mys**** >>>>>>>> ite/reviewboard/htdocs"> >>>>>>>> Options ExecCGI >>>>>>>> SetHandler wsgi-script >>>>>>>> AllowOverride All >>>>>>>> Options -Indexes +FollowSymLinks >>>>>>>> Allow from all >>>>>>>> </Directory> >>>>>>>> >>>>>>>> # Alias static media requests to filesystem >>>>>>>> # Since I added the alias command above these are >>>>>>>> complaining about >>>>>>>> #overlapping an earlier alias when I restart my apache >>>>>>>> server???? >>>>>>>> Alias /reviewboard/media "/opt/local/apache2/htdocs/**mys**** >>>>>>>> ite/reviewboard/htdocs/**media" >>>>>>>> Alias /reviewboard/static "/opt/local/apache2/htdocs/**mys**** >>>>>>>> ite/reviewboard/htdocs/**static" >>>>>>>> Alias /reviewboard/errordocs "/opt/local/apache2/htdocs/**mys** >>>>>>>> **ite/reviewboard/htdocs/**errordo****cs" >>>>>>>> Alias /reviewboard/favicon.ico "/opt/local/apache2/htdocs/**mys >>>>>>>> ****ite/reviewboard/htdocs/**static/****rb/images/favicon.png" >>>>>>>> </VirtualHost> >>>>>>>> >>>>>>>> -- >>>>>>>> You received this message because you are subscribed to the Google >>>>>>>> Groups "modwsgi" group. >>>>>>>> To unsubscribe from this group and stop receiving emails from it, >>>>>>>> send an email to [email protected]. >>>>>>>> To post to this group, send email to [email protected]. >>>>>>>> Visit this group at http://groups.google.com/**group**** >>>>>>>> /modwsgi?hl=en <http://groups.google.com/group/modwsgi?hl=en>. >>>>>>>> For more options, visit https://groups.google.com/**grou**** >>>>>>>> ps/opt_out <https://groups.google.com/groups/opt_out>. >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> -- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "modwsgi" group. >>>>> To unsubscribe from this group and stop receiving emails from it, send >>>>> an email to modwsgi+u...@**googlegroups.com. >>>>> To post to this group, send email to [email protected]. >>>>> Visit this group at >>>>> http://groups.google.com/**group**/modwsgi?hl=en<http://groups.google.com/group/modwsgi?hl=en> >>>>> . >>>>> For more options, visit >>>>> https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out> >>>>> . >>>>> >>>>> >>>>> >>>> >>>> -- >>> You received this message because you are subscribed to the Google >>> Groups "modwsgi" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to modwsgi+u...@**googlegroups.com. >>> To post to this group, send email to [email protected]. >>> Visit this group at >>> http://groups.google.com/**group/modwsgi?hl=en<http://groups.google.com/group/modwsgi?hl=en> >>> . >>> For more options, visit >>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out> >>> . >>> >>> >>> >> >> -- > You received this message because you are subscribed to the Google Groups > "modwsgi" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/modwsgi?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- You received this message because you are subscribed to the Google Groups "modwsgi" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/modwsgi?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
