TechnicalCan I chain a web server to another?

 

Press Ctrl+Enter to quickly submit your post
Quick Reply  
 
 
  
 From:  [The best version of] (DSMITHHFX)  
 To:  ALL
42132.1 
Not sure how to describe what I'm looking for:

We have an underpowered PC (an old Mac g4 single-core ppc, maxed-out @ 768MB, actually) running linux with a domain pointing to it for our staging server.

This is fine for ~97% of our staging needs.

BUT, for rarely-needed CMS stuff it's really too slow.

Is it possible to also use another, more modern and powerful pc on our LAN as a (sometime) web server, sharing the same domain, through some sort of proxy thingie pointed at the current server?

 
“hooliganism comes to lawn bowling”
0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  [The best version of] (DSMITHHFX)     
42132.2 In reply to 42132.1 
Might not be the answer but Apache Reverse proxy can point a domain/subdomain to a different address.

So you could setup cms.domain and it points to the better server.
0/0
 Reply   Quote More 

 From:  [The best version of] (DSMITHHFX)  
 To:  ANT_THOMAS     
42132.3 In reply to 42132.2 
Ooh, that may be exactly what I need.

I also remembered I could (probably) run MySQL on the other (more powerful) pc.
“hooliganism comes to lawn bowling”
0/0
 Reply   Quote More 

 From:  [The best version of] (DSMITHHFX)  
 To:  ANT_THOMAS     
42132.4 In reply to 42132.2 
Yep, finally got the reverse proxy working on our staging server. Got stuck until I enabled mod proxy_http (server is configured to redirect port 80 traffic to 443 but t'other server isn't).

Thanks Ant!
“hooliganism comes to lawn bowling”
0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  [The best version of] (DSMITHHFX)     
42132.5 In reply to 42132.4 
Glad to hear it was the answer! :)
0/0
 Reply   Quote More 

 From:  [The best version of] (DSMITHHFX)  
 To:  ALL
42132.6 
And indeed it works for both plain HTML sites and a test Beehive install I did a few months ago. But Wordpress comes through all broken -- pages load with (at least) some images, but no css or scripts.

I've been reading a bunch of WP-behind-reverse-proxy tutorials, but none seem exactly applicable to my config  :-(
“Irresponsible owners give emotional support animals a bad name ”
0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  [The best version of] (DSMITHHFX)     
42132.7 In reply to 42132.6 
Unless the proxy is configured to handle some content types differently to others, it will be treating them all the same.

The obvious thing to check/rule out is missing files or incorrect permissions, though it could also be that static ascii files are being gzipped and that's tripping it up, or if there's a minifier plugin that does local requests on a misconfigured hostname, or a CDN using a subdomain that isn't proxied.

Manual HTTP requests through PuTTY and/or curl are a useful way to figure out what's actually going on.

0/0
 Reply   Quote More 

 From:  [The best version of] (DSMITHHFX)  
 To:  Peter (BOUGHTONP)     
42132.8 In reply to 42132.7 
Thanks Peter.

In addition to the complications you raise, is that WP insists on absolute links for everything, and there's no easy workaround to switch/convert to relative links.

It's a clean install of latest WP release running on bog-standard LAMP, so no special config or plugins running on it ATM.

I'll look into the CDN thing, could be a culprit with missing scripts.
“Irresponsible owners give emotional support animals a bad name ”
0/0
 Reply   Quote More 

 From:  [The best version of] (DSMITHHFX)  
 To:  ALL
42132.9 
"Relative URL" WP plugin did the trick. Strange, because it didn't work yesterday, though I probably had some other thing misconfigured.
“Irresponsible owners give emotional support animals a bad name ”
0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  [The best version of] (DSMITHHFX)     
42132.10 In reply to 42132.8 
A properly setup reverse proxy doesn't care about absolute/relative URLs, because from the browser's perspective it's just interacting with the public face - it doesn't know/care which server the request is handled by.

Since you mentioned redirecting 80->443 I'm guessing the issue is/was with HTTP vs HTTPS and one of them was generating links that the other wouldn't serve.

0/0
 Reply   Quote More 

 From:  [The best version of] (DSMITHHFX)  
 To:  Peter (BOUGHTONP)     
42132.11 In reply to 42132.10 
Quite possibly.
“Irresponsible owners give emotional support animals a bad name ”
0/0
 Reply   Quote More 

 From:  [The best version of] (DSMITHHFX)  
 To:  ALL
42132.12 
double reverse-proxy trouble:

I'm trying to add another proxied site, from a different pc behind our our staging server. I duplicated the relevant lines in default-ssl.conf and changed the details thus:
Code: 
ProxyRequests Off

# reverse proxy to serverA/siteA 022718
<Location "/siteA">
    ProxyPass http://serverA/siteA
    ProxyPassReverse http://serverA/siteA
    Order allow,deny
    Allow from all
    Authtype Basic
    Authname "Restricted Access"
    AuthUserFile /etc/apache2/.htpasswd
    Require user ******
</Location>

# reverse proxy to serverB/siteB 051418
<Location "/siteB">
    ProxyPass http://serverB/siteB
    ProxyPassReverse http://serverB/siteB
    Order allow,deny
    Allow from all
    Authtype Basic
    Authname "Restricted Access"
    AuthUserFile /etc/apache2/.htpasswd
    Require user *******
</Location>

"SiteA" (the original proxied wp site) continues to show the web-facing domain in the address bar

"SiteB" (another cms-y thing) switches from "https://mydomain.com/siteB" to "http://serverB/siteB" upon loading.

Pretty sure I did no special config to the siteA apache instance, or if I did, can't find where it might be.  :-(
“Sweden admits meatballs are Turkish”
0/0
 Reply   Quote More 

 From:  [The best version of] (DSMITHHFX)  
 To:  ALL
42132.13 
Nurmind. Like the wp, I had to modify a base url in the cms-y thing to point to the front-facing server.

All good (but not the >2-hours I wasted before it dawned on me :-/ ).
“Sweden admits meatballs are Turkish”
0/0
 Reply   Quote More 

Reply to All    
 

1–13

Rate my interest:

Adjust text size : Smaller 10 Larger

Beehive Forum 1.5.2 |  FAQ |  Docs |  Support |  Donate! ©2002 - 2018 Project Beehive Forum

Forum Stats