Skip to content

Instantly share code, notes, and snippets.

@deruelle
Created April 3, 2009 19:10
Show Gist options
  • Save deruelle/89908 to your computer and use it in GitHub Desktop.
Save deruelle/89908 to your computer and use it in GitHub Desktop.
<p>During development, and in some production scenarios, it's useful to maintain your Rails application source in a location outside of <strong>$JBOSS_HOME</strong>.&nbsp; Additionally, the <strong>$RAILS_ENV</strong> variable may need to be set differently on different servers (production, staging, testing) perhaps.</p>
<p>To enable deployment-from-a-distance, the JBoss-Rails recognizes a top-level <strong>*-rails.yml</strong> deployment descriptor if placed within your server's <strong>deploy/</strong> directory.</p>
<p>This is a YAML file with 1 required section and additional optional sections.&nbsp; Values specified in this descriptor override any that may be provided within the application's own <strong>config/</strong> directory.</p>
<h2>Application Configuration [Required]<br /></h2>
<pre>application:<br /> RAILS_ROOT: /path/to/your/rails-application<br /> RAILS_ENV: production<br /></pre>
<p>The application section must define <strong>RAILS_ROOT</strong> and <strong>RAILS_ENV</strong>.&nbsp; <strong>RAILS_ROOT</strong> must be an absolute path to your application's code directory.&nbsp; If you leverage the hot-deployment capability, we recommend that each deployment of your app should exist as a distinctly named directory.&nbsp; And avoid using <strong>current/</strong> types of symlinks.</p>
<p><strong>RAILS_ENV</strong>, if specified, will override any value present within the application's own <a title="jboss-rails-env.yml" href="/theses/jboss-rails/projects/jboss-rails/pages/jboss-rails-env-yml">jboss-rails-env.yml</a> descriptor.</p>
<h2>Web Configuration [Optional]</h2>
<p>The web configuration section allows you to define the context path (URL path prefix) and host to use for the deployment.&nbsp;</p>
<p>If unspecified, the <strong>context</strong> defaults to the root (<em>http://&lt;HOST&gt;:8080/</em>).&nbsp; If no host is specified, or the token <strong>*</strong> is used, the application will respond to all requests.</p>
<pre>web:<br /> context: /<br /> host: myapp.oddthesis.org<br /></pre>
<p>Or using purely context-based serving</p>
<pre>web:<br /> context: /myapp<br /> host: *<br /></pre>
<h2>Sip Configuration [Optional]</h2>
<p>The sip configuration section allows you to define the <strong>appname</strong> of the sip servlets application (<em>mandatory</em>) and the name of the code that will handle the SIP messages :</p>
<h3>Pure Ruby application<br /></h3>
<p>if the code handling SIP messages is pure ruby then use&nbsp; <em>rubycontroller</em> : &lt;name of the SIP handler class&gt;</p>
<p>Example</p>
<pre>sip:<br />&nbsp;&nbsp;&nbsp; appName: TwigglApplication<br />&nbsp;&nbsp;&nbsp; rubycontroller: SipHandler<br /></pre>
<p>&nbsp;</p>
<h3>Multi language application<br /></h3>
<p>if your application is a multilanguage application and the code handling SIP Messages is Java Sip Servlets, use <em><strong>mainservlet</strong></em> to identify the servlet handling incoming initial requests in the java code. <em>Optional</em> if your application contains more than one servlet and if the sip code is in java.</p>
<p><br />Example</p>
<pre>sip:<br />&nbsp;&nbsp;&nbsp; appName: TwigglApplication<br />&nbsp;&nbsp;&nbsp; mainservlet: org.mobicents.servlet.sip.demo.jruby.JRubySipServlet<br /></pre>
<p>&nbsp;</p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment