mg>hopefully brief comments Martin Gainty ______________________________________________ Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> Subject: Re: integrating Apache 2 server and Tomcat > From: bmill...@gmail.com > To: users@tomcat.apache.org > Date: Fri, 26 Jun 2009 11:32:45 -0500 > > On Fri, 2009-06-26 at 08:59 -0500, Dimitrios Christodoulakis wrote: > > Hello, > > > > I have been struggling for the past couple of weeks to redirect > > external traffic from the Apache 2 server to Tomcat 5.5 on a godaddy > > dedicated server. > > > > We have created a new domain on the server, which default public path > > is /home/myadmin/public_html/ when someone points there browser to > > www.mydomain.com > > > > At the same time I have uploaded and deployed the application under > > usr/java/tomcat-5.5/webapps/mydomain/ > > > > As I understand at this time web content is served by the apache > > server and not Tomcat. What I have been trying to do is to have all > > pages static and dynamic be served by Tomcat. > > > > Godaddy offers limited support unless we buy into their assisted > > service plan. I followed some steps they initially suggested which > > involved creating a symbolic link between the default public directory > > /home/myadmin/public_html/ and the application directory > > usr/java/tomcat-5.5/webapps/mydomain/ by using the command: > > > > ln -s /usr/java/tomcat-5.5/webapps/mydomain/index.html > > /home/myadmin/public_html > > > > With this I hoped all requests from www.mydomain.com going to > > /home/myadmin/public_html would be automatically redirected to the > > actual tomcat content starting with the deployed application's > > index.html page. But unfortunately this does not work. I am always > > returned the 404 error message. > > > > Is there a known or recommended way to resolve this issue? After some > > searching I believe there are workarounds involving editing the > > /usr/java/tomcat-5.5/conf/server.xml and the etc/httpd/conf/http.conf > > files. Would it be possible someone to provide some general steps how > > to do this? > > > > Many thanks for any practical help. > > > > > Well this is how I do it, your mileage will vary. > > I use mod_proxy_http with tomcat configured for just a http connector. > T > I setup a mod_proxy.conf file for the apache and I'll just show how I do > it for the tomcat examples. Apache serves the statis html & images, the > jsp/servlets are fed by tomcat. > > __BEGIN__ > <IfModule mod_proxy.c> > ####################################################################### > # MOD_PROXY CONFIGURATIONS # > ####################################################################### > LoadModule proxy_http_module modules/mod_proxy_http.so > > ProxyRequests Off > > # Make sure that the virtual host name is passed through to the > # backend servlet container for virtual host support. > ProxyPreserveHost On > > # Tell mod_mod proxy that it should not send back the body-content of > # error pages, but be fascist mg>what does this mean???????? > and use its local error pages if the > # remote HTTP stack is sending an HTTP 4xx or 5xx status code. > ProxyErrorOverride On > ProxyPassReverse / http://localhost:8080/ > > <Proxy *> > Order deny,allow > Allow from all > </Proxy> > > RewriteLog logs/rewrite_log > RewriteLogLevel 1 > > Alias /examples "/opt/webBaseDir/webapps/examples" > > <LocationMatch "/examples"> > <LimitExcept POST GET PUT> > Order Deny,Allow > Deny from all > Allow from none > </LimitExcept> > # The nastiness begins, let's fire up the "rewrite engine" > RewriteEngine On > # Everything ending in ".gif", ".jpg" or ".jpeg" will be served again > # directly by Apache, no need to bother the servlet container. As above > # this is the last rule as specified by the [L] flag at the end mg>for performance be judicious in all encompassing regular-expressions ..attempt to make rule as specific as possible mg>http://www.webmasterworld.com/forum92/2550.htm > RewriteRule \.(pl|php|cgi)$ - [PT,L] > RewriteRule \.(jpg|jpeg|gif|png|html)$ - [PT,L] > > # Everything that starts with a NON-CASE-SENSITIVE match (the NC flag) > # of "/WEB-INF" or "/WEB-INF/" is forbidden (the F flag). And again, > # this is the last rule (the L flag), nothing will be processed by the > # rewrite engine if this rule is matched > RewriteRule "^.*/WEB-INF/?(.*)" - [L,F,NC] mg>also you should leave cgi-bin alone mg>RewriteRule "^/cgi-bin/.*" "$0" [QSA,PT,L] mg>http://jonathan.tron.name/2006/07/26/apache-2-0-x-mongrel-mod_proxy-mod_rewrite-configuration > > # Any jsp, jspx, do, servlet get proxied MG>*should* be able to use assigned SERVER_NAME here > RewriteRule \.(jsp|jspx|do) "http://localhost:8080%{REQUEST_URI}" [P,L] > RewriteRule "^/(.*)/servlet/(.*)" "http://localhost:8080%{REQUEST_URI}" > [P,L] > </LocationMatch> > > </IfModule> > > __END__ > > > -- > Brian Millett - [ Sinclair, Zathras, and Garibaldi, "Babylon Squared"] > S: "Why do you need Babylon 5?" > Z: "Zathras tell, you let Zathras go? Finish what Zathras came for?" > G: "Zathras tells maybe we don't break Zathras scrawny little neck." MG>?????????? _________________________________________________________________ Lauren found her dream laptop. Find the PC that’s right for you. http://www.microsoft.com/windows/choosepc/?ocid=ftp_val_wl_290