Welcome to MobyThreads.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

Tomcat apps and mod_rewrite

 
   Web Hosting and Web Master Forums (Home) -> Apache RSS
Next:  Tomcat apps and mod_rewrite  
Author Message
alannaespam

External


Since: Nov 09, 2004
Posts: 4



(Msg. 1) Posted: Tue Nov 09, 2004 8:00 pm
Post subject: Tomcat apps and mod_rewrite
Archived from groups: alt>apache>configuration (more info?)

I have a server with some tomcat apps.

The tomcat app is accessed via http://www.sitename.com/appgroup/app

I also want this to be the page you see when you visit
http://www.sitename.com

I currently have this working using a META REFRESH on the index.html,
but I would rather have this working using something serverside such as
mod_rewrite, essentially so that search engine spidering works correctly.

I have tried using mod_rewrite as follows

RewriteEngine on
RewriteRule /(.*) http://www.sitename.com/appgroup/app/
RewriteLog "/var/log/httpd/rewrite.log"
RewriteLogLevel 3

But the logs show that Apache is trying to be clever, and rather than
presenting http://www.sitename.com/appgroup/app to itself so that mod_jk
picks it up, apache tries to serve /home/user/documentroot/appgroup/app
which gives a file not found.

Could anyone shed any light on how to get this to work?

 >> Stay informed about: Tomcat apps and mod_rewrite 
Back to top
Login to vote
user3139

External


Since: Nov 10, 2004
Posts: 3



(Msg. 2) Posted: Wed Nov 10, 2004 8:29 am
Post subject: Re: Tomcat apps and mod_rewrite [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi

we have an similar enviroment with apache & tomcat

I use the ProxyPass - directive and <Virtualhost> to serve different
web-domains with one tomcat server.

<Virtualhost x.x.x.x>
ServerAdmin ruedi.schwitter.DeleteThis@feld1.ch
ServerName <a style='text-decoration: underline;' href="http://www.feld1.ch" target="_blank">www.feld1.ch</a>

ProxyPass /yourapp <a style='text-decoration: underline;' href="http://tomcathost:8080/yourapp" target="_blank">http://tomcathost:8080/yourapp</a>
ProxyPassReverse /yourapp/ <a style='text-decoration: underline;' href="http://tomcathost:8080/yourapp/" target="_blank">http://tomcathost:8080/yourapp/</a>
ProxyPass /
<a style='text-decoration: underline;' href="http://tomcathost:8080/yourapp/" target="_blank">http://tomcathost:8080/yourapp/</a>

ErrorLog /usr/local/apache/log/yourapp.log
.....

</Virtualhost>

<Virtualhost x.x.x.x>
ServerAdmin ruedi.schwitter.DeleteThis@feld1.ch
ServerName <a style='text-decoration: underline;' href="http://www.feld2.ch" target="_blank">www.feld2.ch</a>

ProxyPass /yourapp2 <a style='text-decoration: underline;' href="http://tomcathost:8080/yourapp2" target="_blank">http://tomcathost:8080/yourapp2</a>
ProxyPassReverse /yourapp2/ <a style='text-decoration: underline;' href="http://tomcathost:8080/yourapp2/" target="_blank">http://tomcathost:8080/yourapp2/</a>
ProxyPass /
<a style='text-decoration: underline;' href="http://tomcathost:8080/yourapp2/" target="_blank">http://tomcathost:8080/yourapp2/</a>

ErrorLog /usr/local/apache/log/yourapp2.log
.....

</Virtualhost>


Hope this help.

Regards Ruedi Smile


Alan Cooper schrieb:

 > I have a server with some tomcat apps.
 >
<font color=purple> > The tomcat app is accessed via <a style='text-decoration: underline;' href="http://www.sitename.com/appgroup/app</font" target="_blank">http://www.sitename.com/appgroup/app</font</a>>
 >
 > I also want this to be the page you see when you visit
<font color=purple> > <a style='text-decoration: underline;' href="http://www.sitename.com</font" target="_blank">http://www.sitename.com</font</a>>
 >
 > I currently have this working using a META REFRESH on the index.html,
 > but I would rather have this working using something serverside such as
 > mod_rewrite, essentially so that search engine spidering works correctly.
 >
 > I have tried using mod_rewrite as follows
 >
 > RewriteEngine on
<font color=purple> > RewriteRule /(.*) <a style='text-decoration: underline;' href="http://www.sitename.com/appgroup/app/</font" target="_blank">http://www.sitename.com/appgroup/app/</font</a>>
 > RewriteLog "/var/log/httpd/rewrite.log"
 > RewriteLogLevel 3
 >
 > But the logs show that Apache is trying to be clever, and rather than
 > presenting <a style='text-decoration: underline;' href="http://www.sitename.com/appgroup/app" target="_blank">http://www.sitename.com/appgroup/app</a> to itself so that mod_jk
 > picks it up, apache tries to serve /home/user/documentroot/appgroup/app
 > which gives a file not found.
 >
 > Could anyone shed any light on how to get this to work?<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: Tomcat apps and mod_rewrite 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
problems with php and mod_rewrite - When Apache starts I get the message "PHP startup: unable to load the dynamic library: 'c:\program files\php \ext\php_exif.dll' - The specified module could not be found." Also I want to enable mod_rewrite, as per cakephp manual, with the line...

mod_rewrite by file extension - Consider a simple config, e.g. <FilesMatch "\.(htm|html|php)$"> RewriteRule . http://www.yahoo.com [R,L] </FilesMatch> Seem not working... Any idea?

Using mod_rewrite to replace file extension - It's quite simple to "hide" my script extensions with mod_rewrite: RewriteEngine On RewriteRule ^(.*)\.html$ $1.php [L] So http://example.com/foo.html points to /home/example/htdocs/foo.php However, I wonder if there's a way to prevent direc...

1 IP, 1 server, 2 apps, 0 dollars to spend - Here is our setup: DSL line, 1 IP, 1 server that we forward all port 80 to thru a Linksys router. Not my setup so please don't shoot the messenger. We have a demo of a product on the server that we get to by typing the public IP then the app ex:..

Tomcat 4.0.6 - Where can I find a binary build of Tomcat 4.0.6 using Java 1.3 for Solaris 8?
   Web Hosting and Web Master Forums (Home) -> Apache All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]