Skip to content
Skip to breadcrumbs
Skip to header menu
Skip to action menu
Skip to quick search
Quick Search
Browse
Pages
Blog
Labels
Attachments
Mail
Advanced
What’s New
Space Directory
Feed Builder
Keyboard Shortcuts
Confluence Gadgets
Log In
Sign Up
Dashboard
Cargo
Copy Page
You are not logged in. Any changes you make will be marked as
anonymous
. You may want to
Log In
if you already have an account. You can also
Sign Up
for a new account.
This page is being edited by
.
Paragraph
Paragraph
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Preformatted
Quote
Bold
Italic
Underline
More colours
Strikethrough
Subscript
Superscript
Monospace
Clear Formatting
Bullet list
Numbered list
Outdent
Indent
Align left
Align center
Align right
Link
Table
Insert
Insert Content
Image
Link
Attachment
Symbol
Emoticon
Wiki Markup
Horizontal rule
tinymce.confluence.insert_menu.macro_desc
Info
JIRA Issue
Status
Gallery
Tasklist
Table of Contents
Other Macros
Page Layout
No Layout
Two column (simple)
Two column (simple, left sidebar)
Two column (simple, right sidebar)
Three column (simple)
Two column
Two column (left sidebar)
Two column (right sidebar)
Three column
Three column (left and right sidebars)
Undo
Redo
Find/Replace
Keyboard Shortcuts Help
<p>This document explains how to configure Cargo remote deployment support on a Jetty container.</p><h3>Overview</h3><p>By default, Jetty does not come with possibilities for remote deployment. In order to add such a support to Jetty, Cargo uses a "Jetty remote deployer" Web application.</p><p>This application is a simple servlet-based application which exposes methods such as deploy or undeploy on standard HTTP POST URLs. When thse HTTP methods are called, the servlet implementing these methods connects to the Jetty Server implementation and does deployment related actions on the server; this Web application can therefore be seen as a kind of remote administration proxy.</p><p>Being a standard Web application, the Cargo Jetty remote deployer application can be secured using Jetty users and roles.</p><h3>Downloading the remote deployer</h3><p>Two versions of the Jetty remote deployer WAR are available on the <a class="confluence-link" href="/display/CARGO/Downloads" data-linked-resource-id="10844" data-linked-resource-type="page" data-linked-resource-default-alias="Downloads" data-base-url="http://docs.codehaus.org">Cargo downloads</a> page (scroll down to the <strong>Tools</strong> section):</p><ul><li><code>cargo-jetty-7-and-onwards-deployer</code>: The Deployer Web application for the Jetty remote containers, which must have been deployed to Jetty before using the CARGO remote deployer. Designed to work with Jetty 7.x and later (Jetty from Eclipse.org)</li><li><code>cargo-jetty-6-and-earlier-deployer</code>: The Deployer Web application for the Jetty remote containers, which must have been deployed to Jetty before using the CARGO remote deployer. Designed to work with Jetty 6.x and earlier (Jetty from Mortbay.org)</li></ul><p>Please make sure to download and install the correct flavour for your Jetty version.</p><h3>Security</h3><p>By default, the Cargo Jetty remote deployer comes with no security.</p><p>In order to activate security, follow these steps:</p><ol><li>Open the <code>WEB-INF/web.xml</code> file of the Cargo Jetty remote deployer WAR</li><li>Uncomment the part that says <code>Uncomment in order to activate security</code>. By default, that configuration is as follows:<ul><li>Authentication is done using standard HTTP headers: <code>login-config</code> set to <code>BASIC</code>.</li><li>Authorization is done using Jetty role: <code>security-constraint</code> has a <code>auth-constraint</code> with <code>role-name</code>.</li></ul></li><li>Create a user with the Jetty role <code>manager</code>:<ol><li>Open the Jetty <code>realm.properties</code> file</li><li><p>Add, for example, the following definition</p><table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>someusername: somepassword,manager </pre></td></tr></table></li></ol></li></ol><p>To try the security settings, you can try to visit the <code>/cargo-jetty-deployer</code> context on your server, for example <a href="http://production27:8080/cargo-jetty-deployer">http://production27:8080/cargo-jetty-deployer</a>, using any Web browser. If security is configured well, it should:</p><ul><li>Ask for a login and password</li><li>Ask again if the login is not valid</li><li>If the login is valid, show a page saying: <code>Command / is unknown</code></li></ul><table class="wysiwyg-macro" data-macro-name="tip" data-macro-default-parameter="Securing the password" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e3RpcDpTZWN1cmluZyB0aGUgcGFzc3dvcmR9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><p><strong>Note</strong>: Jetty's website has documentation on hashing the password.</p></td></tr></table><h3>Examples</h3><p>Here is an example Maven2 plugin configuration that:</p><ul><li>Deploys on a remote Jetty 6.x server</li><li>The server is on <code>production17</code>, port <code>8080</code></li><li>The Jetty remote deployer WAR is secured using the Jetty role <code>manager</code></li><li>A user called <code>someusername</code> with password <code>somepassword</code> is defined as <code>manager</code></li></ul><table class="wysiwyg-macro" data-macro-name="code" data-macro-default-parameter="xml" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGU6eG1sfQ&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre><dependencies> <dependency> <groupId>test.somegroup</groupId> <artifactId>somewar</artifactId> <version>1.0.0</version> <type>war</type> </dependency> </dependencies> ... <plugins> <plugin> <groupId>org.codehaus.cargo</groupId> <artifactId>cargo-maven2-plugin</artifactId> <version>${cargo.plugin.version}</version> <configuration> <container> <containerId>jetty6x</containerId> <type>remote</type> </container> <configuration> <type>runtime</type> <properties> <cargo.hostname>production17</cargo.hostname> <cargo.servlet.port>8080</cargo.servlet.port> <cargo.remote.username>someusername</cargo.remote.username> <cargo.remote.password>somepassword</cargo.remote.password> </properties> </configuration> <deployer> <type>remote</type> </deployer> <deployables> <deployable> <groupId>test.somegroup</groupId> <artifactId>somewar</artifactId> <type>war</type> <properties> <context>/myAppContext</context> </properties> </deployable> </deployables> </configuration> </plugin> </plugins> </pre></td></tr></table><p>To run the given Maven2 plugin configuration on a simple Maven2 WAR project, simply execute:</p><table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>mvn war:war mvn cargo:deploy </pre></td></tr></table><h3>Known issues</h3><table class="wysiwyg-macro" data-macro-name="note" data-macro-parameters="title=Unexpected end of file from server and maxIdleTime parameter" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e25vdGU6dGl0bGU9VW5leHBlY3RlZCBlbmQgb2YgZmlsZSBmcm9tIHNlcnZlciBhbmQgbWF4SWRsZVRpbWUgcGFyYW1ldGVyfQ&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><p>By default, Jetty sets the <code>maxIdleTime</code> parameter in the <code>etc/jetty.xml</code> file 30 seconds. This means that if the actual deployment takes more than 30 seconds, you might get error messages like:</p><table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>[ERROR] Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.2.2:deploy (default-cli) on project display: Execution default-cli of goal org.codehaus.cargo:cargo-maven2-plugin:1.2.2:deploy failed: Failed to deploy [/var/lib/jenkins/workspace/Vanessa-cargo/target/display-1.2.2.1-SNAPSHOT.war]: Unexpected end of file from server -> [Help 1] ... Caused by: java.net.SocketException: Unexpected end of file from server at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:770) at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:633) at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:767) at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:633) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1162) at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:397) at org.codehaus.cargo.container.jetty.JettyRemoteDeployer.getResponseMessage(JettyRemoteDeployer.java:262) at org.codehaus.cargo.container.jetty.JettyRemoteDeployer.deploy(JettyRemoteDeployer.java:113) ... 25 more</pre></td></tr></table><p>In this case, open the target Jetty container's <code>etc/jetty.xml</code> file and set the <code>maxIdleTime</code> parameter to longer. For example:</p><table class="wysiwyg-macro" data-macro-name="code" data-macro-parameters="language=html/xml" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGU6bGFuZ3VhZ2U9aHRtbC94bWx9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre><?xml version="1.0"?> <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd"> <Configure id="Server" class="org.mortbay.jetty.Server"> ... <Call name="addConnector"> <Arg> <New class="org.mortbay.jetty.nio.SelectChannelConnector"> ... <!-- Set a longer maxIdleTime (90 seconds in this case) to allow long remote deployments --> <Set name="maxIdleTime">90000</Set> ... </New> </Arg> </Call> ... </Configure></pre></td></tr></table></td></tr></table>
Please type the word appearing in the picture.
Attachments
Labels
Location
Watch this page
< Edit
Preview >
Loading…
Save
Cancel
Next hint
search
attachments
weblink
advanced