Time for action – testing our configuration file

As we learned before, we can use the -k parse option to test our configuration file. Now, we are going to add a test line and see if Squid can catch the error.

  1. For example, let's add the following line to our squid.conf file:
    unknown_directive 1234
  2. Now we'll run Squid with the -k parse option as follows:
    squid -k parse
    
  3. As unknown_directive is not a valid directive for the Squid configuration file, we should get an error similar to the following:
    2010/07/21 22:28:40| cache_cf.cc(346) squid.conf:945 unrecognized: 'unknown_directive'
    

So, if we find an error within our configuration file, we can go back and fix the errors and then parse the configuration file again.

What just happened?

We first added an ...

Get Squid Proxy Server 3.1 Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.