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
Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
View Events Video Library
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Integrating PostgreSQL Databases with ANF: Join this workshop to learn how to create a PostgreSQL server using Instaclustr’s managed service

Mobile Database Essentials: Assess data needs, storage requirements, and more when leveraging databases for cloud and edge applications.

Monitoring and Observability for LLMs: Datadog and Google Cloud discuss how to achieve optimal AI model performance.

Automated Testing: The latest on architecture, TDD, and the benefits of AI and low-code tools.

Related

  • Okta + SAML + JBoss EAP 6.4.x + Picketlink
  • Deploy a Java application using Helm, Part 2
  • Deploy a Java application using Helm, Part 1
  • Migration of Java-Based Web Applications From Commercial to Open Source Software

Trending

  • Modular Software Architecture: Advantages and Disadvantages of Using Monolith, Microservices and Modular Monolith
  • Unleashing the Power of Microservices With Spring Cloud
  • How To Aim for High GC Throughput
  • Agile Estimation: Techniques and Tips for Success
  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.

Ravi Isnab user avatar by
Ravi Isnab
·
Dec. 31, 14 · Tutorial
Like (1)
Save
Tweet
Share
24.13K 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, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Okta + SAML + JBoss EAP 6.4.x + Picketlink
  • Deploy a Java application using Helm, Part 2
  • Deploy a Java application using Helm, Part 1
  • Migration of Java-Based Web Applications From Commercial to Open Source Software

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

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

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: