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!
JavaSince 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.
Tomcat installation and setup
- 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
- 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.
- Configure the tomcat users and security settings according to tomcat documentation.
- 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
- Create new data base within MySql server called "chemsystem". For that, run:
CREATE DATABASE chemsystem;To make sure everything went well, you may run
- 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');
- In order for this change to take effect, we have to call 'FLUSH PRIVILEGES',
so that MySql Server can reload the new data into
- Let's make sure the server picked up the changes
SHOW GRANTS FOR deployer@localhost;
- 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. You may deploy the application by uploading "chemicalmanager.war" straight thru the web UI form, which is prett straight forward
- 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.
- Our "chemicalmanager.war" includes all dependency libraries,
but if you deploy now from *.war file the depandency list is:
- 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.