Follow

Cache Control Environment Setup and Script Execution

Introduction:

RedShield cache control API and related products have been developed for the customer who is willing to view and clear the web application related cache at RedShield cloud. Main features are:

 1. Show all the cache object for prod and pre-prod application servers
 2. Show single cache object for prod and pre-prod application servers
 3. Delete all the cache object for prod and pre-prod application servers
 4. Delete single cache entry object for prod and pre-prod application servers

 

CAUTION:

ALL THE INFORMATION RELATED TO CACHE CONTROL INCLUDING PASSWORD ARE THE COPYRIGHT OF REDSHIELD SECURITY LIMITED AND CANNOT BE SHARED WITHOUT THE PROPER CONSENT OF THE AUTHORITY. THIS LIMITATION ALSO INCLUDES ANY UNAUTHORISED ATTEMPT TO USE OF OTHER API NOT RELEASED TO THE AUTHORISED PERSONNEL.

 

Prerequisite:

Recommended Perl Version: 5.18.2 or above

Libraries Required: SOAP::Lite, Crypt::SSLeay

Operating System: Linux (Ubuntu 14+), Mac OSX (10+), Windows (8+)

 

Step One: Install Perl and Modules

The cache control relevant script requires perl environment to execute. Please build your environment as below.

Configuring ActivePerl for Windows

  • Download the MSI installer of ActiveState Perl 5.18.4 build 1805 (ActivePerl-5.18.4.1805-MSWin32-x86.msi) from ActiveState:
    http://www.activestate.com/Products/Download/Register.plex?id=ActivePerl
  • To install ActivePerl, double click the ActivePerl-5.18.4.1805-MSWin32-x86.msi file that you downloaded. The ActivePerl setup wizard guides you through the installation process. 
  • To configure ActivePerl from the command prompt, from the Start Menu, choose Programs>Accessories>Command Prompt. 
  • To open the ActivePerl Programmer's Package Manager (PPM), version 3.1 shell, at the command line, type ppm3 and press Enter.
    This PPM shell opens.
  • To add a new repository, at the PPM shell prompt, type: rep add winnipeg http://theoryx5.uwinnipeg.ca/cgi-bin/ppmserver?urn:/PPMServer58 and press Enter.
  • At the ppm shell, type: install Crypt-SSLeay, and press Enter.
  • Ensure that both ssleay32.dll and libeay32.dll are installed in your Perlin directory.
  • To exit the ActivePerl ppm shell, type q and press Enter.

Configuring Perl for Red Hat Linux

  • Download the Crypt-SSLeay RPM for Perl. 
    You can download perl-Crypt-SSLeay 0.45-2 from http://www.redhat.com/swr/i386/perl-Crypt-SSLeay-0.45-2.i386.html.
  • To install the RPM, at the command prompt, type sudo rpm -Uvh perl-Crypt-SSLeay-0.45-2.i386.rpm, and press Enter.
    RPM installs the Perl Crypt-SSLeay package.
  • To open the Comprehensive Perl Archive Network shell (CPAN-shell), at the command line, type perl -MCPAN -e shell, and press Enter.
    The CPAN-shell prompt appears.
  • To install the SOAP:Lite modules, at the CPAN-shell prompt, type install SOAP::Lite and press Enter.
    The CPAN-shell guides you through the installation and configuration of SOAP::Lite.
  • To exit the CPAN-shell after you successfully install SOAP::Lite, type quit and press Enter. 

Step Two: Copy Relevant Library

Please copy the attached iControlTypeCast.pm from the attached Cache_Control.zip to the library folder of the installed Perl environment where other *.pm files are residing.

Step Three: Execute Application

Please download and execute the attached Cache_Control.pl script extracted from the Cache_Control.zip. Please keep the Cache_Control.conf in the same directory while executing this.

Usage: 

<Password> <Environment> <Action> <Show_Delete_All or Name of single object/URI>

Example1: pass123456 preprod show all

Example2: pass123456 prod show /assets/tiles/v18/L18/12/4037/2498.png

Example3: pass123456 prod delete all

Example4: pass123456 preprod delete /assets/tiles/v18/L18/12/4037/2498.png

Tips:

  • Please collect the password from the relevant authority. 
  • Environment values are accepted either as 'prod' or 'preprod'.
  • Action values are accepted either as 'show' or 'delete'.
  • Cache objects are accepted as either 'all' or valid URL.

 

Troubleshooting:

Error Messages:

500 Can't locate object method "new" via package "LWP::Protocol::https::Socket" at ./Cache_Control.pl line 138.

Resolution:

Install the related packages and run the script again:

sudo apt-get install build-essential

sudo apt-get install libssl-dev

perl -MCPAN -e shell 'install LWP::Protocol::https'

perl -MCPAN -e shell 'install Crypt::SSLeay' 

Further information might be found here:

https://library.netapp.com/ecmdocs/ECMP1650312/html/GUID-CFF28CED-73B1-4B03-8366-8E2D0A089A92.html

 

Error Messages:

500 read failed:  at ./Cache_Control.pl line 138.

500 Can't Connect to the .......

500 Server closed connection without sending any data back at ......

Resolution:

Your IP address might not be allowed to run the related scripts. Please consult with the support team at support@redshield.co

 

Any improvement related to this code or bug found, please report to support@redshield.co

Thanks for using the RedShield cache control features.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments