Rejik is very simple to configure, all options are in redirector.conf file and is located in /usr/local/rejik.
All the settings are divided into two groups: global and sectional. And they have corresponding areas of operation.
Global settings:
error_log <name of the file>
Path to the log file for error messages. Except errors, different alerts and information are written in it while starting the programme. If there is no parameter, log is not kept.
change_log <name of the file>
The log file of changes made by Rejik. You can find who and what wanted to download and why the change was done. If there is no parameter, log is not kept.
make-cache <path to the programme make-cache>
While starting redirector runs outward programme make-cache, which creates urls.cache files for all the urls files. In this parameter it's necessary to indicate the path to the programme.
Example:
make-cache /usr/local/rejik/make-cache
work_ip <ip-address[/mask]>
work_ip <f:/path/file>
Make changes only for the indicated ip-address or group of addresses. If it is necessary to indicate some addresses or groups, then you have to add some lines with work_ip indicating one ip-address or one group in each. It is also possible to indicate all IPs in a text file, one entry in each line, and set work_ip work_ip f:/this_file
allow_ip <ip-address[/mask]>
allow_ip <f:/path/file>
Don't make changes for the indicated ip-address or group of addresses. If it is necessary to give access to certain addresses or groups, then you have to add some lines with allow_ip, indicating one ip-address or one group in each. It is also possible to indicate all IPs in a text file, one entry in each line, and set allow_ip f:/this_file
First of all the redirector checks an IP for work_ip, and then for allow_ip.
For example, you need to set up Rejik to work with 192.168.30.0/255.255.255.0 exept 192.168.30.10 and 192.168.30.11
Solution:
work_ip 192.168.30.0/255.255.255.0
allow_ip 192.168.30.10
allow_ip 192.168.30.11
work_id <login>
work_id <f:/path/file>
Make changes only for the indicated login (for those, whose users authorize in squid through login). If it is necessary to indicate some logins, then you have to add some lines with work_id indicating one login in each. It is also possible to indicate all logins in a text file, one entry in each line, and set work_id f:/this_file
Example:
work_id vasia
work_id lena
work_id f:/usr/local/rejik/personal
allow_id <login>
allow_id <f:/patch/file>
Don't make any changes for the indicated login (for those, whose users authorize in squid through login). If it is necessary to indicate some logins, then you have to add some lines with allow_id indicating one login in each. It is also possible to indicate all logins in a text file, one entry in each line, and set allow_id f:/this_file
Example:
allow_id director
allow_id f:/usr/local/rejik/nachalstvo
allow_urls </patch/file>
Don't make any changes for the sites, indicated in the file. URL's are indicated one in each line.
Example:
allow_urls /usr/local/rejik/my_sites
raw_change <from> <to>
Replace part of url.
Example:
raw_change ftp://downloads1.kaspersky-labs.com/updates/ ftp://192.168.1.1/Updates/
raw_change ftp://downloads2.kaspersky-labs.com/updates/ ftp://192.168.1.1/Updates/
raw_change ftp://downloads4.kaspersky-labs.com/updates/ ftp://192.168.1.1/Updates/
raw_change ftp://downloads-us21.kaspersky-labs.com/updates/ ftp://192.168.1.1/Updates/
raw_log off
Disable logging changes made by raw_change.
Example:
raw_log off
write_hostname_to_log
Add clients hostname to change log.
Example:
write_hostname_to_log on
Section settings:
<Name>
The name of the current sections. Entry is added to the log file when the rule works.
Example:
<BANNER>
ban_dir <path>
The path to the folder, where the files with the rules are located.
url <change URL>
With what do you have to change pages which fit the rule? In URL you can indicate special variables which will be changed into the client's query data:
#URL# - the URL client wanted to go
#IP# - the client's IP address
#IDENT# - the client's login
#METHOD# - the ULR query method
#SECTION# - the name of the section, which made the redirection
work_ip <ip-address[/mask]>
The same as the parameter from the global section, but it works in this one.
Example:
work_ip 10.10.11.0/255.255.255.0
allow_ip <ip-address[/mask]>
The same as the parameter from the global section, but it works in this one.
Example:
allow_ip 10.10.11.0/255.255.255.0
work_id <login>
The same as the parameter from the global section, but it works in this one.
Example:
work_id vasia
allow_id <login>
The same as the parameter from the global section, but it works in this one.
Example:
allow_id moder
log off
Don't write into change_log the change, made in this section.
Example::
log off
reverse
This option invert the section ban-list.
For example, there is an URL "domen.ru" in the ban-list:
If there is no reverse option, queries to the domen.ru will be redirected.
Otherwise the queries to the domen.ru will be passed, and all the others will be redirected.
Example:
reverse
action
This option set action for section. Possible options: pass and redirect.
pass - allow client request
redirect - redirect client to url (default)
If action not defined, then use action redirect.
Example:
action pass
Wanted
Wanted a large catalog of porn to appending to porno.urls
Wanted
Wanted news feeds "new porn sites" to appending to porno.urls