LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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-02-2012, 06:12 PM   #1
nicolethomson
LQ Newbie
 
Registered: Nov 2012
Posts: 4

Rep: Reputation: Disabled
apache http+mod_proxy+virtual host+load balancing


Can you please help verifying and tuning with additional guidance?

scenario
OS centos
webserver apache http version 2.2.23
two weblogic servers clustered
two webservers

above are behind a load balancer

Basically wanted to do url redirection and load balancing(without modifying the session) of traffic

when i type common agent.abconline.com it should get redirected to app server 192.168.0.1:7001/agent
staing.abconline.com should get redirected to 192.168.0.1;7001/staging

the above said i am able to do with mod_rewrite alone, but while trying with mod_proxy and load balancing, i am not able to get redirected to said URL,

following are the config

NameVirtualHost *:80
<VirtualHost *:80>
ServerName agent.abconline.com
RewriteEngine On

<Proxy balancer://agentcluster>
BalancerMember http://192.168.0.1:7003 route=1 loadfactor=50 retry=60
BalancerMember http://192.168.0.2:7003 route=1 loadfactor=50 retry=60
</Proxy>

# Redirect all non-static requests to agent
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ balancer://agentcluster%{REQUEST_URI} [P,QSA,L]

ProxyPass /abc-oper balancer://agentcluster/abc-oper
ProxyPassReverse /abc-oper balancer://agentcluster/abc-oper
ProxyPreserveHost on

SetEnv force-proxy-request-1.0 1
SetEnv proxy-nokeepalive 1

<Proxy *>
Order deny,allow
Allow from all
</Proxy>

ErrorLog /apps/apache/logs/agent.abconline.com.error.log
CustomLog /apps/apache/logs/agent.abconline.com.access.log combined
LogLevel debug
</VirtualHost>

<VirtualHost *:80>
ServerName staging.abconline.com
RewriteEngine On

<Proxy balancer://stagingcluster>
BalancerMember http://192.168.0.1:7003 route=1 loadfactor=50 retry=60
BalancerMember http://192.168.0.2:7003 route=1 loadfactor=50 retry=60
</Proxy>

# Redirect all non-static requests to agent
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ balancer://stagingcluster%{REQUEST_URI} [P,QSA,L]

ProxyPass /abc-oper balancer://stagingcluster/abc-oper
ProxyPassReverse /abc-oper balancer://stagingcluster/abc-oper
ProxyPreserveHost on

SetEnv force-proxy-request-1.0 1
SetEnv proxy-nokeepalive 1

<Proxy *>
Order deny,allow
Allow from all
</Proxy>

ErrorLog /apps/apache/logs/staging.abconline.com.error.log
CustomLog /apps/apache/logs/staging.abconline.com.access.log combined
LogLevel debug
</VirtualHost>
 
Old 12-02-2012, 09:02 PM   #2
nicolethomson
LQ Newbie
 
Registered: Nov 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
with the above rules, without redirection that is if i type agent.abconline.com/agent it works fine, but i wanted it if i type agent.abconline.com it should by default go to agent.abconline.com/agent.

So looking at mod_rewrite, any guidance please?

Nic
 
  


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
Load Balancing in Apache Server uk.engr Linux - Newbie 3 05-24-2012 03:26 PM
Load Balancing - ipvsadm with apache (mod_proxy) to another apache not working romeo_tango Linux - Server 1 01-12-2012 03:21 AM
Conceptual details about apache load balancing ganesh_gore Linux - Server 0 06-22-2010 03:49 AM
Apache 2 / SSL and virtual host under GNU/Linux Debian Etch - http and https scls19fr Linux - Server 0 10-09-2008 10:11 AM
Load Balancing software for apache coolguy_iiit Linux - General 3 08-06-2006 01:31 PM

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

All times are GMT -5. The time now is 06:39 AM.

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