LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 09-11-2017, 08:08 PM   #1
Cerephim
Member
 
Registered: Mar 2005
Location: Dayton, Ohio
Distribution: CentOS
Posts: 49

Rep: Reputation: 0
Enabling multiple https webservers through one firewall via apache reverse proxy


I've read so many differing configurations that my head is swimming!

Here's the situation:
I have a smoothwall firewall (3.0) and have a single machine set up in the DMZ (orange).
There are multiple other servers set up behind the firewall (green).

What I want to do is this:
Enable two completely different domains with completely different certificates (one self signed, one purchased and verified) running on that single box in the dmz to be accessed through the single public IP running on the firewall via apache reverse proxy. Oh, and I'd like the reverse proxy to be running on that single server in the DMZ too.

The questions I have are these:

Is this even possible?
Do I comment out the _default_:443 virtualhost stanza in /etc/httpd/conf.d/ssl.conf (running CentOS)
Do I create a virtualhost stanza for each of the two different domains?
Where to stick the statements that cause reverse proxying to happen.

Any requests for more info will be honored.

Any help is *sincerely* appreciated!

Last edited by Cerephim; 09-11-2017 at 08:10 PM.
 
Old 09-11-2017, 08:12 PM   #2
Timothy Miller
Moderator
 
Registered: Feb 2003
Location: Arizona, USA
Distribution: Debian, EndeavourOS, OpenSUSE, KDE Neon
Posts: 4,005
Blog Entries: 26

Rep: Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521
Quote:
Originally Posted by Cerephim View Post
Is this even possible?
Yes, I've got one proxy that's got over 100 sites behind it, although only 2 or 3 domains.

Quote:
Originally Posted by Cerephim View Post
Do I comment out the _default_:443 virtualhost stanza in /etc/httpd/conf.d/ssl.conf (running CentOS)
You can, or you can modify it to use...whatever works for you

Quote:
Originally Posted by Cerephim View Post
Do I create a virtualhost stanza for each of the two different domains?
Most definitely, yes you will need different virtualhosts due to needing to supply different certificates.

Quote:
Originally Posted by Cerephim View Post
Where to stick the statements that cause reverse proxying to happen.

Any help is *sincerely* appreciated!
I always throw them at the bottom of the particular stanza, right above the </VirtualHost>

Also, I *PREFER* (making sure to point out that this isn't the correct way, just how I like to do it) that I create a different *.conf file for EACH domain. I find it just makes it easier to find what I want to change when updating/changing (admittedly, this is because I have a RP that has 60+ proxies for each large domain and has 2 large domains)

Last edited by Timothy Miller; 09-11-2017 at 08:14 PM.
 
1 members found this post helpful.
Old 09-12-2017, 11:17 AM   #3
Cerephim
Member
 
Registered: Mar 2005
Location: Dayton, Ohio
Distribution: CentOS
Posts: 49

Original Poster
Rep: Reputation: 0
Can ya help an https reverse proxy infant out by posting the relevant snippets of code from the config file?

Thanks!
 
Old 09-14-2017, 05:45 PM   #4
Timothy Miller
Moderator
 
Registered: Feb 2003
Location: Arizona, USA
Distribution: Debian, EndeavourOS, OpenSUSE, KDE Neon
Posts: 4,005
Blog Entries: 26

Rep: Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521
Quote:
Originally Posted by Cerephim View Post
Can ya help an https reverse proxy infant out by posting the relevant snippets of code from the config file?

Thanks!
Which snippets do you need? Like the actual ProxyPass lines?
 
Old 09-14-2017, 09:02 PM   #5
Cerephim
Member
 
Registered: Mar 2005
Location: Dayton, Ohio
Distribution: CentOS
Posts: 49

Original Poster
Rep: Reputation: 0
The virtualhost stanzas, appropriately redacted, of course. One stanza each from two differing domains would be wonderful!
 
Old 09-14-2017, 09:39 PM   #6
Timothy Miller
Moderator
 
Registered: Feb 2003
Location: Arizona, USA
Distribution: Debian, EndeavourOS, OpenSUSE, KDE Neon
Posts: 4,005
Blog Entries: 26

Rep: Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521
Oh, ok, should be able to do that if I don't forget again...
 
1 members found this post helpful.
Old 09-15-2017, 08:23 AM   #7
Cerephim
Member
 
Registered: Mar 2005
Location: Dayton, Ohio
Distribution: CentOS
Posts: 49

Original Poster
Rep: Reputation: 0
Thank you. I'll check every now and then, and if I don't see a reply, I'll give the thread a bump. Is that okay?
 
Old 09-15-2017, 10:13 AM   #8
Timothy Miller
Moderator
 
Registered: Feb 2003
Location: Arizona, USA
Distribution: Debian, EndeavourOS, OpenSUSE, KDE Neon
Posts: 4,005
Blog Entries: 26

Rep: Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521
Here's an excerpt from my companies main reverse proxy:

Code:
<VirtualHost companies primary proxy:80>

ServerName urlofmycompaniesserver

############## ALASKA  ########################################

ProxyPass /akCurrent http://10.0.5.200:8080/akCurrent
ProxyPassReverse /akCurrent http://10.0.5.200:8080/akCurrent
ProxyPass /akProd http://10.0.5.200:8082/akProd
ProxyPassReverse /akProd http://10.0.5.200:8082/akProd
ProxyPass /akTest http://10.0.5.200:8084/akTest
ProxyPassReverse /akTest http://10.0.5.200:8084/akTest
ProxyPass /akPhchubCurrent http://10.0.5.200:8080/akPhchubCurrent
ProxyPassReverse /akPhchubCurrent http://10.0.5.200:8080/akPhchubCurrent
ProxyPass /akPhchubProd http://10.0.5.200:8082/akPhchubProd
ProxyPassReverse /akPhchubProd http://10.0.5.200:8082/akPhchubProd
ProxyPass /akPhchubTest http://10.0.5.200:8084/akPhchubTest
ProxyPassReverse /akPhchubTest http://10.0.5.200:8084/akPhchubTest

(billions of others)

</VirtaulHost>
<VirtualHost a different server:80>
ServerName a different url
ServerAlias another URL that is actually the same destination
Redirect Permanent / https://redirecting to https/
</VirtualHost>
<VirtualHost the previous server:443>
ProxyPreserveHost On
ServerName the same as last stanza
SSLEngine On
SSLCertificateFile /etc/pki/tls/certs/server.pem
SSLCertificateKeyFile /etc/pki/tls/private/key.pem
SSLCACertificateFile /etc/pki/tls/certs/gdbundle.crt
ProxyPass / http://10.0.5.161:3001/
ProxyPassReverse / http://10.0.5.161:3001/
</VirtualHost>

Last edited by Timothy Miller; 09-15-2017 at 10:15 AM.
 
1 members found this post helpful.
Old 10-04-2017, 06:03 AM   #9
Cerephim
Member
 
Registered: Mar 2005
Location: Dayton, Ohio
Distribution: CentOS
Posts: 49

Original Poster
Rep: Reputation: 0
Thank you!
 
Old 10-24-2017, 10:43 AM   #10
Cerephim
Member
 
Registered: Mar 2005
Location: Dayton, Ohio
Distribution: CentOS
Posts: 49

Original Poster
Rep: Reputation: 0
I'm guessing that how I set up the structure in /var/www has a profound effect on the way I would configure the reverse proxy lines.

Am I correct in assuming that in the line: "ProxyPass /akPhchubTest http://10.0.5.200:8084/akPhchubTest"
the /akPhchubTest is a reference to /var/www/html/akPhchubTest ?
 
Old 10-24-2017, 12:27 PM   #11
Timothy Miller
Moderator
 
Registered: Feb 2003
Location: Arizona, USA
Distribution: Debian, EndeavourOS, OpenSUSE, KDE Neon
Posts: 4,005
Blog Entries: 26

Rep: Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521
Not for us, we have no actual sites hosted on this box, it's ONLY used as a proxy. All the sites that it references are on different servers, so it's actually referencing the other servers.
 
1 members found this post helpful.
  


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
webservers SSLv3 disabled but under reverse proxy depam Linux - Security 2 10-19-2014 05:11 AM
Problem configuring https apache reverse proxy niyas_gk Linux - Server 1 10-17-2013 04:03 AM
Setting up Reverse Proxy With SSL Support On Apache And Multiple Addreses vglover Linux - Server 7 07-30-2012 05:00 PM
Reverse Proxy with Apache over https citystriker Linux - Networking 5 07-10-2010 07:09 PM
LXer: Linux configure pound reverse proxy for Apache http / https web server LXer Syndicated Linux News 0 12-14-2007 07:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

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