Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. From a SSH client (Windows) or Terminal (OS X) window, you will need to connect to your site account's home directory on the panel server via a SSH connection:

    Code Block
    languagebash
    ssh <utw10NNNNN>@panel.utweb.utexas.edu


    **NOTE: These next steps assume that you are still in your home directory and have not changed your working directory upon logging in.

  2. Copy the clearcache.sh file in to your site account's home directory: To do this, type the following in to your command line:

    Code Block
    languagebash
    cp /utweb/common/src/examples/clearcache.sh clearcache.sh
  3. If you have vanity domains stamped on your site, then please follow these instructions to add those to the script; otherwise, proceed to step #8:
  4. Type the following command in your command line to edit the clearcache script:

    Code Block
    nano ~/clearcache.sh
  5. This will bring up the nano text editor in your terminal window. From here, you will need to navigate the file with your keyboards arrow keys. Find the line that says urlstopurge="$site"

  6. Once you have navigated to that line, put a space after $site and add the domains you have stamped with your site. separate each entry you add with a space. If your site can be visited with www, please include that name as well.

  7. When you are finished adding your domains, press "Ctrl+o" on your keyboard. Nano will then repeat to you the file it is making these changes to. Press "Enter" on your keyboard to confirm the file and save your changes.
  8. Now that the file is in your home directory (and your domains have been optionally added), we need to change the permissions of it the script to be executable. To do this, type the following in to your command line:

    Code Block
    languagebash
    chmod 750770 ~/clearcache.sh
  9. Now that the file is executable, run the script by typing the following in to your command line:

    Code Block
    languagebash
    ./clearcache.sh
    
    OR
    **If your site has been stamped with a vanity domain(s), then you can supply them as arguments to the script. Be sure to include a space between each domain,
    and if your site is accessible with www, be sure to include that as well.
     
    ./clearcache.sh [domain] [www.domain]
    Real Output

    Real Output (no additional domains have been added to the script, so the cache is only being cleared for utw10373.utweb.utexas.edu):

    No Format
    languagebash
    themeMidnight
    === utweb-px-z1-p01.its.utexas.edu http://utw10373.utweb.utexas.edu
    * About to connect() to utw10373.utweb.utexas.edu port 80 (#0)
    *   Trying 128.83.21.174... connected
    * Connected to utw10373.utweb.utexas.edu (128.83.21.174) port 80 (#0)
    > PURGE /* HTTP/1.1
    > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.18 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.
    > Host: utw10373.utweb.utexas.edu
    > Accept: */*
    > Cookie: balancer_id=utweb-px-z1-p01_http
    > 
    < HTTP/1.1 204 No Content
    HTTP/1.1 204 No Content
    < Server: nginx
    Server: nginx
    < Date: Wed, 27 Apr 2016 17:55:41 GMT
    Date: Wed, 27 Apr 2016 17:55:41 GMT
    < X-CacheServer: 172.17.99.42
    X-CacheServer: 172.17.99.42
    < Set-Cookie: balancer_id=utweb-px-z1-p01_http|VyD9I|VyD9I; path=/
    Set-Cookie: balancer_id=utweb-px-z1-p01_http|VyD9I|VyD9I; path=/
    <
    * Connection #0 to host utw10373.utweb.utexas.edu left intact
    * Closing connection #0
    === utweb-px-z1-p02.its.utexas.edu http://utw10373.utweb.utexas.edu
    * About to connect() to utw10373.utweb.utexas.edu port 80 (#0)
    *   Trying 128.83.21.174... connected
    * Connected to utw10373.utweb.utexas.edu (128.83.21.174) port 80 (#0)
    > PURGE /* HTTP/1.1
    > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.18 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2
    > Host: utw10373.utweb.utexas.edu
    > Accept: */*
    > Cookie: balancer_id=utweb-px-z1-p02_http
    > 
    < HTTP/1.1 204 No Content
    HTTP/1.1 204 No Content
    < Server: nginx
    Server: nginx
    < Date: Wed, 27 Apr 2016 17:55:41 GMT
    Date: Wed, 27 Apr 2016 17:55:41 GMT
    < X-CacheServer: 172.17.99.43
    X-CacheServer: 172.17.99.43
    < Set-Cookie: balancer_id=utweb-px-z1-p02_http|VyD9I|VyD9I; path=/
    Set-Cookie: balancer_id=utweb-px-z1-p02_http|VyD9I|VyD9I; path=/
    < 
    * Connection #0 to host utw10373.utweb.utexas.edu left intact
    * Closing connection #0
  10. Check to see if the proxy caches were flushed by typing this in to your command line:

    Code Block
    languagebash
    curl -vI utwNNNNN.utweb.utexas.edu
    OR
    curl -vI <your vanity domain here>

    Real Output:

    No Format
    languagebash
    themeMidnight
    * About to connect() to utw10373.utweb.utexas.edu port 80 (#0)
    *   Trying 128.83.21.174... connected
    * Connected to utw10373.utweb.utexas.edu (128.83.21.174) port 80 (#0)
    > HEAD / HTTP/1.1
    > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.18 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2
    > Host: utw10373.utweb.utexas.edu
    > Accept: */*
    > 
    < HTTP/1.1 200 OK
    HTTP/1.1 200 OK
    < Server: nginx
    Server: nginx
    < Date: Wed, 27 Apr 2016 17:45:56 GMT
    Date: Wed, 27 Apr 2016 17:45:56 GMT
    < Content-Type: text/html; charset=UTF-8
    Content-Type: text/html; charset=UTF-8
    < Content-Length: 19
    Content-Length: 19
    < Set-Cookie: cache_id=36e1dd7a55420bbdaed5922d061460e7; expires=Wed, 27-Apr-16 18:45:56 GMT; path=/
    Set-Cookie: cache_id=36e1dd7a55420bbdaed5922d061460e7; expires=Wed, 27-Apr-16 18:45:56 GMT; path=/
    < Last-Modified: Wed, 27 Apr 2016 16:58:09 GMT
    Last-Modified: Wed, 27 Apr 2016 16:58:09 GMT
    < ETag: "abdfdae70c71675e-13-5317a507b7971"
    ETag: "abdfdae70c71675e-13-5317a507b7971"
    < X-BackendServer: 172.17.99.35:80
    X-BackendServer: 172.17.99.35:80
    < X-CacheServer: 172.17.99.43
    X-CacheServer: 172.17.99.43
    < X-Cache: MISS
    X-Cache: MISS
    < Accept-Ranges: bytes
    Accept-Ranges: bytes
    < Set-Cookie: balancer_id=utweb-px-z1-p02_http|VyD61|VyD61; path=/
    Set-Cookie: balancer_id=utweb-px-z1-p02_http|VyD61|VyD61; path=/
    < Cache-control: private
    Cache-control: private
    
    < 
    * Connection #0 to host utw10373.utweb.utexas.edu left intact
    * Closing connection #0
  11. Pay attention to the bottom of the output where you will see something like this to confirm the cache was flushed on that proxy cache server:

    No Format
    < X-Cache: MISS
    X-Cache: MISS
  12. Check your site for updated content!

...