Tag Archives: tomcat

Maven remote deploy

Remote deploy to a Tomcat Server using Maven 3

1. Install maven tomcat7 plugin (you need manager application in tomcat7 – comes by default)

 

2. Configure maven settings.xml in ~/.m2/ (or the place where maven is reading settings.xml)

 

3. Configure tomcat users in /usr/share/apache-tomcat-7.0.39/conf/tomcat-users.xml

 

4. Execute Maven goals

 

5. Tips and Tricks

It is preferable to have a maven profile for each server (DEV, TEST, PROD), in case you have database connections and servers are different. In this way, your war file will be build with predefined IP addresses and parameters for each particular deploy.

Reverse Proxy Nginx -> Tomcat

reverse proxyWe need two servers:

  • NGINX
    • Serve static files
    • Serve maintenance page
    • Control access via GeoIP tables
    • Offer HTTPS protocol to clients (443)
    • Maintain reverse proxy to Tomcat on HTTP
  • TOMCAT
    • Will hold deployed application
    • Communicates on port 8080

For a reverse proxy we need to configure nginx:

nginx.conf

 

site.conf

 

Tomcat configuration more simple:

server.xml

Install Tomcat on MacOSX

Download latest version of Tomcat (tar.gz) from http://tomcat.apache.org/

In my case I am using apache-tomcat-7.0.33.tar.gz

 

Extract the archive:

 

Move the extracted directory to /usr/local:

 

Remove old Tomcat (if available)

 

Create a symlink to Library directory:

 

If you want to access manager, edit /conf/tomcat-users.xml and add:

Then you can login with “myname” and “secret”