Implementedcommands
Currently the following commands are implemented:
stop
The c-icap will shutdown
reconfigure
The service will reread the config file without the need to stop and restart the c-icap server.
The services will be reinitialized
relog
This command causes c-icap to close and reopen the log files. This is very useful for log
rotation.
Services and modules can define their own commands.
Examples:
To reconfigure c-icap:
echo -n "reconfigure" > /var/run/c-icap.ctl
To rotate access log:
mv /var/log/c-icap/access.log /var/log/c-icap/access.log.1
echo -n "relog" > /var/run/c-icap.ctl
Lookuptables
Lookup tables are simple read-only databases. A lookup table can defined in c-icap.conf file using the
form:
type:path
where the type is the type of lookup table and path is the extra information required to use the table
(e.g. file path). Currently the following lookup table types defined internally by c-icap:
file Simple text file databases. The database records are stored in text files in the form:
key[: value1, value2 ...]
example path definition:
file:/path/to/the/file.txt
hash Similar to file lookup tables but c-icap uses fast hashes for searching.
example path definition:
hash:/path/to/the/file.txt
regex Similar to the file lookup tables but the keys are regular expressions in the form /regex/flags .
For possible flags values please read 'Regex expressions' paragraph in this manual.
example regex lookup table data:
/^[a-m].*/i: group1
/^[n-z].*/i: group2
example path definition:
regex:/path/to/the/file.txt
Regexexpressions
The c-icap regex expressions have the form /regex_definition/flags where "flags" is one or more letters,
its of them express a flag.
Common flags
g This flag forces the score multiplied by the number of regex
expression matches. For example if the expression matches 5
times and the devined score value is 10 then the final score
will be 50.
i Do caseless matching
m Match-any-character operators don't match a newline
and ^$ operators does not match newlines within data
If the module compiled using the pcre library the following flags can be used
s (PCRE_DOTALL) matches anything including NL
x (PCRE_EXTENDED) Ignore whitespace and # comments
A (PCRE_ANCHORED) Force pattern anchoring
D (PCRE_DOLLAR_ENDONLY) $ not to match newline at end
U (PCRE_UNGREEDY) Invert greediness of quantifiers
X (PCRE_EXTRA) PCRE extra features
u (PCRE_UTF8) Run in UTF-8 mode
Runtimeinformation
Someone can retrieve runtime information using the info service. The information includes bytes received
and transmited, active services, information about service usage and many other. The information provided
in HTML and text format.
Example:
Retrieve runtime information from command line:
c-icap-client -i localhost -s "info?view=text" -req "a_url"