FP-Medium deployment for SCAN
Depends on having completed the steps outlined in FP-Lite deployment for SCAN
This section assumes that you have the mysql-server and mysql-client packages installed and have logged in as the mysql root user.
1) Create the messagestore database, user, and grant the appropriate permissions:
CREATE DATABASE messagestore; CREATE USER 'messagestore'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON messagestore.* TO 'messagestore'@'localhost';
2) Exit mysql and obtain the messagestore schema dump from http://sourceforge.net/projects/filteredpush/files/Release_1/misc/messagestore.sql/download
3) Import the messagestore schema dump into the database:
mysql -umessagestore -p -D messagestore < messagestore.sql
1) Create the fpannotationprocessor database, user, and grant the appropriate permissions:
CREATE DATABASE fpannotationprocessor; CREATE USER 'fpweb'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON fpannotationprocessor.* TO 'fpweb'@'localhost';
2) Exit mysql and obtain the fpannotationprocessor schema dump from https://sourceforge.net/projects/filteredpush/files/Release_1/misc/fpannotationprocessor.sql/download
3) Import the fpannotationprocessor schema dump into the database:
mysql -ufpweb -p -D fpannotationprocessor < fpannotationprocessor.sql
Installing and Configuring Glassfish
Make sure that the jdk your system is using is the sun jdk and not open jdk (java -version). If you need to set up sun jdk, download Java 6 from the Oracle site and use update-alternatives (see https://help.ubuntu.com/community/Java)
1) Download the glassfish zip file from http://glassfish.java.net/downloads/188.8.131.52-final.html (latest version at the time of writing). Unzip and deploy:
sudo unzip glassfish-184.108.40.206.zip sudo mv glassfish3 /usr/share/
2) Download and extract mysql-connector-java-5.1.20.jar from the archive found at http://www.mysql.com/downloads/connector/j/. Deploy to glassfish in domain1
sudo tar -xzvf mysql-connector-java-5.1.22.tar.gz cd mysql-connector-java-5.1.22 sudo cp mysql-connector-java-5.1.22-bin.jar /usr/share/glassfish3/glassfish/domains/domain1/lib/
4) If you also have Tomcat installed, edit /usr/share/glassfish3/glassfish/domains/domain1/config/domain.xml and replace all references to port=8080 with something like port=8081 so that glassfish will not conflict with tomcat (look under the network listeners element)
4) Obtain the example startup script for glassfish from the filteredpush sourceforge site (http://sourceforge.net/projects/filteredpush/files/Release_1/misc/glassfish/download, make sure that the JAVA_HOME variable is set to point to the correct directory and set it up via the following. The update-rc.d command will set the script to automatically start the server on boot and stop it on shutdown:
sudo mv glassfish /etc/init.d/ sudo chmod 755 /etc/init.d/glassfish sudo update-rc.d glassfish defaults
NOTE: If you plan on using the admin control panel via web browser remotely you must configure the admin user password and secure access via the following:
sudo /usr/share/glassfish3/glassfish/bin/asadmin change-admin-password --user admin sudo /etc/init.d/glassfish start sudo /usr/share/glassfish3/glassfish/bin/asadmin enable-secure-admin --port 4848
5) Start glassfish and navigate to the admin control panel at http://localhost:4848 in a browser window:
sudo /etc/init.d/glassfish start
6) On the left side of the admin page select Resources > JDBC > Connection Pools and create a new connection pool named "mysql_messagestore" with the resource set as java.sql.ConnectionPoolDataSource and MySql selected as the vendor before clicking next.
7) In step two, you should configure the User, Password and DatabaseName properties at a minimum (for the messagestore database we created previously in MySql). Also, append the database name to the URL property (like jdbc:mysql://:3306/messagestore). Once you have done this click the finish button. Select the connection pool again from the list and edit it. On the edit page click the ping button to test your configuration (you should get a "Ping Succeeded message").
8) Now on the left select Resources > JDBC > JDBC Resources and create a new resource "jdbc/__mysql_messagestore" and in the Pool Name dropdown box select the connection pool you just created.
Note: if you end up using a different name for your connection pool you must edit the persistence.xml file in the src/main/resources/META-INF directory of the FP-Messaging-SparqlPuSH project.
Deploying the EAR
Obtain the latest release of the FP-EAR file from the sourceforge. This will contain the Annotation Generator and Filteredpush Node components for deployment to the Glassfish JavaEE container.
NOTE: In order for the FP-Medium EAR to work you must have deployed FP-Lite as described in FP-Lite_deployment_for_SCAN to meet all the prerequisites (i.e. Annotation Generator, SparqlPuSH).
1) In the Glassfish Admin Console click on the Common Tasks label on the left on top of the nav bar. Under "Deployment" on the page that appears click the "Deploy an Application" option.
2) Next click the Choose File button to select the Filteredpush ear file to deploy (i.e. FP-EAR-0.0.1-SNAPSHOT.ear). Keep the default options that are loaded and click the OK button to load the ear. If no errors are output the deployment was successful.
1) Download and extract mysql-connector-java-5.1.20.jar from the archive found at http://www.mysql.com/downloads/connector/j/. Place this in your tomcat7 lib directory (i.e. /usr/share/tomcat7/lib)
tar -xzvf mysql-connector-java-5.1.22.tar.gz cd mysql-connector-java-5.1.22 sudo cp mysql-connector-java-5.1.22-bin.jar /usr/share/glassfish3/glassfish/domains/domain1/lib/
2) Obtain the war file for the Annotation Processor from Sourceforge and copy it to your Tomcat webapps directory. One the app has deployed, restart Tomcat.