DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Evolution of Recommendation Systems: From Legacy Rules Engines to Machine Learning
  • Okta + SAML + JBoss EAP 6.4.x + Picketlink

Trending

  • Building Production-Grade GenAI on GCP with Vertex AI Agent Builder
  • The Developer's Guide to Context-Aware AI: When Your Code Documentation Becomes Intelligent
  • Querying Without a Query Language
  • Why Google Data Migration Gets Stuck at 99%: Causes and Proven Fixes
  1. DZone
  2. Coding
  3. Java
  4. Deploying Static Content on JBoss Server

Deploying Static Content on JBoss Server

Learn how to deploy static content on a JBoss server.

By 
Ravi Isnab user avatar
Ravi Isnab
·
Dec. 31, 14 · Tutorial
Likes (1)
Comment
Save
Tweet
Share
26.3K Views

Join the DZone community and get the full member experience.

Join For Free

Recently, I had a question from a commenter on my blog post on installing ELK stack on Ubuntu/Debian. The question was how to serve kibana 3 via a server like jboss. Kibana 3 is essentially (more or less) static content. It serves html and content changes based on it's querying elasticsearch via javascript. I couldn't find any blog with all the instructions in one page for serving static content via Jboss. So here it is:

These instructions are for JBoss Application Server 7:

Install JBoss

If you already have JBoss installed then you can skip this step.

Download and extract JBoss:

cd /tmp  
wget http://download.jboss.org/jbossas/7.1/jboss-as-7.1.1.Final/jboss-as-7.1.1.Final.tar.gz
tar -xvf jboss-as-7.1.1.Final.tar.gz

Move extracted JBoss to /usr/local/share


mv /tmp/jboss-as-7.1.1.Final /usr/local/share/jboss-7.1.1  
Deploying static content to JBoss:


  • Create a directory called yourwebapp.war inside/usr/local/share/jboss/standalone/deployments
  • Create a file name yourwebapp.war.dodeploy in/usr/local/share/jboss/standalone/deployments
  • Create a directory WEB-INF inside yourwebapp.war
  • Create a file web.xml with contents shown below
<?xml version="1.0" encoding="ISO-8859-1" ?>

<web-app xmlns="http://java.sun.com/xml/ns/j2ee"  
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
    version="2.4">
</web-app>
  • Start JBoss
  • Browse to your server's ipaddress:8080/yourwebapp
An example of deploying static content to JBoss:

I am demonstrating static content deployment to JBoss with kibana 3 content.

cd /usr/local/share/jboss-7.1.1/standalone/deployments/  
sudo mkdir -p kibana.war/WEB-INF  
sudo cp -r /tmp/kibana-3.1.2/* kibana.war  
sudo touch kibana.war.dodeploy  

Create web.xml with contents shown below: vi kibana.war/WEB-INF/web.xml


<?xml version="1.0" encoding="ISO-8859-1" ?>

<web-app xmlns="http://java.sun.com/xml/ns/j2ee"  
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
    version="2.4">
</web-app>  

Start JBoss:


cd /usr/local/share/jboss  
./bin/standalone.sh -Djboss.bind.address=192.168.1.8 -Djboss.bind.address.management=192.168.1.8

Browse to: http://192.168.1.8:8080/kibana

Please replace 192.168.1.8 with your server's ip address



JBoss

Published at DZone with permission of Ravi Isnab. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Evolution of Recommendation Systems: From Legacy Rules Engines to Machine Learning
  • Okta + SAML + JBoss EAP 6.4.x + Picketlink

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook