The following is a howto for installing Jboss under Red Hat Enterprise Linux or CentOS. The steps are most likely the same under any other Linux distro.
- Unpack your jboss.zip (or .tar)
- Jboss requires a ‘place’ to store data as it runs. Out of the box it uses org.jboss.jdbc.HypersonicDatabase which is horribly inefficient and should never be used in a production system. So we’ll set up MySQL such that jboss can write to it (installing and configuring MySQL is an excersize for the reader) and create a DataStore instance in jboss that points to the MySQL server:
Add a jboss user to MySQL (This is with a 5.x version of MySQL)
INSERT INTO `user` VALUES (‘localhost’, ‘jboss’, ‘5d2e19393cc5ef67’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘N’, ‘N’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘N’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘N’, ”, ”, ”, ”, 0, 0, 0, 0)
Create a table for jboss
- Create a DataSource definition:
Copy mysql-ds.xml from $JBOSS_HOME/docs/examples/jcs/mysql-ds.xml to $JBOSS_HOME/server_profile/deploy
Edit the mysql-ds.xml:
Change JNDI name to: DefaultDS
Update the URL to point to the MySQL server and jboss database.
Remove the ‘zeroDateTimeBehavior=convertToNull’ connection argument
# mv deploy/hsqldb-ds.xml deploy/hsqldb-ds.xml.removed. This will disable the default HyperSonic db DataStore.
- Unistall the services that you do not need. This will greatly depend on what it is that you are trying to do with this application server instance. Following are some examples of services that are removed and how to do it. Each one is a bit different.
javamail:
In deployers/jsr77-deployers-jboss-beans.xml: Comment out the following: <property name=”mailService”>jboss:service=Mail</property>
# mv deploy/mail-service.xml deploy/mail-service.xml.removed
hornetq:
# rm -rf deploy/jms-ra.rar/
# rm -rf deploy/hornetq/
# mv deployers/hornetq-deployers-jboss-beans.xml deployers/hornetq-deployers-jboss-beans.xml.removedclustering:
# mv ./deployers/clustering-deployer-jboss-beans.xml ./deployers/clustering-deployer-jboss-beans.xml.removed
# rm -rf ./deploy/mod_cluster.sar/
- Update the admin console password:
Edit: $JBOSS_HOME/server_profile/conf/props/jmx-console-users.properties
Add a uid/password combination in the following format: uid=password
- Secure the jmx-console:
Copy the jmx-console.war from the common directory into the server_profile server dir.
# cp -Rpf ./common/deploy/jmx-console.war/ server/amap/deploy
Edit: ./deploy/jmx-console.war/WEB-INF/jboss-web.xml
Uncomment the <security-domain> node
Edit: ./deploy/jmx-console.war/WEB-INF/web.xml
Uncomment the <security-constraint> node
Edit: ./deploy/jmx-jboss-beans.xml
Uncomment the line: <property name=”securityDomain”>jmx-console</property>
Edit: conf/props/jmx-console-users.properties
Change the password
With that, you should have an instance of JBoss up and running and ready for you to develop your applications.