Deploy Web Applications to Remote Tomcat Server - nordpos/nordpos GitHub Wiki

Install servlet container

Install Tomcat 7 for Ubuntu 14.04

Run the following command to start the installation Tomcat 7:

$ sudo apt-get install tomcat7

With the following command, you will be install the Tomcat web interface (manager webapp):

$ sudo apt-get install tomcat7-admin

After installation, you must add a login to our Tomcat server. You will do this by editing the tomcat-users.xml file:

$ sudo nano /etc/tomcat7/tomcat-users.xml

You need to implement this section:

<tomcat-users>
    <user username="admin" password="password" roles="manager-gui,admin-gui"/>
</tomcat-users>

Save and quit the tomcat-users.xml file. To put you changes into effect, restart the Tomcat service:

$ sudo service tomcat7 restart

Deploy Java servlet

Download a last release of the web-application servlet. Now available three type of packages:

For example can unzip web-application.war and change context parameters of your servlet. After you need open the Tomcat web management interface in a web browser:

http://your_ip_address:8080/manager

You will by select Java servlet package in WAR file to deploy section of the web management interface:

Tomcat servlet deploy

After deployed you can management a product catalog servlet in the Applications section:

Product catalog deployed

Set context parameters

Database parameters

The ORMLite library of the servlet uses the settings for JDBC connection to the database of your application. You need change the values of the servlet context parameters in /WEB-INF/web.xml.

    <context-param>
        <param-name>db.URL</param-name>
        <param-value>jdbc:mysql://localhost:3306/demo-database?useUnicode=yes&amp;characterEncoding=UTF-8</param-value>
    </context-param>

    <context-param>
        <param-name>db.user</param-name>
        <param-value>dbuser</param-value>
    </context-param>
    
    <context-param>
        <param-name>db.password</param-name>
        <param-value>dbpassword</param-value>
    </context-param>

Application parameters

Also you need set application ID in the /WEB-INF/web.xml. Example, the ID parameter of Openbravo POS is an openbravopos.

    <context-param>
        <param-name>db.application.id</param-name>
        <param-value>openbravopos</param-value>
    </context-param>

Upgrade application database

Before start servlet you need upgrade Openbravo POS, uniCenta oPOS and Wanda POS database. NORD POS DAO support these applications, but you need upgrade the exists database(example for MySQL):

ALTER TABLE TAXES ADD COLUMN VALIDFROM DATETIME DEFAULT '2001-01-01 00:00:00' NOT NULL;

ALTER TABLE TICKETLINES ADD COLUMN ID VARCHAR(255);
ALTER TABLE CATEGORIES ADD COLUMN CODE VARCHAR(255);
ALTER TABLE LOCATIONS ADD COLUMN ISCLOSE BIT DEFAULT b'0' NOT NULL;
ALTER TABLE CUSTOMERS ADD COLUMN PROPERTIES MEDIUMBLOB;
ALTER TABLE STOCKCURRENT ADD COLUMN ID VARCHAR(255);
ALTER TABLE PEOPLE ADD COLUMN PROPERTIES MEDIUMBLOB;

After upgrade you can use jointly desktop and web application.


These changes do not affect to the compatibility the desktop POS and web-servlet, after upgrade you can use both your applications and mobile POS back-end.

⚠️ **GitHub.com Fallback** ⚠️