[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [users@httpd] two servers and sites on single IP

mod_proxy is the standard approach here..

Set up a second vhost on and get that to proxy back to

You will need to specify a small folder as doc root - basically to serve error pages! - our error directory has static pages for each error message we wont to handle + css/images

DocumentRoot /www/place-to-put-error-pages
<VirtualHost *:443>
  ServerName                  foo.bar.com
  RewriteEngine               on
  ProxyPreserveHost           on
  ProxyPassReverse            /
  RewriteCond %{REQUEST_URI}  !^/errors
  RewriteRule (.*)$1          ; [P,L]
  ErrorDocument 403           /errors/foo.html
  ErrorDocument 500           /errors/foo.html
  ErrorDocument 502           /errors/foo.html
  ErrorDocument 503           /errors/foo.html

To be honest I use this set up on a single box with a lightweight frontend that serves errors and a heavyweight backend which servers dynamic sites - so that when I need to restart the later (which can take 2/3 seconds) we don't lose requests. The front end apache restarts really quickly because it is quite small...

On 29/06/2018 16:27, Louis wrote:
On 2018-06-29 10:26 AM, Jerry Arnold wrote:
Does bar.me.com have to run on  There is no reason you can't run multiple domains on the same IP

Thanks -- but yes; two separate boxes with different o/s.

I have tried setting up a new "bar.conf" on"foo" -- but am having difficulties with directory root:

me@foo:/etc/apache2/sites-available$ apachectl -S
AH00112: Warning: DocumentRoot [/etc/apache2/] does not exist
VirtualHost configuration:        bar.me.com (/etc/apache2/sites-enabled/bar.conf:1)        k318 (/etc/apache2/sites-enabled/k318.conf:6)*        k318-admin (/etc/apache2/sites-enabled/k318-admin.conf:3)



VirtualHost Examples - Apache HTTP Server Version 2.4 <https://httpd.apache.org/docs/2.4/vhosts/examples.html>
Your server has multiple hostnames that resolve to a single address, and you want to respond differently for www.example.com and www.example.org. The above configuration is what you will want to use in almost all name-based virtual hosting situations. The only thing that this configuration will not ...

For https you can use SNI:


NameBasedSSLVHostsWithSNI - Httpd Wiki <https://wiki.apache.org/httpd/NameBasedSSLVHostsWithSNI>
SSL with Virtual Hosts Using SNI. Summary. Using name-based virtual hosts with SSL adds another layer of complication. Without the SNI extension, it's not generally possible (though a subset of virtual host might work).

Jerry Arnold
Principal Engineer/Architect II
o: 1-913-663-9522

*From:* Louis <stormy22@xxxxxxxxx>
*Sent:* Friday, June 29, 2018 9:15:19 AM
*To:* Apache list
*Subject:* [users@httpd] two servers and sites on single IP
Hopefully simple, but I'm now getting confused.  Currently, single
server1 (Apache 2.4) running single site foo.me.com on
single static IP. Rock solid for the last six years.

Need to add server2 (Apache 2.4) for site bar.me.com on the
same static IP.

What is the fastest, most efficient way for server1 to rewrite |
redirect | proxy  "bar" to and still serve "foo" from (Border router does not accept alpha commands, only
numerical, so I cannot redirect here.)

Many thanks -- Louis

To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx

This email is intended solely for the use of the
addressee and may contain information that is
confidential, proprietary, or both. If you receive
this email in error please immediately notify
the sender and delete the email.

To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx

The Wellcome Sanger Institute is operated by Genome Research Limited, a charity registered in England with number 1021457 and a company registered in England with number 2742969, whose registered office is 215 Euston Road, London, NW1 2BE.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx