Using MarkLogic with Squid, a Caching Proxy
15 April 2020 06:50 AM
|
|
IntroductionCan MarkLogic Server be used behind a caching proxy such as Squid? We present some general pointers and tips for setting up Squid, and we provide an example of how you can use MarkLogic Server to retrieve data through Squid. This example has been tested with Squid 2 (on RHEL/CentOS 5) and Squid 3 (on RHEL/CentOS 6 and 7). Installing squidA simple approach is to use the yum package manager to install squid:
Configure squidCreate the squid cache directory:
Modify the config fileLine 921 of /etc/squid/squid.conf (in Squid 2.6) http_port 3128 transparent note the "transparent" after the http_port Start squidAs root or with elevated rights using sudo:
Tail the logtail -f /var/log/squid/access.log Troubleshooting: ensure it's not an issue with SELinux or the firewallIf there are issues with the response timing out, be sure to check your firewall rules and your SELinux configuration as these could be blocking the request. Sample XQuery codeThe code below demonstrates a call being made through squid out to http://www.marklogic.com:
Http ResponseYou should see an http 200 response to show the http request was routed through squid
| |
|