From the archive: first published in April 2012 on my old blog, Tux86’s Web Tech Blog. Versions, links and screenshots are from that time.
This article covers deploying OpenACS, a powerful open-source Auto-Configuration Server (ACS) that implements CWMP, the CPE configuration protocol specified in TR-069. At the time of writing, I deployed the latest version, “0.4 beta”, available from the project’s SourceForge page.
The four sections below explain how to prepare the deployment environment, configure JBoss AS 5.1 GA and deploy OpenACS.
Note: I used Red Hat Enterprise Linux 5 as the OS. The same steps can be adapted to other Linux distributions or to other platforms such as Windows or Mac.
1. Installing JDK 1.6
To install JDK 1.6, open a terminal, log in as root and run this command:
root@localhost [~]# yum install java-1.6.0-sun-devel
2. Installing JBoss AS 5.1 GA
As described on the OpenACS wiki, the application can only be deployed on JBoss AS 4.2.x, and our goal is to run it on JBoss AS 5.1. Even though you will use JBoss AS 5.1, you still need JBoss AS 4.2.3 to recover some JAR files from it. So let’s download JBoss AS 4.2.3 using the link below.
Download link: http://sourceforge.net/projects/jboss/files/JBoss/JBoss-4.2.3.GA
Next, download JBoss AS 5.1 GA, which will run OpenACS.
Download link: http://sourceforge.net/projects/jboss/files/JBoss/JBoss-5.1.0.GA/jboss-5.1.0.GA-jdk6.zip/download
Installing JBoss is quite easy: once the zip files are downloaded, you only have to extract them with a graphical tool or a command-line zip utility. I used the unzip CLI utility included in most Linux distributions, as shown below.
Unzip the jboss-4.2.3.GA-jdk6.zip archive:
root@localhost [~]# unzip jboss-4.2.3.GA-jdk6.zip
Do the same with the jboss-5.1.0.GA-jdk6.zip archive:
root@localhost [~]# unzip jboss-5.1.0.GA-jdk6.zip
Running JBoss 5.1 GA
Now let’s check that JBoss AS 5.1 runs without problems. Move to the bin directory in the JBoss AS 5.1 root folder and execute run.sh with these commands:
root@localhost [~]# cd jboss-5.1.0.GA/bin
root@localhost [~]# ./run.sh
JBoss can take a while to start, so be patient until a message like the one below is printed on the screen. That means it’s fine!
10:57:18,603 INFO [ServerImpl] JBoss (Microcontainer) [5.1.0.GA (build: SVNTag=JBoss_5_1_0_GA date=200905221053)] Started in 1m:4s:686ms
3. Configuring JBoss AS 5.1 to support OpenACS
First, copy commons-httpclient.jar from the default server’s lib directory in JBoss AS 4.2.3 to the same directory in JBoss AS 5.1:
root@localhost [~]# cp jboss-4.2.3.GA/server/default/lib/commons-httpclient.jar jboss-5.1.0.GA/server/default/lib
Download the MySQL JDBC driver mysql-connector-java-5.1.0-bin.jar from this link and copy it into the lib directory of the JBoss AS 5.1 default server:
root@localhost [~]# cp /my-download-path/mysql-connector-java-5.1.0-bin.jar jboss-5.1.0.GA/server/default/lib
Edit the file deployers/ejb-deployer-jboss-beans.xml:
root@localhost [~]# vi jboss-5.1.0.GA/server/default/deployers/ejb-deployer-jboss-beans.xml
and change the strictVerifier property value from true to false, as shown in this snippet:
<!-- Setting this to 'true' will cause all deployments
to fail when the Verifier detected a problem with the contained
Beans. If false, warnings/errors will be logged but the deployment
will not fail.
-->
<property name="strictVerifier">false</property>
</bean>
The final step of the JBoss configuration is to copy the content of lib/endorsed in JBoss AS 4.2.3 into the same folder in JBoss AS 5.1:
root@localhost [~]# cp jboss-4.2.3.GA/lib/endorsed/* jboss-5.1.0.GA/lib/endorsed
By default, JBoss AS 5.1’s run script passes the -Djava.endorsed.dirs option. If it doesn’t, add the line below at the end of the run.conf file found under jboss-5.1.0.GA/bin:
JAVA_OPTS="$JAVA_OPTS -Djava.endorsed.dirs=<YOUR_JBOSS_HOME>/lib/endorsed"
Note: replace <YOUR_JBOSS_HOME> with the absolute path of the JBoss installation directory.
4. Deploying OpenACS
To deploy OpenACS, go back to the OpenACS binary archive you downloaded earlier and unzip it:
root@localhost [~]# unzip openacs-bin-0.4.zip
root@localhost [~]# cd openacs
Copy acs.ear and openacs-ds.xml to your default deployment directory, typically server/default/deploy under the JBoss AS 5.1 GA installation directory.
Edit openacs-ds.xml to match your database environment. Set up a MySQL database server, then create a database and a user matching the ones you configured in openacs-ds.xml. acs-service.xml goes to server/default/deploy too.
Finally, you can start JBoss AS 5.1.
Note: as a best practice, it’s highly recommended to configure JBoss to run as a service/daemon.
The web interface is available on your installation host under the URL /openacs (e.g. http://localhost:8080/openacs). Devices should be configured to reach the ACS at http://your_host:8080/openacs/acs.
That’s all, I hope you find this helpful. All your comments are welcome!