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

March 15, 2018 262 views
Apache Java Ubuntu 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 !!

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.
Have another answer? Share your knowledge.