LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 08-08-2014, 06:00 PM   #1
Stvrosky
LQ Newbie
 
Registered: Aug 2014
Location: Chile
Distribution: RHEL 6.5 x86_64
Posts: 15

Rep: Reputation: Disabled
Reverse Proxy in Apache 2.2 + SLL Cert Problem


Hi All:

I have a doubt with this. I made a laboratory enviroment for this and actually i did it an work fine, but only for a normal configuration (without certificate).

The scenario was this:

I have 3 VM:

A reverse proxy, hostname rp00.example.com, ip 192.168.122.110/24
2 web servers:
Firts - Hostname ws01.example.com, ip 192.168.122.120/24
Second - Hostname ws02.example.com, ip 192.168.122.130/24

I create a index.html file with the next information:

[root@ws01 html]# cat /var/www/html/index.html
Thu Aug 7 16:33:21 CLT 2014
ws01.example.com

[root@ws02 html]# cat /var/www/html/index.html
Thu Aug 7 16:35:20 CLT 2014
ws02.example.com

If i check by browser i can see the info in each web server.

So i put the next configuration in the reverse proxy (/etc/httpd/conf/httpd.conf).

#######
Listen 80

<VirtualHost *:80>
ServerName www.test.com
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://ws01.example.com:8080/ retry=0 timeout=5
ProxyPassReverse / http://ws01.example.com:8080/
<IfModule mod_disk_cache.c>
CacheEnable disk /s
CacheIgnoreHeaders Set-Cookie
CacheRoot "/var/cache/mod_proxy"
</IfModule>
</VirtualHost>


<VirtualHost *:80>
ServerName www.prueba.com
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://ws02.example.com:8080/ retry=0 timeout=5
ProxyPassReverse / http://ws02.example.com:8080/
<IfModule mod_disk_cache.c>
CacheEnable disk /s
CacheIgnoreHeaders Set-Cookie
CacheRoot "/var/cache/mod_proxy"
</IfModule>
</VirtualHost>

################

I edit the hosts file in each machine:

[root@rp00 ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.122.110 rp00.example.com rp00
192.168.122.120 ws01.example.com ws01
192.168.122.130 ws02.example.com ws02

And for my host (not a VM) i edit the hosts too:

192.168.122.110 www.test.com
192.168.122.110 www.prueba.com

I try to emulate this:

Internet --Port 80--> |Reverse Proxy| ----\
Port 8080----->|WS01|
Port 8080----->|WS02|

So, if i put in my web browser www.test.com show me:

Thu Aug 7 16:33:21 CLT 2014
ws01.example.com

if i put in my web browser www.prueba.com show me:
Thu Aug 7 16:35:20 CLT 2014
ws02.example.com

Ok, that is working. However, i need to secure the conection with SSL. I create one certificate by my own, but i don't really know if only i need to create one certificate for both (domain) or two certificate (for each one), and how will be configurate??
I create 1 certificate to test with the first site www.test.com (i follow this link http://www.cyberciti.biz/faq/rhel-ap...-ssl-tutorial/), but it didn't work.


I understand this will work like this:

|HERE THE CERTIFICATES|
Internet --Port 443--> |Reverse Proxy| ----\
Port 8080----->|WS01|
Port 8080----->|WS02|

Can you help me please?

Best regards

EDIT:

I found the solution for my self.
CT please.

Last edited by Stvrosky; 08-13-2014 at 04:22 PM. Reason: I found the solution in another place
 
Old 08-21-2014, 02:09 AM   #2
routers
Member
 
Registered: Aug 2005
Location: Malaysia - KULMY / CNXTH
Distribution: Slackware, Fedora, FreeBSD, Sun O/S 5.10, CentOS
Posts: 787
Blog Entries: 6

Rep: Reputation: 75
hello , i know this thread is solved , however could you paste the link that solved your problem please
its might usable for me or others

thanks

Regards
 
Old 08-21-2014, 10:02 AM   #3
Stvrosky
LQ Newbie
 
Registered: Aug 2014
Location: Chile
Distribution: RHEL 6.5 x86_64
Posts: 15

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by routers View Post
hello , i know this thread is solved , however could you paste the link that solved your problem please
its might usable for me or others

thanks

Regards
Sure, i can.
I have a lot of problems with the mod_ssl in Apache. So i changed the software to Ngingx project. Now my reverse proxy is working with ngynx and it's working fine.

I followed this link to configurate the reverse proxy with SSL:

http://www.cyberciti.biz/faq/howto-l...inx-ssl-proxy/

Configuration for keepalived:

http://www.cyberciti.biz/faq/handlin...th-keepalived/


If you want continue trying with Apache follow this link (it doesn't work for me):

http://www.cyberciti.biz/faq/rhel-ap...-ssl-tutorial/


I hope that info help you.
 
Old 08-21-2014, 12:25 PM   #4
routers
Member
 
Registered: Aug 2005
Location: Malaysia - KULMY / CNXTH
Distribution: Slackware, Fedora, FreeBSD, Sun O/S 5.10, CentOS
Posts: 787
Blog Entries: 6

Rep: Reputation: 75
thank you very much , appreciated that
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Nginx Reverse proxy on a internal apache reverse server ITiger Linux - Software 0 04-25-2014 07:44 AM
Problem configuring https apache reverse proxy niyas_gk Linux - Server 1 10-17-2013 04:03 AM
[SOLVED] Apache reverse proxy problem with vhost omgs Linux - Software 8 02-15-2012 02:27 PM
[SOLVED] Apache Reverse Proxy - problem with configuration dlugasx Linux - Server 4 10-04-2010 06:44 AM
SLL cert in Suse jimshain Linux - General 4 01-11-2006 10:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

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