Run a java Project on my current machine (ubuntu 16.04 along with LAMP)

Posted March 15, 2018 2.7k views
ApacheJavaUbuntu 16.04

Hi Guys,
Since i am from Coding background and have less knowledge on Server Part, I have my 3-4 websites which are running on current Machine (built in Advance PHP). on LAMP.
Now i have a java web application which has mysql database.
Can you Please help me out in running that java web application on My LAP Stack.
This should not affect my current PHP web applications.
Please reply fast !!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

There are multiple ways you can do this and/or setup server configuration(s) to accomplish this.

In a single droplet situation you can use a proxy server like NGINX or HAProxy to answer on ports 80/443 and route the traffic to the appropriate backend server/project - In your case this would be your LAMP and Java projects - Each of these project would need to be configured to answer on a different port then 80/443 like 8080, 81, this is up to you.

Here is a great start on how to do so with NGINX:

by Justin Ellingwood
Nginx is an incredibly powerful web server and reverse proxy. In this guide, we'll discuss how to set up server blocks on Ubuntu 14.04 in order to server multiple domains from a single server.