Category Archives: Project Log

My collection of web development projects.

Reverse Proxy a Solr Instance

It’s encouraged that you secure your Solr instance by placing the application on a different file server and behind a firewall. That’s an issue if you are trying to consume data from the Solr instance leveraging AJAX techniques.

reverse_proxy

Flowchart of a reverse proxy directive that rests on website.com’s httpd.conf file.

Problems:

  • www.website.com and Apache Solr live on separate boxes.
  • A firewall protecting Apache Solr plus the cross-domain issue does not expose the necessary end-point to consume via AJAX.
  • Depending on your sys admin setups, Solr may not live on a fully qualified domain (ie. http://12.34.56.789:8983/solr/#/)
  • An AJAX call to consume the Solr instance’s JSON/XML won’t work cross-domain.

Solution:

  • Reverse Proxy directive, mod_proxy – Apache HTTP Server
  • This allows for an endpoint that is visible to the browser and we can consume the JSON/XML that rests within the Solr instance.

ProxyPass /solr http://12.34.56.789:8983/solr/#/
ProxyPassReverse /solr http://12.34.56.789:8983/solr/#/

Don’t forget to apply a RewriteRule Directive to protect the Solr admin panel, once you’ve exposed it to the browser!

Simple PHP Proxy returns incorrect JSON from Apache Solr instance

I’ve implemented Ben Alman’s simple-proxy.php to communicate to an Apache Solr instance (in this case my local) outside of my domain.

I’ve followed the instructions in full, the core of which is to set the simple-proxy.php on my domain’s file server.

I’m curious on if there are any modifications that must be made to the proxy in order for the response to be in the correct format?

View on Stackoverflow.

PageSpeed: here.ashford.edu

Page speed seems to be one of the bigger priorities as of late and I was designated with the RND task in making one of our subdomains, here.ashford.edu a bit…faster. In summary, this is a single-page design intended to support our Marketing campaigns during the 2014 Winter Olympics.

In one sprint (2 weeks in my case), we were able to set some benchmarks and reduce our network requests, optimize our images, minify our CSS, minify our JavaScript, compress and cache our assets by tweaking our server-side configurations.

The before benchmarks are listed below for 03/19/2014 unless otherwise stated:

  1. Google PageSpeed – Mobile: 55/100
  2. Google PageSpeed – Desktop: 71/100
  3. Y-SLOW: 67/100
  4. Network Requests: 112 (03/21/2014)

The after benchmarks are listed below for 03/27/2014:

  1. Google PageSpeed – Mobile: 64/100
  2. Google PageSpeed – Desktop: 83/100
  3. Y-SLOW: 79/100
  4. Network Requests: 87

Tools and methods I used to compliment our page speed via server-side:

Tools and methods I used to compliment our page speed via client-side,:

I still have some items to solve—Youtube iframes ultimately being the culprit. Getting into a 1-second threshold with mobile is another instigator. I’m suspecting a JavaScript solution is on the horizon but we shall see.