How to URL Rewrite on tomcat running behind Apache - apache

I searched google many time, but unable to find a good answer.
I have tomcat running behind Apache linked via mod_jk on my CentOs VPS.
I want to rewrite urls.
I already tried UrlRewriteFilter.
It is working fine in my offline tomcat in Win7 PC
But not working on online VPS.
Is there any way to rewrite urls in tomcat running behind Apache (Mod_JK)
I have some jsp files in my APP and some of them are dynamic.

Related

Why my webpage title shows "Apache" when webserver was changed to nginx in AWS Elastic BeanStalk

I have two issues:
When I first started Elastic BeanStalk it had Apache webserver for Java8 Tomcat8 combination.
I was able to access my webapp using the link shown
a) https://i.stack.imgur.com/PmEka.png
After working on Apache, I went to configurations and changed the server to
nginx as I would like to try nginx.
I re-deployed and restarted app server after changing my webserver to nginx in my configuration, and
Issue 1: not able to access homepage by clicking link (as shown in a) )
Issue 2: The webpage title still shows as "Apache..." Why is that?
https://i.stack.imgur.com/l17WJ.png
But when I checked chrome console, I see nginx there.
Tomcat is an Apache Software Foundation project. Your screenshot is of an "Apache Tomcat" error page. It is not telling you that the Elastic Beanstalk reverse-proxy is Apache Web Server, it is simply telling you that the application server is Apache Tomcat.

Why my Redmine site is shown without any Virtual Host settinig?

I've installed Redmine 3.2.4.stable.16111 on to my VPS. I haven't written any Virtual Host settings for Redmine. Only added server name "redmine" as CNAME to my DNS records.
Why Redmine works without Virtual Host settings?
I installed Redmine according to Redmine's official Japanese page, so I guess it was installed at /var/lib/redmine/. But under that directory, no "public" folder. So I also wonder why Redmine works fine.
Any help will be appreciated.
Thank you.
Well Redmine is written in Ruby language. A Redmine website can be served by different web servers, such as Apache, Nginx. Web brick is a simple http server written in Ruby language that can be used to quickly get started with Redmine. By default it runs over port 3000. It does not require any virtual hosts.
Redmine can also be run with a combination of web servers. For example Apache web server can work as reverse proxy for the Web brick server.

Setting up tomcat6 using mod_jk for Apache, page not found using https

I have been trying to setup an Apache web server along with a Tomcat6 web server, using SSL/HTTPS. On my Apache web server the SSL is working correctly, and I can access the web pages it serves up using SSL/HTTPS, but I am having a problem accessing the web apps on the Tomcat server using SSL/HTTPS. The new setup is on a Centos 6 machine, and I have a similar setup on a Fedora 13 machine.
I have compared all the files that I can think of between the two machines, but can not get to the web apps using HTTPS. When I try I get a "Not Found" error. I can access the web apps if I use just HTTP.
Can anyone point me to where my problem might be?
Thank you

How to configure apache to proxy requests

I want to add a javascript based chat system to my web app. I have read in many places that apache needs to forward(proxy) the requests to the xmpp chat server.
From what I have understood , I either need to add proxying support to apache server
OR use the jabberHTTPbind servelet.
I am trying the first thing. Add proxy support to apache. Now within Eclipse I am using Tomcat 7.0. I think this Tomcat comes with its own web server and is not using Apache. Is that true ?I am using Tomcat from http://tomcat.apache.org/download-70.cgi and added server in Eclipse by providing its extracted path.
I am not able to find any apache related folder structure eg(/etc/apache2/apache2.conf) within my Tomcat extracted directory.Also can't find httpd.conf anywhere .
Should I need to download apache separately and connect my tomcat to it.
I think adding proxy support to apache is required because javascript code won't be able to connect to any URL other than the current domain. so the question again is the same , where are all these apache2.conf and httpd.conf to add mod_proxy. and where can I do the virtual host mapping.
Any help to move ahead with be very much appreciated.
You need to install the Apache HTTPD server and enable reverse proxying. Read the doc on mod_proxy on how to do this. There are tons of resources on Stackoverflow as well; search for Apache reverse Proxy. The conf files you mention are part of the Apache HTTPD install.
javascript code won't be able to connect to any URL other than the current domain
That is generally true unless you enable CORS

Can Struts 2 run on Apache2 server without Tomcat?

Please help! I got very frustrated with this assignment to demonstrate Apache and Java Struts. I cannot make struts apps run in the Apache web directory. They only work under Tomcat.
Can I use Struts only under Apache without Tomcat? ... Thanks very much!
Apache and Tomcat serve different purposes. You cannot use Apache to run Struts because it's just a web server, not a java web container.
What you could do is to setup Apache as a reverse proxy to a tomcat instance, so the "Internet" would talk to your Apache, but still Tomcat would be serving your requests in the end.