Step-by-step Deployment procedure

If you read this, you're probably an IT guy, so be ready to dive into a lot of technical details.

As for our best experience, this stage is fairly the most painful, since numerous unexpected problems may arise, depending on your OS, it's version, tomcat version, MySql version and so on. We are here to guide you thru this process with as little hassle as possible. So let's go and do that!

  1. Java

    Since the application back-end is written in JAVA you need to install JAVA on your server. You may download it here. Pick a right release to download, depending on your platform, either Linux or Windows. Download it here.
  2. Tomcat installation and setup

    1. The application was tested with tomcat5.5 and tomcat6.0. We had some issues with tomcat7.0, but since tomcat6.0 was good enough, we didn't tune it to work with tomcat7.0. Get tomcat6.0 here
    2. You will need to configure $JAVA_HOME or $JRE_HOME point to your Java installation. In addition, if you haven't used windows installer you will have to setup $CATALINA_HOME too.
    3. Configure the tomcat users and security settings according to tomcat documentation.
  3. MySql prerequisites

    1. Install MySql server on your server machine. We tested our application with MySql v5.5. Very good chance it will work with different versions. Get it here
    2. Create new data base within MySql server called "chemsystem". For that, run:

      CREATE DATABASE chemsystem;

      To make sure everything went well, you may run


    3. We don't want to connect to MySql server with root user, thus we will create new MySql user designated solely for that purpose: connecting from Java application. Right now we want the application to be allowed to connect to the server with 'deployer'. For that we have to grant the user respective priveleges on our newly created database. Instead of calling:

      GRANT ALL PRIVILEGES ON chemsystem.* TO 'deployer'@'localhost' IDENTIFIED BY '%%june2011';

      which usually doesn't do the expected work, we will go in different manner(You are highly recommended to change the credentials here and after that to update them in context.xml that ships with 'chemicalmanager.war'):

      INSERT INTO user VALUES('localhost','deployer',PASSWORD('%%june2011'), 'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y', 'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0, '', 'NULL');

    4. In order for this change to take effect, we have to call 'FLUSH PRIVILEGES', so that MySql Server can reload the new data into the memory


    5. Let's make sure the server picked up the changes

      SHOW GRANTS FOR deployer@localhost;

    6. Deployment itself

      1. Right now we go to http://localhost:8080/manager/html , if you deploy locally and haven't reconfigured the port tomcat is listening to. Otherwise go to another url respectively.
      2. You may deploy the application by uploading "chemicalmanager.war" straight thru the web UI form, which is prett straight forward
      3. Another way to deploy is to ssh to remote machine where you deploy (if it is remote), unpacking the "chemicalmanager.war" to tomcat's webapps directory, and restarting the server.
      4. Our "chemicalmanager.war" includes all dependency libraries, but if you deploy now from *.war file the depandency list is:
        1. servlet-api.jar
        2. commons-io-2.0.1.jar
        3. commons-fileupload-1.2.2.jar
        4. poi-3.7-20101029.jar
        5. mysql-connector-java-5.1.12-bin.jar
    7. Known issues

      1. If you deploy on Fedora, you may have a difficulty with 'selinux' which is some kind of security deamon which prevents OS applications from performing none safe actions. These actions might compromise whole OS security. One of the advanced SQL features application performs is dumping a file into a directory other than the MySql main directory; obviously this operation may pose some danger. Thus, you might be required to configure selinux to allow this operation. Details on that are to come.