Deploying azure tomcat 9.0.62 app service maps all webcontent subfolders paths to root - maven

When creating a tomcat app service I create subfolders in webcontent and their path is created accordingly. Example tree:
Webcontent:
index.jsp
folder1:
page.jsp
To access page.jsp url I type: website.com/folder1/page.jsp
This all works as expected in localhost on any tomcat version, however when I deploy it to azure app service Tomcat v9.0.62 page.jsp is mapped to root: website.com/page.jsp
If I downgrade to tomcat v9.0.54 it works as expected.
I'd really appreciate any help in figuring out how to fix this behavior when deployed

Related

Deploy hippo cms in heroku

In Hippo, There are two web applications packaged as war files inside a directory called webapps, a number of libraries in a directory called shared/lib, another set in a directory called common/lib, and some configuration files such as a log4j descriptor and a Tomcat context descriptor in the conf directory.
But in Heroku, I can not find the directory of tomcat to deploy these directory like the structure of Hippo (shared/lib, common/lib, conf)
Thank you
Hippo requires access to the entire Tomcat instance for setup at least. I've read through the Heroku documentation (most of it just skimmed), but I can't see that they provide that access.
However, there is possibly a second option which you may be willing to try; build Hippo in a docker image, and deploy that into Heroku:
Creating a docker container for hippo
Deploying docker container to Heroku
I haven't tried or tested any of this, so I can't guarantee it's success. But if you're limited to using Heroku, then it's at least worth a try.
Also, if you manage to get it running using docker, I would be extremely interested to know more details.

AWS Elastic Beanstalk - Configuring my nginx settings to increase timeout for Java Spring maven app

So I am using AWS Elastic Beanstalk to host my Java Spring app, and there are certain requests which take more than 60 seconds to complete. I wanted to raise the timeout cap so these could complete, so I began to follow this tutorial.
I succeeded in changing the Load Balancer timeout in the ELB console, but I am having trouble changing settings for the nginx proxy. The tutorial suggests to create a file called .ebextensions/nginx-timeout.config where .ebextensions is in the "root of my project." The tutorial is assuming that we are using Beanstalk with Docker, which I am not, so I found this link which suggests to fill the contents of nginx-timeout.config with these contents:
files:
"/tmp/proxy.conf":
mode: "000644"
owner: root
group: root
content: |
proxy_send_timeout 1200;
proxy_read_timeout 1200;
send_timeout 1200;
container_commands:
00-add-config:
command: cat /tmp/proxy.conf >> /var/elasticbeanstalk/staging/nginx/conf.d/elasticbeanstalk/00_application.conf
01-restart-nginx:
command: service nginx restart
One of my problems is that I do not know exactly where the root of my application is. I am using Maven with Java Spring Boot, so my structure is as follows:
I am not sure whether I should place .ebextensions in the base directory where my pom.xml file is, or somewhere else. Also the method in which I am deploying this application is using maven to build a jar, and then uploading the jar, I'm not sure if this changes anything.
Any advice on this problem? I'm currently also trying to see how I might ssh into my instance to possibly change the configuration of the nginx server there, but I am not sure if that will be possible.
Possible duplicate of Where to add .ebextensions in a WAR?, though since you are not using war packaging you can use Procfile-based configuration and archive your jar and .ebextensions into additional zip layer. Then your zip file structure should be looking like this:
your_app.zip
|
|_.ebextensions
| |_ nginx-timeout.config
|
|_ your_app.jar
|_ Procfile
And your Procfile should contain your jar file launching instructions
$ cat Procfile
web: java -jar your_app.jar

can't access to html file tomcat

I have an html file in my app root folder, which is located under webapp tomcat folder: apache-tomcat-9.0.0.M3\webapps\shop\index.html
when I'm trying to open http://localhost:8080/shop/
"The requested resource is not available"
occurs. I'm using spring mvc, so I'm getting the following message in terminal: No mapping for http request with URl shop/ in DispatcherServlet. Nevertheless it works fine if rename it to index.jsp

tomcat published two projects under path "webapps/"

I modified the file conf/server.xml like this below
<Context path="AA" docBase="BB" reloadable="true" />
when I start tomcat from a shell file publish.sh:
#!/bin/bash
#defined
TOMCAT_HOME="/root/software/apache-tomcat-7.0.29"
#start tomcat
cd "$TOMCAT_HOME"/bin
sh startup.sh
echo "tomcat is starting,please try to access $PROJECT console url"
tomcat publish two projects under path "webapps/",AA and BB。And I tracked that BB was published after AA.
If you logged on the terminal , and start tomcat directly in the directory "$TOMCAT_HOME"/bin with command:
>./startup.sh
Only one project "BB" under path "webapps/"。
Who can tell me Why? Thanks!
You have double-deployed your web application.
How? Well, you put BB.war into webapps/ (which will be auto-deployed to /BB) and then you put <Context path="AA" docbase="BB"> into server.xml which deployed BB.war to /AA. What did you expect?
If you just want your application to be deployed to /AA, then just re-name the WAR file to AA.war and be done with it: take-out the <Context> in server.xml because it's just making your job harder. This is why it's explicitly recommended not to do that.

Default Web Application URL

Currently, the default url for my sample application is:
http://127.0.0.1:8080/SpringMVC/
Is it possible for my to access it through below url ?
http://127.0.0.1:8080/
How can this be done ?
rename the war file to ROOT.war . Then delete (or rename) the default ROOT tomcat directory and start tomcat.

Resources