deploy SpringBoot + Angular webapp in iis remote server - java

I have a Spring boot application, If I want to run that application locally we can run with spring-boot:run Or by just executing the main class our project is ready to work. But here I want to deploy the same on IIS Server.
I have an angular app, by just adding the path and running ng build --prod is sufficient to run in the IIS but when coming to java I am confused to run the application in IIS.
I dont think so it will work with spring-boot:run as it is using internal tomcat server, But in the IIS how do we need to deploy this application.
i tried it by making package and run it as a service in remote but it is not working.

You can directly install java app inside of Tomcat or docker. You can see this answer for more details https://stackoverflow.com/a/59463209/8684299 written by
Brando Zhang.
P.S. I don't have enough reputation to comment hence I am writing this in answer section instead.

Related

Why using Tomcat and not "java -jar"?

I'm creating a job in jenkins to deploy a springboot application to Tomcat.
I'm trying to understand why should I deploy an application to Tomcat? Why not just run the application on the server by "java -jar" command?
In my previous workplace we deployed the springboot application by creating a war file and "java -jar" command. We used "kill" to shut down the application and "java -jar" again to deploy a new version...
I understand that Tomcat has a big advantage here and I would like to understand what is it?
Google says me how to work with tomcat but I couldn't find a real explanation why need it except this that says:
It provides a management dashboard from which you can deploy a new web application, or undeploy an existing one without having to restart the container. This is especially useful in production environments.
But what do I have to manage here?

deploy a java EE application on a live server

I've just finished developing a java ee application with tomcat and spring boot and angularjs and mysql on localhost, please can any body help how to deploy this app to run on live server and what are the changes must be done before generate the war ( i meant the porte 8080 and mysql porte) because finally i want tu run my app on http://myserver.com/myapp/ instead of http://myserver.com:8080/myapp/
If you're using Spring Boot, don't use the war option. Build a fat jar instead. That's the more common way of deploying Sprint Boot and it will save you an incredible amount of pain like this. For example, your complaint about ports is (going on memory) solved liked this:
java -Dserver.port=80 -jar some-service.jar
or
export SERVER_PORT=80
java -jar some-service.jar
FWIW, Spring Boot bundles Tomcat with the fat jar.

Run Spring MVC project on Tomcat server

Hi I am a newbie with Spring MVC and I have a little problem.
I can't deploy this project on a Tomcat server. https://spring.io/guides/gs/securing-web/
I can run the project by running it as an application. And you see everything starting in the console, with a spring boot. And if I go to http://localhost:8080/ I see the right page.
I think this is deployed on an internal Tomcat server, but what do I have to do if I want to deploy it on another server, raspberry pi or a BeagleBone with a Tomcat server installed on it ?
I tried to use the WAR file to deploy on an external tomcat server but that doesn't work because i think its because this project doesn't use a WEB-INF folder and also has no web.xml file.
Thanks.

deploy a war file in Jboss 7.0.2

I have a problem in deploying the war file in Jboss7.0.2. when i deployed first time. it worked fine. i made few more changes(added one more end point) and after that i was not able to deploy the war. NO ERROR. but the new service is not getting deployed. But I am able to hit the old services.
steps i followed to deploy it,
1.stop the server
2.Remove the war file from
jboss-as-web-7.0.2/domain/servers/server-one/deployments/
3. Copy the new war file in to the same location.
4. Start the server.
do i need to do anything other than that? Please help me.
Instead of deploying by copying and pasting war files back and forth, use the native interface (CLI) or the http interface (admin-console). The deployment works differently in the domain mode.
I love the CLI interface to deploy files quickly. Example of deploying using the CLI in domain mode.
Make sure that jboss is running (domain.sh was executed)
Go to $JBOSS_HOME/bin.
run ./jboss-admin.sh -c (or ./jboss-cli.sh -c if 7.1 or later)
then run the following command in the CLI prompt:
4.1 To deploy: deploy <war_file> --server-groups=server-one
-->you should see a success/failure message
4.2 To undeploy: undeploy <war_file> --server-groups=server-one
-->you should see a success/failure message
For further reading please see here.
Hope this helps!
If you are binding to a specific ip address (or all ips) rather than localhost then
$ JBOSS_HOME/bin/jboss-cli.sh
The you will see
[disconnected /]
Type connect
you are no ready to deploy or undeploy
I have run into these issues at times and I suspect this is happening in development ONLY as you would put unstable code at times. steps I follow to clear the "bad" deployment
1) clear standalone/tmp
2) clear standalone/data
3) open standalone.xml - go to the end and clear and then restart Jboss. All your old deployments will be cleared.
Also as CoolBeans suggests above you would try to use the Admin console or the CLI.
If you are using Maven why not use Cargo plugin for Jboss and that will do a seamless deployment without you to manually copy to deployments - ofcourse unless you want to deploy in exploded format.

Deploying a Java servlet based application from local server onto Virtual server

As the question explains I want to deploy a Java servlet based application which is developed on a local server (Apache Tomcat 6.0). I have the IP address, Host name for the new virtual server. I want to know, if it will be just a normal site migration process where I'll have to install Tomcat on the new server and configure the server, web XML files or is there a bit more.
As I have not done Tomcat config before. Any Help would be great
Is there a step-by-step documentation to perform this
Thanks
Download and install Java
Download Tomcat http://tomcat.apache.org/download-70.cgi
Read http://tomcat.apache.org/tomcat-7.0-doc/setup.html
Build your webapp into a war file with your build scripts
Copy the war file into webapps directory under your tomcat installation directory. More details can be found http://tomcat.apache.org/tomcat-7.0-doc/deployer-howto.html
I find it best to create a script that deploys my webapp from running my build script. And scp and ssh task comes in handy for installing it quickly. There are probably other maven tasks that might work for you.

Categories