mod_webapp redirects to ServerName
Hello Tomcatters, I am using mod_webapp to connect Tomcat and Apache. I'm having a problem: Let's say I make a request to my server for any of the following: http://www.mydomain.com/examples/jsp/ http://192.168.0.100/examples/jsp/ http://127.0.0.1/examples/jsp/ http://localhost/examples/jsp/ Unfortunately, any of these will redirect me to: http://[ServerName]/examples/jsp/index.html where ServerName is as configured in httpd.conf. No matter how I set ServerName, it is a problem for either my own machines inside my router( no internal DNS ), or machines outside. Is there any kind of configuration, through VirtualHosts or otherwise that will cause http://[whatever]/examples/jsp to redirect to: http://[whatever]/examples/jsp/index.html After all, the [whatever] HAS to be valid if the server gets the request, right? Apache does this correctly, it's just in combination with mod_webapp and tomcat that the problem arises. Thanks, -chris __ Do You Yahoo!? Yahoo! Sports - live college hoops coverage http://sports.yahoo.com/ -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: mod_webapp: redirects to ServerName
If I point my browser to http://www.mydomain.com http://www.mydomain.com , Apache redirects me to http://123.45.67.89/index.jsp http://123.45.67.89/index.jsp , where 123.45.67.89 is the IP address of the server running the application, and is set as the ServerName in httpd.conf. And what is strange here? Apache recognized www.mydomain.com as an alias fo a sort and issued a redirect to what he considered to be the real URL. What is strange here is that this did not happen before I upgraded to mod_webapp. Also, when you have many domain names pointing to the same IP address, you do not want all of them to be redirected. For example, if a user inputs http://www.mydomain2.com in his browser address window, we dont want the address to be changed to 123.45.67.89. If I change the ServerName in httpd.conf to www.mydomain.com http://www.mydomain.com , then the opposite happens (that is, if I point the browser to 123.45.67.89 I get redirected to www.mydomain.com/index.jsp http://www.mydomain.com/index.jsp ). Yup. Here I am showing that this problem is directly connected to the value of the ServerName. It seems that mod_webapp redirects all requests to the ServerName. Now the strange thing is, that if I type the full path (with the /index.jsp at the end), then no redirection occurs. Of course not. If you type http://www.mydomain.com/ you shouldn't see redirection. You're getting redirected because of that last slash in the URL and it is normal for Apache and web servers in general. That's where you are wrong my friend...again. A slash at the end IS NOT SUFFICIENT. I have to type THE FULL PATH to not be redirected. This is a problem for me because I have multiple domain names pointing to the IP address, and the user is always redirected to the IP address, which is unacceptable. And have you defined multiple VirtualHost-s? Of course you haven't. Read Apache docs on Virtual Hosts. Nix. Once again, you are wrong. I have tried defining VirtualHosts, and that worked partly, but that is not an acceptable solution for me. Let me explain why. My webapp displays different content depending on the hostname, and one of the requirements for the webapp is that when more domain names are added (all pointing to the same IP address), no configuration or restart should have to be done in Apache or Tomcat. You should just have to tell the webapp to recognize it. OGG -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: mod_webapp: redirects to ServerName
- Original Message - From: "Oli Gauti Gudmundsson" [EMAIL PROTECTED] To: "'Tomcat Users List'" [EMAIL PROTECTED] Sent: Friday, January 18, 2002 11:15 AM Subject: RE: mod_webapp: redirects to ServerName If I point my browser to http://www.mydomain.com http://www.mydomain.com , Apache redirects me to http://123.45.67.89/index.jsp http://123.45.67.89/index.jsp , where 123.45.67.89 is the IP address of the server running the application, and is set as the ServerName in httpd.conf. And what is strange here? Apache recognized www.mydomain.com as an alias fo a sort and issued a redirect to what he considered to be the real URL. What is strange here is that this did not happen before I upgraded to mod_webapp. Also, when you have many domain names pointing to the same IP address, you do not want all of them to be redirected. For example, if a user inputs http://www.mydomain2.com in his browser address window, we dont want the address to be changed to 123.45.67.89. :-) I can understand that. I'm hosting three virtual hosts on my Apache and it works like a charm. Of course, I am using VirtualHost-s in Apache. Yup. Here I am showing that this problem is directly connected to the value of the ServerName. It seems that mod_webapp redirects all requests to the ServerName. Yes, like I said previously, I would expect Apache to do that, considering you're not using virtual hosting like it was intended. Now the strange thing is, that if I type the full path (with the "/index.jsp" at the end), then no redirection occurs. Of course not. If you type http://www.mydomain.com/ you shouldn't see redirection. You're getting redirected because of that last slash in the URL and it is normal for Apache and web servers in general. That's where you are wrong my friend...again. A slash at the end IS NOT SUFFICIENT. I have to type THE FULL PATH to not be redirected. Well, you could be right (of course, you are right, since you're seeing it :-)). Basically http://www.mydomain.com will always issue a redirect to http://www.mydomain.com/ and that will go for either WelcomePage or DirectoryListing. Which includes several Apache modules and opens up an oportunity for Apache to play smart. With a full URL, Apache has to be quiet, I guess. And have you defined multiple VirtualHost-s? Of course you haven't. Read Apache docs on Virtual Hosts. Once again, you are wrong. I have tried defining VirtualHosts, and that worked partly, but that is not an acceptable solution for me. Let me explain why. My webapp displays different content depending on the hostname, and one of the requirements for the webapp is that when more domain names are added (all pointing to the same IP address), no configuration or restart should have to be done in Apache or Tomcat. You should just have to tell the webapp to recognize it. Well I appologize for my cinical remark up there, but it seamed to me like you were trying to do something obviously wrong. The idea you have is a bit problematic. What you will have is something that looks like a virtual host to the client, but is not at the server. That kind of situation *always* produces cranial pain. I still believe it is Apache what is bugging you and that is where you have to make a change. From Apache's point of view, clients are sending requests to it that it should handle (it can see in DNS that those are request to it), but htey are not for that exact host, so Apache issues a redirect. You could try to define a "default virtual host" and map to your web application from there, via Warp. Something like: NameVirtualHost 123.45.67.89 VirtualHost *:80 ServerName 123.45.67.89 DocumentRoot ... ... WebAppDeploy my_app / connection ... /VirtualHost Nix.
mod_webapp: redirects to ServerName
Hi guys. I've installed Tomcat4 with Apache through mod_webapp, and it works. However, I have the following problem: If I point my browser to http://www.mydomain.com http://www.mydomain.com , Apache redirects me to http://123.45.67.89/index.jsp http://123.45.67.89/index.jsp , where 123.45.67.89 is the IP address of the server running the application, and is set as the ServerName in httpd.conf. If I change the ServerName in httpd.conf to www.mydomain.com http://www.mydomain.com , then the opposite happens (that is, if I point the browser to 123.45.67.89 I get redirected to www.mydomain.com/index.jsp http://www.mydomain.com/index.jsp ). Now the strange thing is, that if I type the full path (with the /index.jsp at the end), then no redirection occurs. This is a problem for me because I have multiple domain names pointing to the IP address, and the user is always redirected to the IP address, which is unacceptable. Has anyone experienced this problem, or even better, solved it? Thx for your help. -OGG
Re: mod_webapp: redirects to ServerName
Oli, My problem (encodeURL bug) is related. If *all* you care about is getting the hostname corrected and if you're not worried about changing ports, then I believe switching from mod_webapp to mod_jk will solve your problem. It is fairly easy to get mod_jk working under tomcat 3.x -- and then you can copy/edit the configuration files over to your tomcat 4.x configuration and add the connector into servlet.xml -Nick Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm List-Unsubscribe: mailto:[EMAIL PROTECTED] List-Subscribe: mailto:[EMAIL PROTECTED] List-Help: mailto:[EMAIL PROTECTED] List-Post: mailto:[EMAIL PROTECTED] List-Id: Tomcat Users List tomcat-user.jakarta.apache.org Delivered-To: mailing list [EMAIL PROTECTED] From: Oli Gauti Gudmundsson [EMAIL PROTECTED] To: '[EMAIL PROTECTED]' [EMAIL PROTECTED] Subject: mod_webapp: redirects to ServerName Date: Thu, 17 Jan 2002 13:45:23 - MIME-Version: 1.0 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi guys. I've installed Tomcat4 with Apache through mod_webapp, and it works. However, I have the following problem: If I point my browser to http://www.mydomain.com http://www.mydomain.com , Apache redirects me to http://123.45.67.89/index.jsp http://123.45.67.89/index.jsp , where 123.45.67.89 is the IP address of the server running the application, and is set as the ServerName in httpd.conf. If I change the ServerName in httpd.conf to www.mydomain.com http://www.mydomain.com , then the opposite happens (that is, if I point the browser to 123.45.67.89 I get redirected to www.mydomain.com/index.jsp http://www.mydomain.com/index.jsp ). Now the strange thing is, that if I type the full path (with the /index.jsp at the end), then no redirection occurs. This is a problem for me because I have multiple domain names pointing to the IP address, and the user is always redirected to the IP address, which is unacceptable. Has anyone experienced this problem, or even better, solved it? Thx for your help. -OGG -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: mod_webapp: redirects to ServerName
I have a problem this webapp module when I use Apache and Tomcat : Tomcat can't serve images properly ... (according the mailing list, this bug is well known...) so can I use the mod_jk with Tomcat 4.0.1 and apache 1.3.22 under win98 os ? is this solve the problem ? how to do ? thanks for future answers and help ! regards, Anthony MÜLLER, Développeur Internet HyperOffice 6, rue Jacques Daguerre 92565 Rueil-Malmaison Cedex Tel : +33 (0)1 41 96 96 85 [EMAIL PROTECTED] -Message d'origine- De : Nicholas Ide [mailto:[EMAIL PROTECTED]] Envoyé : Thursday, January 17, 2002 3:33 PM À : [EMAIL PROTECTED] Objet : Re: mod_webapp: redirects to ServerName Oli, My problem (encodeURL bug) is related. If *all* you care about is getting the hostname corrected and if you're not worried about changing ports, then I believe switching from mod_webapp to mod_jk will solve your problem. It is fairly easy to get mod_jk working under tomcat 3.x -- and then you can copy/edit the configuration files over to your tomcat 4.x configuration and add the connector into servlet.xml -Nick Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm List-Unsubscribe: mailto:[EMAIL PROTECTED] List-Subscribe: mailto:[EMAIL PROTECTED] List-Help: mailto:[EMAIL PROTECTED] List-Post: mailto:[EMAIL PROTECTED] List-Id: Tomcat Users List tomcat-user.jakarta.apache.org Delivered-To: mailing list [EMAIL PROTECTED] From: Oli Gauti Gudmundsson [EMAIL PROTECTED] To: '[EMAIL PROTECTED]' [EMAIL PROTECTED] Subject: mod_webapp: redirects to ServerName Date: Thu, 17 Jan 2002 13:45:23 - MIME-Version: 1.0 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi guys. I've installed Tomcat4 with Apache through mod_webapp, and it works. However, I have the following problem: If I point my browser to http://www.mydomain.com http://www.mydomain.com , Apache redirects me to http://123.45.67.89/index.jsp http://123.45.67.89/index.jsp , where 123.45.67.89 is the IP address of the server running the application, and is set as the ServerName in httpd.conf. If I change the ServerName in httpd.conf to www.mydomain.com http://www.mydomain.com , then the opposite happens (that is, if I point the browser to 123.45.67.89 I get redirected to www.mydomain.com/index.jsp http://www.mydomain.com/index.jsp ). Now the strange thing is, that if I type the full path (with the /index.jsp at the end), then no redirection occurs. This is a problem for me because I have multiple domain names pointing to the IP address, and the user is always redirected to the IP address, which is unacceptable. Has anyone experienced this problem, or even better, solved it? Thx for your help. -OGG -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: mod_webapp: redirects to ServerName, mod_jk hangs
Thanks for your response Nick. I tried using mod_jk, but wasn't able to get it working. I built mod_jk.so without errors, and put it into the $APACHE_HOME/libexec folder. I created mod_jk.conf, and workers.properties. Then I included mod_jk.conf in httpd.conf, and Apache started up without errors: [Thu Jan 17 14:52:22 2002] [notice] Apache/1.3.9 (Unix) mod_jk/1.1.0 configured -- resuming normal operations I added a AJP13 connector in $TOMCAT_HOME/conf/server.xml, and Tomcat also started up without errors. But when I made a request through the browser, it just timed out. When I checked the logs, there was a small stacktrace in catalina.log: java.lang.NoSuchMethodError: java.net.Socket: method setKeepAlive(Z)V not found at org.apache.ajp.tomcat4.Ajp13Connector.run(Compiled Code) at java.lang.Thread.run(Thread.java:479) And the mod_jk.log says: [Thu Jan 17 15:08:55 2002] [jk_ajp13.c (403)]: Into ajp13_marshal_into_msgb [Thu Jan 17 15:08:55 2002] [jk_ajp13.c (537)]: ajp13_marshal_into_msgb - Done [Thu Jan 17 15:08:55 2002] [jk_connect.c (108)]: Into jk_open_socket [Thu Jan 17 15:08:55 2002] [jk_connect.c (115)]: jk_open_socket, try to connect socket = 9 [Thu Jan 17 15:08:55 2002] [jk_connect.c (124)]: jk_open_socket, after connect ret = 0 [Thu Jan 17 15:08:55 2002] [jk_connect.c (132)]: jk_open_socket, set TCP_NODELAY to on [Thu Jan 17 15:08:55 2002] [jk_connect.c (140)]: jk_open_socket, return, sd = 9 [Thu Jan 17 15:08:55 2002] [jk_ajp13_worker.c (189)]: In jk_endpoint_t::connect_to_tomcat, connected sd = 9 [Thu Jan 17 15:08:55 2002] [jk_ajp13_worker.c (206)]: sending to ajp13 #337 [Thu Jan 17 15:08:55 2002] [jk_ajp13_worker.c (645)]: send_request 2: request body to send 0 - request body to resend 0 And there it just hangs Has anyone experienced this problem?? Can anyone tell me exactly how to configure server.xml for use with mod_jk ?? My system information is following: Tomcat 4.01 Apache 1.3.9 JDK 1.2 OS: Solaris 7 Thx for your help. -OGG -Original Message- From: Nicholas Ide [mailto:[EMAIL PROTECTED]] Sent: 17. janúar 2002 14:33 To: [EMAIL PROTECTED] Subject: Re: mod_webapp: redirects to ServerName Oli, My problem (encodeURL bug) is related. If *all* you care about is getting the hostname corrected and if you're not worried about changing ports, then I believe switching from mod_webapp to mod_jk will solve your problem. It is fairly easy to get mod_jk working under tomcat 3.x -- and then you can copy/edit the configuration files over to your tomcat 4.x configuration and add the connector into servlet.xml -Nick Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm List-Unsubscribe: mailto:[EMAIL PROTECTED] List-Subscribe: mailto:[EMAIL PROTECTED] List-Help: mailto:[EMAIL PROTECTED] List-Post: mailto:[EMAIL PROTECTED] List-Id: Tomcat Users List tomcat-user.jakarta.apache.org Delivered-To: mailing list [EMAIL PROTECTED] From: Oli Gauti Gudmundsson [EMAIL PROTECTED] To: '[EMAIL PROTECTED]' [EMAIL PROTECTED] Subject: mod_webapp: redirects to ServerName Date: Thu, 17 Jan 2002 13:45:23 - MIME-Version: 1.0 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi guys. I've installed Tomcat4 with Apache through mod_webapp, and it works. However, I have the following problem: If I point my browser to http://www.mydomain.com http://www.mydomain.com , Apache redirects me to http://123.45.67.89/index.jsp http://123.45.67.89/index.jsp , where 123.45.67.89 is the IP address of the server running the application, and is set as the ServerName in httpd.conf. If I change the ServerName in httpd.conf to www.mydomain.com http://www.mydomain.com , then the opposite happens (that is, if I point the browser to 123.45.67.89 I get redirected to www.mydomain.com/index.jsp http://www.mydomain.com/index.jsp ). Now the strange thing is, that if I type the full path (with the /index.jsp at the end), then no redirection occurs. This is a problem for me because I have multiple domain names pointing to the IP address, and the user is always redirected to the IP address, which is unacceptable. Has anyone experienced this problem, or even better, solved it? Thx for your help. -OGG -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: mod_webapp: redirects to ServerName, mod_jk hangs
Oli, Snippets of my mod_jk configuration are: From server.xml: Connector className=org.apache.ajp.tomcat4.Ajp13Connector port=13084 minProcessors=5 maxProcessors=75 acceptCount=10 debug=0/ Be sure the port=TBD value above matches the vlaue in your workers.properties file. From httpd.conf/mod_jk.conf: JkMount /your_webapp_name/servlet/* ajp13 If you crank up the debug levels in server.xml, you should be able to see AJP traffic recorded in the catalina output files. -Nick -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: mod_webapp: redirects to ServerName
If I point my browser to http://www.mydomain.com http://www.mydomain.com , Apache redirects me to http://123.45.67.89/index.jsp http://123.45.67.89/index.jsp , where 123.45.67.89 is the IP address of the server running the application, and is set as the ServerName in httpd.conf. And what is strange here? Apache recognized www.mydomain.com as an alias fo a sort and issued a redirect to what he considered to be the real URL. If I change the ServerName in httpd.conf to www.mydomain.com http://www.mydomain.com , then the opposite happens (that is, if I point the browser to 123.45.67.89 I get redirected to www.mydomain.com/index.jsp http://www.mydomain.com/index.jsp ). Yup. Now the strange thing is, that if I type the full path (with the "/index.jsp" at the end), then no redirection occurs. Of course not. If you type http://www.mydomain.com/ you shouldn't see redirection. You're getting redirected because of that last slash in the URL and it is normal for Apache and web servers in general. This is a problem for me because I have multiple domain names pointing to the IP address, and the user is always redirected to the IP address, which is unacceptable. And have you defined multiple VirtualHost-s? Of course you haven't. Read Apache docs on Virtual Hosts. Nix.