LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-09-2006, 02:41 AM   #1
carlainz
LQ Newbie
 
Registered: Nov 2005
Posts: 26

Rep: Reputation: 15
redirect site from apache to tomcat


hello,

i'n my FC5 x64 i have apache 2.2 with name-based virtual host (2 domains site) and all work fine .
in ahother box i have tomcat on port 8080 whit 1 site .
now i have to set up the tomcat site in apache , i think i have to set apache as a proxy.

i have try this configuration :

<VirtualHost *:80>
ServerAdmin xxx@xxx.com
DocumentRoot /var/www/domain1
ServerName domain1.com
ServerAlias domain1.com www.domain1.com
ErrorLog logs/domain1.com-error_log
CustomLog logs/domain1.com-access_log combined
</VirtualHost>

<VirtualHost *:80>
ServerAdmin xxxx@domain2.com
DocumentRoot /var/www/domain2
ServerName domain2.com
ServerAlias domain2.com www.domain2.com
ErrorLog logs/domain2.com-error_log
CustomLog logs/domain2.com-access_log combined
</VirtualHost>

<VirtualHost *:80>
ServerAdmin xxx@domain3.com
ServerName domain3.com
ServerAlias domain3.com www.domain3.com
ProxyPass /domain3/ http://192.168.100.11:8080/domain3
ProxyPassReverse /domain3/ http://192.168.100.11:8080/domain3
ErrorLog logs/domain3.com-error_log
CustomLog logs/domain3.com-access_log combined
</VirtualHost>


but doesn't work , when i add the 3 virtualhost (domain3) .
in my loadmodule section i have this for the proxy

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so

and

#<IfModule mod_proxy.c>
ProxyRequests Off

thanks
cheers
 
Old 12-09-2006, 03:41 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
looks like your're directives are not defined correctly:

change

ProxyPass /domain3/ http://192.168.100.11:8080/domain3
ProxyPassReverse /domain3/ http://192.168.100.11:8080/domain3

to

ProxyPass /domain3/ http://192.168.100.11:8080/domain3/
ProxyPassReverse http://192.168.100.11:8080/domain3/ /domain3/

you need to be able to have a direct replacement in terms of the strings there, so if you have a / on one, but not the other, http://example.com:8080/blah can become example.comblah etc... also the reverse is exactly that, the opposite of the ProxyPass, the undo function...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
(IPTABLES) redirect web site to a file? dmane15 Linux - Newbie 9 08-11-2008 05:53 AM
no trailing slash -> apache redirect to microsoft site? SerfurJ Linux - Software 6 03-15-2005 06:25 AM
How to redirect apache to tomcat? gepesz Linux - General 0 07-29-2004 09:16 PM
apache redirect? fibbi Linux - Software 7 01-30-2004 10:41 PM
Why use Apache with Tomcat rather than just Tomcat itself? davee Linux - Software 1 08-21-2003 09:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration