Scott Seago
2008-Mar-28 17:47 UTC
[Ovirt-devel] [Patch] move app root to /ovirt for ovirt-wui
This patch moves the app root to /ovirt for the ovirt wui, paving the way for ovirt and freeipa to live on the same box without having to use alternate ports. This is mostly a config change -- fixing the httpd proxy stuff to redirect to /ovirt, and telling mongrel to serve the app at /ovirt. There were a couple view changes to remove hard-coded URLs, and we have to hard-code the image/stylesheet paths in the error html pages. We are not, at this point, redirecting "/" to "/ovirt", but we may want to do that in some of the appliance install/setup scripts. Scott -------------- next part -------------- A non-text attachment was scrubbed... Name: move-app-root.patch Type: text/x-patch Size: 5421 bytes Desc: not available URL: <http://listman.redhat.com/archives/ovirt-devel/attachments/20080328/aa1aba52/attachment.bin>
Daniel P. Berrange
2008-Mar-28 18:00 UTC
[Ovirt-devel] [Patch] move app root to /ovirt for ovirt-wui
On Fri, Mar 28, 2008 at 01:47:01PM -0400, Scott Seago wrote:> This patch moves the app root to /ovirt for the ovirt wui, paving the > way for ovirt and freeipa to live on the same box without having to use > alternate ports. > > This is mostly a config change -- fixing the httpd proxy stuff to > redirect to /ovirt, and telling mongrel to serve the app at /ovirt. > There were a couple view changes to remove hard-coded URLs, and we have > to hard-code the image/stylesheet paths in the error html pages. > > We are not, at this point, redirecting "/" to "/ovirt", but we may want > to do that in some of the appliance install/setup scripts.I'd just add a commented out rule to httpd.conf to illustrate it, eg # To make oVirt the default app on the website uncomment this line: #RewriteRule ^/$ /ovirt/ And enable this by default in our pre-built WUI appliance image. Dan. -- |: Red Hat, Engineering, Boston -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
Hugh O. Brock
2008-Mar-28 18:17 UTC
[Ovirt-devel] [Patch] move app root to /ovirt for ovirt-wui
On Fri, Mar 28, 2008 at 01:47:01PM -0400, Scott Seago wrote:> diff --git a/wui/conf/ovirt-wui b/wui/conf/ovirt-wui > index 2ad7bf1..07d7acc 100644 > --- a/wui/conf/ovirt-wui > +++ b/wui/conf/ovirt-wui > @@ -14,6 +14,7 @@ ADDR=127.0.0.1 > RAILS_ENVIRONMENT=production > USER=ovirt > GROUP=ovirt > +PREFIX=/ovirt > export RAILS_GEM_VERSION=2.0.1 > > RETVAL=0 > @@ -23,7 +24,7 @@ RETVAL=0 > start() { > echo -n "Starting ovirt-wui: " > > - mongrel_rails start -c $OVIRT_DIR -l $MONGREL_LOG -P $MONGREL_PID -a $ADDR -e $RAILS_ENVIRONMENT --user $USER --group $GROUP -d > + mongrel_rails start -c $OVIRT_DIR -l $MONGREL_LOG -P $MONGREL_PID -a $ADDR -e $RAILS_ENVIRONMENT --user $USER --group $GROUP -d --prefix=$PREFIX > RETVAL=$? > if [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ovirt-wui ; then > echo_success > diff --git a/wui/conf/ovirt-wui.conf b/wui/conf/ovirt-wui.conf > index 99aa74f..df09c33 100644 > --- a/wui/conf/ovirt-wui.conf > +++ b/wui/conf/ovirt-wui.conf > @@ -12,9 +12,9 @@ ProxyRequests Off > Krb5KeyTab /etc/httpd/conf/ipa.keytab > KrbSaveCredentials on > Require valid-user > - ErrorDocument 401 /errors/401.html > - ErrorDocument 404 /errors/404.html > - ErrorDocument 500 /errors/500.html > + ErrorDocument 401 /ovirt/errors/401.html > + ErrorDocument 404 /ovirt/errors/404.html > + ErrorDocument 500 /ovirt/errors/500.html > RewriteEngine on > Order deny,allow > Allow from all > @@ -29,17 +29,17 @@ ProxyRequests Off > # RequestHeader unset Authorization > </Proxy> > > -Alias /stylesheets "/usr/share/ovirt-wui/public/stylesheets" > -Alias /images "/usr/share/ovirt-wui/public/images" > -Alias /errors "/usr/share/ovirt-wui/public/" > +Alias /ovirt/stylesheets "/usr/share/ovirt-wui/public/stylesheets" > +Alias /ovirt/images "/usr/share/ovirt-wui/public/images" > +Alias /ovirt/errors "/usr/share/ovirt-wui/public/" > > -ProxyPass /images ! > -ProxyPass /stylesheets ! > -ProxyPass /errors ! > -ProxyPass / http://localhost:3000/ > -ProxyPassReverse / http://localhost:3000/ > -ProxyPassReverse /images ! > -ProxyPassReverse /stylesheets ! > -ProxyPassReverse /errors ! > +ProxyPass /ovirt/images ! > +ProxyPass /ovirt/stylesheets ! > +ProxyPass /ovirt/errors ! > +ProxyPass /ovirt http://localhost:3000/ovirt > +ProxyPassReverse /ovirt http://localhost:3000/ovirt > +ProxyPassReverse /ovirt/images ! > +ProxyPassReverse /ovirt/stylesheets ! > +ProxyPassReverse /ovirt/errors ! > > </VirtualHost> > diff --git a/wui/src/app/views/library/list.rhtml b/wui/src/app/views/library/list.rhtml > index 867682f..ada16dd 100644 > --- a/wui/src/app/views/library/list.rhtml > +++ b/wui/src/app/views/library/list.rhtml > @@ -19,7 +19,7 @@ function confirm_and_submit(item){ > <div class="inside"> > > <div class="data-table-column"> > -<form action="/library/vm_actions" name="vm_actions" method="post"> > +<% form_tag( {:controller => 'library', :action => 'vm_actions'}, {:name => "vm_actions", :method => "post"}) do -%> > <%= tag :input, { "type" => "submit", "name" => "vm_actions[#{VmTask::ACTION_START_VM}]", "value" => "Start"} %> > <%= tag :input, { "type" => "submit", "name" => "vm_actions[#{VmTask::ACTION_SHUTDOWN_VM}]", "value" => "Stop"} %> > <select onchange="return confirm_and_submit(this)" name="vm_actions[other_actions]"> > @@ -35,7 +35,7 @@ function confirm_and_submit(item){ > <br/><br/> > > <%= render :partial => "/vm/list", :locals => { :vms => @vms } %> > -</form> > +<% end -%> > </div> > > </div> <!-- end #data-table.inside --> > diff --git a/wui/src/app/views/library/show.rhtml b/wui/src/app/views/library/show.rhtml > index ca5c566..d431ab7 100644 > --- a/wui/src/app/views/library/show.rhtml > +++ b/wui/src/app/views/library/show.rhtml > @@ -10,7 +10,7 @@ > > <div class="data-table-column"> > > - <form action="/library/vm_actions" name="vm_actions" method="post"> > + <% form_tag( {:controller => 'library', :action => 'vm_actions'}, {:name => "vm_actions", :method => "post"}) do -%> > <%= tag :input, { "type" => "hidden", "name" => "vm_actions[vm_library_id]", "value" => "@vm_library.id"} %> > <%= tag :input, { "type" => "submit", "name" => "vm_actions[#{VmTask::ACTION_START_VM}]", "value" => "Start"} %> > <%= tag :input, { "type" => "submit", "name" => "vm_actions[#{VmTask::ACTION_SHUTDOWN_VM}]", "value" => "Stop"} %> > @@ -29,7 +29,7 @@ > <br/> > > <%= render :partial => "/vm/list", :locals => { :vms => @vm_library.vms } %> > - </form> > + <% end -%> > > </div> > > diff --git a/wui/src/public/401.html b/wui/src/public/401.html > index c206487..ffcfc9b 100644 > --- a/wui/src/public/401.html > +++ b/wui/src/public/401.html > @@ -5,15 +5,15 @@ > <head> > <meta http-equiv="content-type" content="text/html;charset=UTF-8" /> > <title>Authorization Required</title> > - <link href="/stylesheets/default.css" media="screen" rel="Stylesheet" type="text/css" /> > - <script src="/javascripts/prototype.js" type="text/javascript"></script> > + <link href="/ovirt/stylesheets/default.css" media="screen" rel="Stylesheet" type="text/css" /> > + <script src="/ovirt/javascripts/prototype.js" type="text/javascript"></script> > </head> > <body> > > <div id="top_bar"></div> > <div id="content"> > <div id="header"> > -<a href="/"><img alt="Ovirt" class="logo" src="/images/ovirt-red-logo133x56.png" /></a> > +<a href="/"><img alt="Ovirt" class="logo" src="/ovirt/images/ovirt-red-logo133x56.png" /></a> > </div> > > <div class = "alertbox"></div>ACK, looks good... --H