简体   繁体   中英

Using Java web service on Amazon cloud

I want to make a web service in java which will take arguments and do processing and return a json response. I am not been able to figure out how to deploy this service on amazon ie (on ec2 or some where else) . what will be the url to hit my service and where to save my java program. Please provide any better way if there is any.

This is pretty standard in terms of deployment.

First - create a EC2 box, this will be your server, you'll need to configure the firewall to allow connections over HTTP port 8080.

Second - install Tomcat on said EC2 box.

Third - upload your war file to said Tomcat instance.

Fourth (optional) - give your EC2 box a static IP.

There's a very similar answer here , the only really extra bit you'll have to do is connect to a database if that's what your web service does. Consider also you may want to put an apache config to route requests from 80 to 8080, but it's really up to you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM