LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 06-22-2011, 02:49 AM   #1
Stephan_Craft
Member
 
Registered: Jul 2008
Posts: 184

Rep: Reputation: 30
3 servers with apache proxy


I really got confused with that

I have 3 servers, that i would like to connect with reverse proxy

This is what I've tried, and it's not working... what I'm doing wrong?

<VirtualHost 28.87.264.98:80>
ServerAdmin webmaster@localhost
AliasMatch ^/~([^/]+)(/.*)* /home/$1/public_html$2
DocumentRoot /var/www/html
ServerName localhost
ScriptAlias /cgi-bin/ /var/www/cgi-bin/
CustomLog /var/log/httpd/homedir.log homedir
</VirtualHost>

<VirtualHost 192.168.1.2:80>

ServerName localhost
ProxyRequests off
ProxyPass / https://192.168.1.2/
ProxyPassReverse / https://192.168.1.2/
ProxyPreserveHost On

</VirtualHost>

<VirtualHost 192.168.2.1:80>

ServerName localhost
ProxyRequests off
ProxyPass / https://192.168.2.1/
ProxyPassReverse / https://192.168.2.1/
ProxyPreserveHost On

</VirtualHost>
 
Old 06-22-2011, 02:11 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

Could you elaborate a bit on what you're trying to do and what errors you get?
What I see in your config are 3 ip-based vhosts where the 2 of them are running as reverse proxies for 2 backend ssl servers. I don't think it's necessary as you can achieve the same either with a Redirect directive, or mod_rewrite.
Regarding the 1st vhost, I also don't see why you're using an AliasMatch. You can have the same results if you use mod_userdir. Thus a request for http://x.x.x.x/~foo/bar.html will parse the /home/foo/public_html/bar,html page.
Also you're using localhost as the ServerName for all 3 vhosts. Why is that?

Regards
 
Old 06-24-2011, 04:33 PM   #3
Stephan_Craft
Member
 
Registered: Jul 2008
Posts: 184

Original Poster
Rep: Reputation: 30
I don't get any error. I want apache to serve requests from my 3 servers...
right now i'm using dns to spread requests

what makes it "backend ssl"?

Quote:
Regarding the 1st vhost, I also don't see why you're using an AliasMatch. You can have the same results if you use mod_userdir. Thus a request for http://x.x.x.x/~foo/bar.html will parse the /home/foo/public_html/bar,html page.
it's directadmin default configs

Quote:
Also you're using localhost as the ServerName for all 3 vhosts. Why is that?
it was just for testing, so i didn't changed that

Last edited by Stephan_Craft; 06-24-2011 at 04:49 PM.
 
Old 06-25-2011, 03:39 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi
Quote:
I don't get any error. I want apache to serve requests from my 3 servers...
right now i'm using dns to spread requests
If you don't get errors, please explain what you mean when saying it's not working. And since you don't use a different ServerName for each vhost, how exactly are you using dns?

Quote:
what makes it "backend ssl"?
You proxying 2 ssl servers (https://192.168.1.2 and https://192.168.2.1) on the same IPs as the 2 vhosts. You can use mod_rewrite for this:
Code:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI}
 
Old 06-26-2011, 08:49 AM   #5
Stephan_Craft
Member
 
Registered: Jul 2008
Posts: 184

Original Poster
Rep: Reputation: 30
Quote:
If you don't get errors, please explain what you mean when saying it's not working. And since you don't use a different ServerName for each vhost, how exactly are you using dns?
i'm using external dns server, and i simply set 3 ip address from 1 domain

how i know it's not working?
when i change domain to 1 ip in my dns server, i don't see any traffic sent to other servers
 
Old 06-26-2011, 10:16 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
i'm using external dns server, and i simply set 3 ip address from 1 domain

how i know it's not working?
when i change domain to 1 ip in my dns server, i don't see any traffic sent to other servers
Sorry but I don't seem to understand you. If you want to use the apache vhosts functionality through dns, you need a different ServerName for each IP.
Based on your current apache configuration, the dns is of no use in this case. You should use just IPs, like
http://28.87.264.98 to visit directadmin (whatever is this), http://192.168.1.2 to be redirected to the 1st ssl server and http://192.168.2.1 for the 2nd
Or else, try:
Code:
<VirtualHost 28.87.264.98:80>
ServerName serverA.domain.com
...
<VirtualHost 192.168.1.2:80>
ServerName serverB.domain.com
...
<VirtualHost 192.168.2.1:80>
ServerName serverC.domain.com
...
Regards
 
Old 06-26-2011, 11:06 AM   #7
Stephan_Craft
Member
 
Registered: Jul 2008
Posts: 184

Original Poster
Rep: Reputation: 30
we are talking about completely different things!

i just want to configure apache proxy server that will spread the load on my 3 servers! that's all! nothing to do with dns...
 
Old 06-26-2011, 12:07 PM   #8
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
we are talking about completely different things!
I agree. I think you don't understand what a reverse proxy does. Better have a look here to clarify things.

Quote:
just want to configure apache proxy server that will spread the load on my 3 servers! that's all! nothing to do with dns...
If you want to spread the load, you need a load balancer.
But I don't think this is the case here, as the 3 backend servers are serving different content. At least this is what I can understand from your initial post.
 
Old 06-26-2011, 12:23 PM   #9
Stephan_Craft
Member
 
Registered: Jul 2008
Posts: 184

Original Poster
Rep: Reputation: 30
no, they are serving exactly the same content and connected to the same DB
 
Old 06-26-2011, 12:57 PM   #10
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
no, they are serving exactly the same content and connected to the same DB
Then you need a load balancer.
Have a look at the link in my previous post. Also this example could be of help. Or you can use google, to see how you can use load balancer for your application.

Regards
 
Old 08-25-2011, 07:58 AM   #11
aminia2004
LQ Newbie
 
Registered: Jul 2011
Posts: 4

Rep: Reputation: Disabled
Hellow friends,When i try to do reverse proxying with one of the application servers where there is onscreen login keyboard,the keyboard is not displayed by the reverse proxy server...


ProxyRequests Off
ProxyPass / http://192.168.x.y:5009/AKN/Log.jsp/
ProxyPassReverse / http://192.168.x.y:5009/AKN/Log.jsp/

May please anyone tell me what to do so that onscreen keyboard can display as when i directly type http://192.168.x.y:5009/AKN/Log.jsp/ the keyboard displays and that is very important for security reasons.
 
  


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
All traffic showed as proxy after installing nginx proxy to apache centosfan Linux - Server 0 10-25-2008 08:41 AM
Proxy servers andiman56 General 4 05-09-2007 10:34 PM
Knoppix and Proxy servers phuqmnb Linux - Newbie 1 12-19-2004 11:53 AM
Proxy servers the_imax General 3 12-13-2004 12:04 AM
Proxy Servers... Grim Reaper Linux - Security 6 02-03-2003 03:24 PM

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

All times are GMT -5. The time now is 03:14 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