Skip to main content

JBoss 4.2.2 in Windows Server 2008

A little background on this project, and why I needed to run a vulnerable JBoss instance in my environment. I have a client that wanted to demo a web app that utilizes JBoss as it's prmary middleware. The web app is completly built around JBoss 4.2.2 so unfortunately I had no other option but to use it. Eventually, if the client decides to purchase the web app I will be putting extra security on the server so that the sensitive/hackable areas of JBoss are at least password protected, and I will post directions on that accordingly. As of now the only access to the server is through a VPN into the environment. The big security issues will occur when the client wants to access the web app via the internet without the VPN...

After successfully installing JBoss (easiest part of this whole thing), the client wanted it to be turned into a Windows service, then wanted it to bind on the host IP address or host name. This is so that they can access the web app without being connect to the server via RDP. JBoss by default binds to http://localhost:8080 so initially the only way to access the web app was RDP then a web browser pointed to localhost....The best solution would be to set up an Apache server to act as the proxy to pull the localhost to a host name or IP address, but that currently is beyond the scope of work, so I had to figure out how to accomplish this with the current Windows instance. If/when the client wants to access this web app via the internet, I will be setting up the Apache server to provide the proxy connection (I will of course post accordingly). Normally this is accomplished by adding a "-b 0.0.0.0" to the end of the "run.bat" command that would be issued in the command line. But this doesn't work with JBoss as a Windows service....Burred in the depths of the JBoss forums I was able to locate one small post that held the answer to this.

And thus the lack of a straight-through document was what lead me to post this little nugget of information. My goal was to be as straight through as possible so be sure to get your Googling on if you have any issues. I am not an expert in the subject, and like any good IT person, I decided to document after I finished the install and verified that everything is functional.....So it is possible I may have missed something here or there....At any rate, good luck!

Install JBoss 4.2.2 in Windows Server 2008 and run as service
Download and install FireFox or Chrome (IE 10 and 11 gives out too many errors)
Download and install Java JKD and JRE 6u26 <this version was required by the web app>
Download JBoss zip file <found here>
Extract to c:/Program Files
Use Administrative command prompt and run the following commands:
  • cd c:\Program Files\jboss-4.2.2.GA\bin
  •  Run.bat
Test the install by opening FireFox and navigating to http://localhost:8080

Install as a Service:
Download binaries 2.0.10-windows x64 zip <found here>
Extract the file and copy from the bin directory
·        Jbosssvc
·        Jbossweb.x64
·        Jbosswebw.x64
·        README-service
·        Service.bat
Paste files into jboss-4.2.2.GA\bin directory

Necessary changes will need to be made to the service.bat file as it is originally written for JBoss 5+. You will need to locate any references to the version of JBoss and edit accordingly by replacing the version number in the file with the version number of the JBoss instillation. There are about three of these instinces at the beginning of the file under: “set SVCNAME” and “set SVCDISP”.

Use Administrative command prompt and issue commands
  • cd c:\Program Files\jboss-4.2.2.GA\bin
  • service.bat install

You should now be able to issue the net start/stop commands and/or see the new JBoss service in the services.msc. Attempt to start the service after you have installed it. If it starts without error open FireFox and navigate to http://localhost:8080  

If you receive any errors issue when attempting to start the service;

 Take note of the service name

  •   right click on the service and select Properties
  • Issue the following command in an Administrative Command propt in the JBoss "bin" directory to remove the service:
    • service.bat uninstall ; or
    • sc delete <service-name>
·        Go back to your service.bat file to make the necessary changes (you may need to do some Googling depending on the error)

Get JBoss Service to bind on any address other than “localhost”
Ideally this is done through a connected Apache server that acts as proxy between JBoss on “localhost”, but can be accomplished without the Apache server with the following:

If JBoss is running be sure to stop the service before editing the service.bat file.

In the service.bat file you will need to add “-b 0.0.0.0” after the “call run.bat” in two locations. They should be changed to the following examples:
  1.  :cmdStart
    1. call run.bat –b 0.0.0.0  < .r.lock >> run.log 2>&1
  2. :cmdRestart
    1. call run.bat –b 0.0.0.0  < .r.lock >> run.log 2>&1

Save the service.bat file and start the JBoss service. You should now be able to get to JBoss using either: http://<hostIP>:8080 or http://<hostDNSname>:8080



References:
Hideo, M (2007, October 18. Jboss application server 4.2 instillation guide.Retrieved from http://docs.jboss.org/jbossas/docs/Installation_Guide/4/pdf/Installation_Guide.pdf

Johnson, P. (2009, December 01). Re: how to provide the bind address when running jboss as a [Online forum comment]. Retrieved from https://community.jboss.org/message/206191 

running jboss web as windows service. (n.d.). retrieved from http://www.jboss.org/jbossweb/install/service.html

Comments

Popular posts from this blog

Using Python for GPG/PGP File Encryption - Part 1

So, this will be the start of a series that will build a python script for GPG/PGP file encryption. In this post, we'll look at installing gnupg for python and using python to setup the keystore, create a private key, exporting the associated public key, and importing a public key. Now everything done here can be done with simple gnupg commands, but learning how to do this with python will help in understanding the script we'll be building to complete file encryption. I will be covering non-python gnupg commands in a future post. Additionally, the folks at the python-gnupg site over at pythonhosted.org have done a really great job at documenting everything (link to their site at the bottom). The stuff I'll be going over will be more of a start-to-finish for anyone that may get lost in the muck of doing stuff with python. Full Disclosure #1: Any key identifier throughout the series of posts is FICTITIOUS and DOES NOT represent any real key, either associated with myself or...

Windows Server 2008: Log on as batch job

From time to time, I have to set up some scheduled tasks that required a dedicated account to run. And when doing so, I'll usually forget that the dedicated account usually isn't given any more permissions than what it needs to complete the task at hand. So, after setting up the task, Windows will usually yell at me and say "The account needs batch job rights". So here's how to grant batch job permissions on your server. Go to your start menu, and start searching for Local Security Policy In the left pane of the MMC that opens up, expand Local Policies, and highlight User Rights Assignment. Now, in the left right pane, locate "Log on as a batch job" and double click it. In the properties window that opens up, add the user or group that needs this permission. I find that if you have multiple service accounts running different tasks on the same server, it's easier to just add a group verses the individual a...

Replacing rsyslog with syslog-ng on RHEL 6.5

So...I had a piece of monitoring software that didn't play nice with the RHEL default rsyslog for log collection. The software was developed to only work with syslog-ng. I'll be going over the steps that I took, that worked for me, in replacing rsyslog with syslog-ng. I would imagine that these same steps should work for any Linux system similar to RHEL (Fedora, CentOS, etc.). For others (like Debein based distributions), I would need to look into that (coming in a future update to this post). First, remove rsyslog. You will need to keep the dependencies as they will be needed for syslog-ng: sudo rpm -e --nodeps rsyslog Next we will need to add the EPEL repository (more info can be found HERE ): wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm sudo rpm -ivh epel-release-6-8.rpm sudo yum repolist That last command will list all the installed repositories. You are simply verifying that the EPEL package has been installed. Now that we fi...