I have an application tomcat + apache + mod_jk + spring mvc deployed on remote server. After making request to the controller I am having jsp source code in the response. It is not related with spring config cause locally it is working. After debugging mod_jk I see that tomcat returns jsp source.
I think the problem is related with remote tomcat or apache (cause it was configured by our it department). Is it possible to dissalow jsp execution on tomcat or apache (maybe httpd conf)? Plese suggest how can resolve this problem.
Apache Web Server does not execute JSPs, so you're probably getting your JSP from there.
Normally, static files are deployed on Apache Web Server, and dynamic files (JSPs, Custom Tags, classes, etc.) are deployed on Apache Tomcat (where Apache Web server redirects the corresponding requests). Check if your app is deployed this way.
Try to send an HTTP request directly to the Apache Tomcat (without intervention of Apache Web Server, and see what happens)
The reason was that jsp compiler was disabled see org.apache.jasper.servlet.JspServlet, in the tomcat\conf\web.xml. It-team says that it is recommend option for production)
Related
I have configured and running a weblogic12C server (12.2.1.4.0) on my computer, and I am working with eclipe, where I have a spring boot application with java 1.8.
I need to configure ecplipse to deploy and debug on my local weblogic server.
The problem is that when trying to create the server in Eclipse and indicate what the server will be, its domain and the WAR to deploy, the wizzard says "The server does not support version 4.0 of the J2EE Web module specification."
The strange thing is that my client has a 12C weblogic server (12.2.1.3.0) and I can deploy there without problems via console (ip: 7001 / console).
Any ideas? Will it be a problem with the domain configuration?
Grateful for the answers !!
Some images speak more than a thousand words:
Configuration server weblogic wizzard
Selecting the domain
Indicating that it is a local domain
When trying to move the resource, the wizard tells me that it is not compatible
Checking the domain settings, I don't see anything wrong
According to this document
https://docs.oracle.com/en/middleware/fusion-middleware/weblogic-server/12.2.1.4/wbapp/basics.html#GUID-62B6050D-6DD3-4028-B863-4CD0B5692E7F
WebLogic Server fully supports HTTP servlets as defined in the Servlet 3.1 specification at http://jcp.org/en/jsr/detail?id=340. HTTP servlets form an integral part of the Java EE standard.
It looks like your Eclipse installation is trying to use Java EE version 4, which is not supported by Oracle Weblogic 12.2.1.*
Furthermore, I have found the below post, which I think could be useful to fix your issue.
Project facet Dynamic Web Module 4.0 is not supported by this server
That post explains the issue with Servlet-API version 4.0 and how to configure your IDE to use the version supported by Oracle Weblogic 12.2.1.*
I'm using JHipster to build a web application (awesome project, keep going guys :).
I'm using a server where apache is already installed deploying a php app (http://www.myurl.com)
I'm trying to deploy my JHipster app under another url (http://www.myurl.com/my_project)
I tried :
rewrite rule to redirect /my_project http://localhost:PORT/my_project using my own tomcat install
using runnable jhipster war
changing some cong in yml file to add context under server > context-path
Nothing is working fine :
access to first page webapp ok but 404 to any other pages
blank page, unable to load resources because context is missing I think
doesn't change anything
Any other idea? Something I forget? Something related to webpack ?
Thanks for any help :)
Use apache(httpd) proxying to redirect calls to your jHipster application to your tomcat
the configuration is meant to be put in apache configuration files you must have proxying mod enabled in apache but if my memories are good proxying user sessions from apache httpd to tomcat can be quite tricky. The following syntax is what you are looking for
ProxyPass "/images" "http://www.example.com/"
ProxyPassReverse "/images" "http://www.example.com/"
https://httpd.apache.org/docs/2.4/howto/reverse_proxy.html
i have a multiple domains on my centos vps (domains running on apache http server via virtual host configurations). and also same vps, i want to add my new domain but that domain will route my spring boot application (application is a jar file also inside embedded tomcat ). i couldn't find any configuration for embedded tomcat specific domains and ports.
standalone Tomcat i can make configuration via server.xml file like this image
also this short tutorial shows configuration for stadalone tomcat Tomcat Virtual Host Configuration
But how can i do that configuration for embedded Tomcat ? Any suggestion ?
With Spring Boot embedded Tomcat, you are hosting only one application per servlet container. So I don't believe that Tomcat's concept of Virtual Hosts make sense at all.
If you have to host your app on shared Tomcat instance, just build WAR without embedded container.
It depends. 2 ways to deploy your project.jar as you want to :
First way : You can use the "apache web server" and his own "mod_proxy" in order to serve as many Spring webapps you want to, each on a specific port configured with "php-fpm" and with a proxy defined to route requests from/to your namebased VirtualHost configuration.
Nowadays, with Spring Boot 2.5, all you have to do is to set the property server.port in your application.properties file, and use it accordingly with mod_proxy directives.
If you are using profile, you can either set one port to dev or prod or test or whatever properties file you need.
Another way to proceed : you can use the apache web server "mod_jk" bridge module to configure multiple load-balancers for your Virtualhosts too.
Choose your path, young Jedi ;)
This response is certainly not for the OP, 7 years later, but for other people whom are using any web search engine like Google. They will come here and see "something is impossible". It is not true.
I am using tomcat as webserver. Planning to use active mq for messaging purpose. Just started learning about jms and activeMQ.
Gone thru https://activemq.apache.org/getting-started.html. What i have got is active mq comes with its own web
server(probably apache IS not sure). My question is what if I want to use existing tomcat server instead of installing
new server for active mq. Is it possible?
UPDATE: i think i can itegrate existing tomcat with https://activemq.apache.org/tomcat.html
Yes Apache ActiveMQ is a light-weight broker, so you can deploy it in Apache Tomcat as a WAR file. Or try Apache TomEE which comes out of the box with AcitveMQ.
http://tomee.apache.org/apache-tomee.html
If you deploy ActiveMQ as a WAR file then it does not come with its own web service, its only the standalone distribution of ActiveMQ that comes with Jetty as its web server. You just don't need to include Jetty in your WAR file with ActiveMQ embedded.
At Apache Camel we have an example of a WAR file with ActiveMQ and Camel as a WAR file you can deploy in Tomcat. You can take a look, and just remove Camel from the example:
http://camel.apache.org/activemq-camel-tomcat.html
See these:
http://blog.octera.info/2011/06/how-to-embed-activemq-in-tomcat/
http://activemq.apache.org/how-do-i-embed-a-broker-inside-a-connection.html
Basically, you just start a broker in your web application. If you need to retrieve some resource like ConnectionFactory or Destination(Queue/Topic), you can use Tomcat JNDI support to do this.
Hi,
I'm currently configuring a personal server for my very first time. I've Apache 2 and JBoss currently working, and they are both connected using mod_proxy.
Assuming my server IP is myserverip, I'm currently able to access any JSP file deployed in JBoss without typing the :8080. (http://myserverip:8080/myjsp --> http://myserverip/myjsp)
But now I want to configure my apache server to use a JSP page as it's default page, instead of index.html. For example, I want to access http://myserverip/myjsp as http://myserverip .
Assuming that myjsp is a .war that I have deployed in JBoss.
Thanks
Open your Apache configuration file httpd.conf
Find out line that read as follows: DirectoryIndex
Now set it as per your requirements: DirectoryIndex /myjsp/
Save and close the file.
Restart the Apache web server.