/l3/users/14-08-2009/nt-lnet/debian14.net.nt/root :1 |
|
#vim /etc/squid/squid.conf
|
#vim /etc/squid/squid.conf
|
#egrep "^#.*$|^ *$
![]() # additional space is needed for incoming data, negative-cached # and hot objects will be released. In other words, the # negative-cached and hot objects will fill up any unused space # not needed for in-transit objects. # # If circumstances require, this limit will be exceeded. # Specifically, if your incoming request rate requires more than # 'cache_mem' of memory to hold in-transit objects, Squid will # exceed this limit to satisfy the new requests. When the load # decreases, blocks will be freed until the high-water mark is ... # You can specify multiple cache_dir lines to spread the # cache among different disk partitions. # # Type specifies the kind of storage system to use. Only "ufs" # is built by default. To enable any of the other storage systems # see the --enable-storeio configure option. # # 'Directory' is a top-level directory where cache swap # files will be stored. If you want to use an entire disk # for caching, this can be the mount-point directory. |
#egrep -v
http_port 3128 hierarchy_stoplist cgi-bin ? acl QUERY urlpath_regex cgi-bin \? cache deny QUERY acl apache rep_header Server ^Apache broken_vary_encoding allow apache access_log /var/log/squid/access.log squid hosts_file /etc/hosts refresh_pattern ^ftp: 1440 20% 10080 refresh_pattern ^gopher: 1440 0% 1440 ... http_access allow purge localhost http_access deny purge http_access deny !Safe_ports http_access deny CONNECT !SSL_ports http_access allow localhost http_access deny all http_reply_access allow all icp_access allow all cache_effective_group proxy coredump_dir /var/spool/squid |
#egrep -v "^#.*$|^ *$" /etc/squid/squid.conf
http_port 3128 hierarchy_stoplist cgi-bin ? acl QUERY urlpath_regex cgi-bin \? cache deny QUERY acl apache rep_header Server ^Apache broken_vary_encoding allow apache access_log /var/log/squid/access.log squid hosts_file /etc/hosts refresh_pattern ^ftp: 1440 20% 10080 refresh_pattern ^gopher: 1440 0% 1440 ... http_access allow purge localhost http_access deny purge http_access deny !Safe_ports http_access deny CONNECT !SSL_ports http_access allow localhost http_access deny all http_reply_access allow all icp_access allow all cache_effective_group proxy coredump_dir /var/spool/squid |
#egrep -v "^#.*$|^ *$" /etc/squid/squid.conf
http_port 3128 hierarchy_stoplist cgi-bin ? acl QUERY urlpath_regex cgi-bin \? cache deny QUERY acl apache rep_header Server ^Apache broken_vary_encoding allow apache access_log /var/log/squid/access.log squid hosts_file /etc/hosts refresh_pattern ^ftp: 1440 20% 10080 refresh_pattern ^gopher: 1440 0% 1440 ... http_access allow purge localhost http_access deny purge http_access deny !Safe_ports http_access deny CONNECT !SSL_ports http_access allow localhost http_access deny all http_reply_access allow all icp_access allow all cache_effective_group proxy coredump_dir /var/spool/squid |
#egrep -v "^#.*$|^ *$" /etc/squid/squid.conf | wc -l
http_port 3128 hierarchy_stoplist cgi-bin ? 45l QUERY urlpath_regex cgi-bin \? cache deny QUERY acl apache rep_header Server ^Apache broken_vary_encoding allow apache [root@debian14:~]# egrep -v "^#.*$|^ *$" /etc/squid/squid.conf | less ESCOA ESCOA ESCOA ... acl Safe_ports port 873 # rsync acl Safe_ports port 901 # SWAT acl purge method PURGE acl CONNECT method CONNECT http_access allow manager localhost http_access deny manager http_access allow purge localhost http_access deny purge http_access deny !Safe_ports http_access deny CONNECT !SSL_ports |
#egrep -v "^#.*$|^ *$" /etc/squid/squid.conf | cat -n
1 http_port 3128 2 hierarchy_stoplist cgi-bin ? 3 acl QUERY urlpath_regex cgi-bin \? 4 cache deny QUERY 5 acl apache rep_header Server ^Apache 6 broken_vary_encoding allow apache 7 access_log /var/log/squid/access.log squid 8 hosts_file /etc/hosts 9 refresh_pattern ^ftp: 1440 20% 10080 10 refresh_pattern ^gopher: 1440 0% 1440 ... 36 http_access allow purge localhost 37 http_access deny purge 38 http_access deny !Safe_ports 39 http_access deny CONNECT !SSL_ports 40 http_access allow localhost 41 http_access deny all 42 http_reply_access allow all 43 icp_access allow all 44 cache_effective_group proxy 45 coredump_dir /var/spool/squid |
#vim /etc/squid/squid.conf
--- /tmp/l3-saved-1632.26814.399 2009-08-14 18:57:17.000000000 +0300 +++ /etc/squid/squid.conf 2009-08-14 19:00:34.000000000 +0300 @@ -2575,6 +2575,8 @@ # be allowed #acl our_networks src 192.168.1.0/24 192.168.2.0/24 #http_access allow our_networks +acl our_net src 192.168.16.0/24 +http_access allow our_net http_access allow localhost # And finally deny all other access to this proxy |
#/etc/init.d/squid restart
Restarting Squid HTTP proxy: squid. |
#less /var/log/squid/access.log
|
#vim /etc/squid/squid.conf
|
#dig odnoklassniki.ru
![]() bash: dig: command not found |
#apt-get install mail.ru
![]() Чтение списков пакетов... Готово Построение дерева зависимостей... Готово E: Не могу найти пакет mail.ru |
#apt-get install dnsutils
![]() Чтение списков пакетов... Готово Построение дерева зависимостей... Готово Будут установлены следующие дополнительные пакеты: bind9-host libbind9-0 libdns22 libisc11 libisccc0 libisccfg1 liblwres9 Предлагаемые пакеты: rblcheck НОВЫЕ пакеты, которые будут установлены: bind9-host dnsutils libbind9-0 libdns22 libisc11 libisccc0 libisccfg1 liblwres9 обновлено 0, установлено 8 новых пакетов, для удаления отмечено 0 пакетов, и 55 пакетов не обновлено. Необходимо скачать 1342kБ архивов. ... 404 Not Found Не удалось загрузить http://debian.org.ua/debian/pool/main/b/bind9/libisc11_9.3.4-2etch3_i386.deb 404 Not Found Не удалось загрузить http://debian.org.ua/debian/pool/main/b/bind9/libdns22_9.3.4-2etch3_i386.deb 404 Not Found Не удалось загрузить http://debian.org.ua/debian/pool/main/b/bind9/libisccc0_9.3.4-2etch3_i386.deb 404 Not Found Не удалось загрузить http://debian.org.ua/debian/pool/main/b/bind9/libisccfg1_9.3.4-2etch3_i386.deb 404 Not Found Не удалось загрузить http://debian.org.ua/debian/pool/main/b/bind9/libbind9-0_9.3.4-2etch3_i386.deb 404 Not Found Не удалось загрузить http://debian.org.ua/debian/pool/main/b/bind9/liblwres9_9.3.4-2etch3_i386.deb 404 Not Found Не удалось загрузить http://debian.org.ua/debian/pool/main/b/bind9/bind9-host_9.3.4-2etch3_i386.deb 404 Not Found Не удалось загрузить http://debian.org.ua/debian/pool/main/b/bind9/dnsutils_9.3.4-2etch3_i386.deb 404 Not Found E: Невозможно загрузить некоторые архивы, вероятно надо запустить apt-get update или попытаться повторить запуск с ключом --fix-missing |
#sudo vim /etc/apt/sources.list
|
#apt-get update
[root@debian14:~]# apt-get install dnsutils Чтение списков пакетов... Готово Построение дерева зависимостей... Готово W: Не удалось получить атрибуты списка пакетов с исходными текстами http://10.0.35.1 etch/main Packages (/var/lib/apt/lists/10.0.35.1:9999_debian_dists_etch_main_binary-i386_Packages) - stat (2 No such file or directory) W: Не удалось получить атрибуты списка пакетов с исходными текстами http://10.0.35.1 etch/main Packages (/var/lib/apt/lists/10.0.35.1:9999_debian_dists_etch_main_binary-i386_Packages) - stat (2 No such file or directory) W: Вы можете запустить 'apt-get update' для исправления этих ошибок E: Не могу найти пакет dnsutils Получено:1 http://10.0.35.1 etch Release.gpg [1032B] Получено:2 http://10.0.35.1 etch Release [67,8kB] Ign http://10.0.35.1 etch Release Ign http://10.0.35.1 etch/main Packages Получено:3 http://10.0.35.1 etch/main Packages [5620kB] Получено 5689kB за 1s (3075kB/c) Чтение списков пакетов... Готово W: GPG error: http://10.0.35.1 etch Release: Следующие подписи не могут быть проверены, так как недоступен общий ключ: NO_PUBKEY 9AA38DCD55BE302B W: Вы можете запустить 'apt-get update' для исправления этих ошибок |
#gpg --keyserver pgpkeys.pca.dfn.de --recv-keys 9AA38DCD55BE302B
![]() gpg: directory `/root/.gnupg' created gpg: can't open `/gnupg/options.skel': No such file or directory gpg: keyring `/root/.gnupg/secring.gpg' created gpg: keyring `/root/.gnupg/pubring.gpg' created gpg: requesting key 55BE302B from hkp server pgpkeys.pca.dfn.de gpg: /root/.gnupg/trustdb.gpg: trustdb created gpg: key 55BE302B: public key "Debian Archive Automatic Signing Key (5.0/lenny) <ftpmaster@debian.org>" imported gpg: no ultimately trusted keys found gpg: Total number processed: 1 gpg: imported: 1 (RSA: 1) |
#apt-get update
[root@debian14:~]# gpg --export -a 9AA38DCD55BE302B| apt-key add - OK Получено:1 http://10.0.35.1 etch Release.gpg [1032B] В кэше http://10.0.35.1 etch Release Ign http://10.0.35.1 etch/main Packages/DiffIndex Ign http://10.0.35.1 etch/main Packages В кэше http://10.0.35.1 etch/main Packages Получено 1032B за 0s (1747B/c) Чтение списков пакетов... Готово |
#apt-get install dnsutils
Чтение списков пакетов... Готово Построение дерева зависимостей... Готово Будут установлены следующие дополнительные пакеты: bind9-host libbind9-0 libdns22 libisc11 libisccc0 libisccfg1 liblwres9 Предлагаемые пакеты: rblcheck НОВЫЕ пакеты, которые будут установлены: bind9-host dnsutils libbind9-0 libdns22 libisc11 libisccc0 libisccfg1 liblwres9 обновлено 0, установлено 8 новых пакетов, для удаления отмечено 0 пакетов, и 63 пакетов не обновлено. Необходимо скачать 1343kБ архивов. ... Выбор ранее не выбранного пакета dnsutils. Распаковывается пакет dnsutils (из файла .../dnsutils_1%3a9.3.4-2etch4_i386.deb)... Настраивается пакет libisc11 (9.3.4-2etch4) ... Настраивается пакет libdns22 (9.3.4-2etch4) ... Настраивается пакет libisccc0 (9.3.4-2etch4) ... Настраивается пакет libisccfg1 (9.3.4-2etch4) ... Настраивается пакет libbind9-0 (9.3.4-2etch4) ... Настраивается пакет liblwres9 (9.3.4-2etch4) ... Настраивается пакет bind9-host (9.3.4-2etch4) ... Настраивается пакет dnsutils (9.3.4-2etch4) ... |
#dig odnoklassniki.ru
; <<>> DiG 9.3.4-P1.1 <<>> odnoklassniki.ru ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 46951 ;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 3, ADDITIONAL: 0 ;; QUESTION SECTION: ;odnoklassniki.ru. IN A ;; ANSWER SECTION: odnoklassniki.ru. 3600 IN A 212.119.216.134 odnoklassniki.ru. 3600 IN A 62.105.140.210 odnoklassniki.ru. 3600 IN A 62.105.149.114 odnoklassniki.ru. 3600 IN A 212.44.136.194 ;; AUTHORITY SECTION: odnoklassniki.ru. 3600 IN NS ns.videogaga.ru. odnoklassniki.ru. 3600 IN NS ns.odnoklassniki.ru. odnoklassniki.ru. 3600 IN NS ns1.odnoklassniki.ru. ;; Query time: 174 msec ;; SERVER: 192.168.16.254#53(192.168.16.254) ;; WHEN: Fri Aug 14 19:26:07 2009 ;; MSG SIZE rcvd: 160 |
#dig @ns.odnoklassniki.ru odnoklassniki.ru a
; <<>> DiG 9.3.4-P1.1 <<>> @ns.odnoklassniki.ru odnoklassniki.ru a ; (1 server found) ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 9468 ;; flags: qr aa rd; QUERY: 1, ANSWER: 4, AUTHORITY: 3, ADDITIONAL: 3 ;; QUESTION SECTION: ;odnoklassniki.ru. IN A ;; ANSWER SECTION: odnoklassniki.ru. 3600 IN A 212.119.216.134 ... odnoklassniki.ru. 3600 IN NS ns.odnoklassniki.ru. odnoklassniki.ru. 3600 IN NS ns1.odnoklassniki.ru. ;; ADDITIONAL SECTION: ns.videogaga.ru. 300 IN A 212.119.200.146 ns.odnoklassniki.ru. 3600 IN A 217.106.230.130 ns1.odnoklassniki.ru. 3600 IN A 213.59.1.38 ;; Query time: 104 msec ;; SERVER: 217.106.230.130#53(217.106.230.130) ;; WHEN: Fri Aug 14 19:26:30 2009 ;; MSG SIZE rcvd: 208 |
#dig @ns.odnoklassniki.ru 1.
; <<>> DiG 9.3.4-P1.1 <<>> @ns.odnoklassniki.ru 1.odnoklassniki.ru a ; (1 server found) ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 10468 ;; flags: qr aa rd; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0 ;; QUESTION SECTION: ;1.odnoklassniki.ru. IN A ;; AUTHORITY SECTION: odnoklassniki.ru. 3600 IN SOA ns.odnoklassniki.ru. root.ns.odnoklassniki.ru. 2009081401 10800 1800 2419200 3600 ;; Query time: 110 msec ;; SERVER: 217.106.230.130#53(217.106.230.130) ;; WHEN: Fri Aug 14 19:26:36 2009 ;; MSG SIZE rcvd: 80 |
#dig @ns.odnoklassniki.ru
; <<>> DiG 9.3.4-P1.1 <<>> @ns.odnoklassniki.ru odnoklassniki.ru a ; (1 server found) ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 42853 ;; flags: qr aa rd; QUERY: 1, ANSWER: 4, AUTHORITY: 3, ADDITIONAL: 3 ;; QUESTION SECTION: ;odnoklassniki.ru. IN A ;; ANSWER SECTION: odnoklassniki.ru. 3600 IN A 212.44.136.194 ... odnoklassniki.ru. 3600 IN NS ns.odnoklassniki.ru. odnoklassniki.ru. 3600 IN NS ns1.odnoklassniki.ru. ;; ADDITIONAL SECTION: ns.videogaga.ru. 300 IN A 212.119.200.146 ns.odnoklassniki.ru. 3600 IN A 217.106.230.130 ns1.odnoklassniki.ru. 3600 IN A 213.59.1.38 ;; Query time: 111 msec ;; SERVER: 217.106.230.130#53(217.106.230.130) ;; WHEN: Fri Aug 14 19:26:40 2009 ;; MSG SIZE rcvd: 208 |
#dig @ns.odnoklassniki.ru axfr
; <<>> DiG 9.3.4-P1.1 <<>> @ns.odnoklassniki.ru axfr ; (1 server found) ;; global options: printcmd . 492656 IN NS A.ROOT-SERVERS.NET. . 492656 IN NS B.ROOT-SERVERS.NET. . 492656 IN NS C.ROOT-SERVERS.NET. . 492656 IN NS D.ROOT-SERVERS.NET. . 492656 IN NS E.ROOT-SERVERS.NET. . 492656 IN NS F.ROOT-SERVERS.NET. . 492656 IN NS G.ROOT-SERVERS.NET. ... G.ROOT-SERVERS.NET. 579056 IN A 192.112.36.4 H.ROOT-SERVERS.NET. 579056 IN A 128.63.2.53 H.ROOT-SERVERS.NET. 579056 IN AAAA 2001:500:1::803f:235 I.ROOT-SERVERS.NET. 579056 IN A 192.36.148.17 J.ROOT-SERVERS.NET. 579056 IN A 192.58.128.30 J.ROOT-SERVERS.NET. 579056 IN AAAA 2001:503:c27::2:30 ;; Query time: 110 msec ;; SERVER: 217.106.230.130#53(217.106.230.130) ;; WHEN: Fri Aug 14 19:26:47 2009 ;; MSG SIZE rcvd: 500 |
#dig @ns.odnoklassniki.ru odnoklassniki.ru axfr
; <<>> DiG 9.3.4-P1.1 <<>> @ns.odnoklassniki.ru odnoklassniki.ru axfr ; (1 server found) ;; global options: printcmd ; Transfer failed. |
#cd /usr/src/
|
#wget http://rejik.ru/download/redirector-3.2.1.tgz
--19:28:18-- http://rejik.ru/download/redirector-3.2.1.tgz => `redirector-3.2.1.tgz' Распознаётся rejik.ru... 62.109.4.16 Устанавливается соединение с rejik.ru|62.109.4.16|:80... соединение установлено. Запрос HTTP послан, ожидается ответ... 200 OK Длина: 46.022 (45K) [application/x-gzip] 100%[====================================================================>] 46.022 102.57K/s 19:28:20 (102.21 KB/s) - `redirector-3.2.1.tgz' сохранён [46022/46022] |
#tar xvzf
redirector-3.2.1/ redirector-3.2.1/tools/ redirector-3.2.1/tools/benchmark redirector-3.2.1/tools/IN.gz redirector-3.2.1/tools/kill-cache redirector-3.2.1/AUTHORS redirector-3.2.1/COPYING redirector-3.2.1/INSTALL redirector-3.2.1/Makefile redirector-3.2.1/VERSION ... redirector-3.2.1/prune_urls.c redirector-3.2.1/redirect.c redirector-3.2.1/redirector.c redirector-3.2.1/redirector.conf.dist redirector-3.2.1/run_make_cache.c redirector-3.2.1/vars.h redirector-3.2.1/write_cache.c redirector-3.2.1/raw_change.c redirector-3.2.1/pass.c redirector-3.2.1/Log |
#cd redirector-3.2.1
|
#ls
AUTHORS err_mes.c ip.c Makefile parse_urls.c redirect.c vars.h cache2url.c get_opt.c load_cache.c need_cache_update.c pass.c redirector.c VERSION check_urls.c id.c load_urls.c new_url.c pcre.c redirector.conf.dist write_cache.c comparing.c init_vars.c Log now.c prune_urls.c run_make_cache.c COPYING INSTALL make-cache.c parse_input.c raw_change.c tools |
#vim Makefile
|
#ps aux | grep squid
root 1842 0.0 0.1 4644 656 ? Ss 19:00 0:00 /usr/sbin/squid -D -sYC proxy 1844 0.0 0.9 7904 5584 ? S 19:00 0:00 (squid) -D -sYC root 2260 0.0 0.1 4620 740 ttyp4 R+ 19:30 0:00 grep squid |
#vim Makefile
|
#make
![]() rm -f pass.o raw_change.o load_cache.o pcre.o parse_input.o init_vars.o check_urls.o run_make_cache.o new_url.o redirect.o err_mes.o now.o get_opt.o parse_urls.o cache2url.o ip.o id.o comparing.o load_urls.o prune_urls.o write_cache.o need_cache_update.o err_mes.o now.o get_opt.o parse_urls.o cache2url.o ip.o id.o comparing.o redirector make-cache OUT gcc -Wall -I/usr/include -I/usr/local/include -I/usr/include/pcre -c pass.c In file included from pass.c:3: vars.h:2:18: error: pcre.h: No such file or directory In file included from pass.c:3: vars.h:142: error: expected specifier-qualifier-list before ‘pcre’ make: *** [pass.o] Ошибка 1 |
#. /etc/bash_completion
|
#apt-get install libpcre
![]() libpcre1-dev libpcre3 libpcrecpp0 libpcre-ocaml-dev libpcre2-dev libpcre3-dev libpcre-ocaml |
#apt-get install libpcre3-dev
Чтение списков пакетов... Готово Построение дерева зависимостей... Готово Будут установлены следующие дополнительные пакеты: libpcre3 libpcrecpp0 НОВЫЕ пакеты, которые будут установлены: libpcre3 libpcre3-dev libpcrecpp0 обновлено 0, установлено 3 новых пакетов, для удаления отмечено 0 пакетов, и 63 пакетов не обновлено. Необходимо скачать 534kБ архивов. После распаковки объем занятого дискового пространства возрастёт на 1036kB. Хотите продолжить [Д/н]? ... Выбор ранее не выбранного пакета libpcre3. (Чтение базы данных... на данный момент установлено 23754 файлов и каталогов.) Распаковывается пакет libpcre3 (из файла .../libpcre3_6.7+7.4-4_i386.deb)... Выбор ранее не выбранного пакета libpcrecpp0. Распаковывается пакет libpcrecpp0 (из файла .../libpcrecpp0_6.7+7.4-4_i386.deb)... Выбор ранее не выбранного пакета libpcre3-dev. Распаковывается пакет libpcre3-dev (из файла .../libpcre3-dev_6.7+7.4-4_i386.deb)... Настраивается пакет libpcre3 (6.7+7.4-4) ... Настраивается пакет libpcrecpp0 (6.7+7.4-4) ... Настраивается пакет libpcre3-dev (6.7+7.4-4) ... |
#make
rm -f pass.o raw_change.o load_cache.o pcre.o parse_input.o init_vars.o check_urls.o run_make_cache.o new_url.o redirect.o err_mes.o now.o get_opt.o parse_urls.o cache2url.o ip.o id.o comparing.o load_urls.o prune_urls.o write_cache.o need_cache_update.o err_mes.o now.o get_opt.o parse_urls.o cache2url.o ip.o id.o comparing.o redirector make-cache OUT gcc -Wall -I/usr/include -I/usr/local/include -I/usr/include/pcre -c pass.c gcc -Wall -I/usr/include -I/usr/local/include -I/usr/include/pcre -c raw_change.c raw_change.c: In function ‘raw_change’: raw_change.c:25: warning: pointer targets in passing argument 1 of ‘strstr’ differ in signedness raw_change.c:25: warning: pointer targets in passing argument 2 of ‘strstr’ differ in signedness raw_change.c:25: warning: pointer targets in assignment differ in signedness raw_change.c:33: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness raw_change.c:34: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness raw_change.c:35: warning: pointer targets in passing argument 1 of ‘strchr’ differ in signedness ... redirector.c:51: warning: pointer targets in passing argument 1 of ‘fopen’ differ in signedness redirector.c:53: warning: pointer targets in passing argument 1 of ‘sprintf’ differ in signedness redirector.c:54: warning: pointer targets in passing argument 1 of ‘printf’ differ in signedness redirector.c:69: warning: pointer targets in passing argument 1 of ‘fgets’ differ in signedness redirector.c:78: warning: pointer targets in passing argument 1 of ‘sprintf’ differ in signedness redirector.c:79: warning: pointer targets in passing argument 1 of ‘err_mes’ differ in signedness redirector.c:133: warning: pointer targets in passing argument 2 of ‘parse_urls’ differ in signedness redirector.c:136: warning: pointer targets in passing argument 1 of ‘sprintf’ differ in signedness redirector.c:137: warning: pointer targets in passing argument 1 of ‘err_mes’ differ in signedness gcc -Wall -I/usr/include -I/usr/local/include -I/usr/include/pcre -o make-cache make-cache.c -L/lib `pcre-config --libs` load_urls.o prune_urls.o write_cache.o need_cache_update.o err_mes.o now.o get_opt.o parse_urls.o cache2url.o ip.o id.o comparing.o |
#make install
mkdir -p /usr/local/rejik3/tools cp make-cache /usr/local/rejik3 cp redirector /usr/local/rejik3 cp redirector.conf.dist /usr/local/rejik3 echo "#!/bin/sh" > /usr/local/rejik3/tools/check-redirector echo 'su proxy -c "echo \"http://sex.ru 127.0.0.1/- - GET\" | /usr/local/rejik3/redirector /usr/local/rejik3/redirector.conf;"' >> /usr/local/rejik3/tools/check-redirector chmod 755 /usr/local/rejik3/tools/check-redirector echo "#!/bin/sh" > /usr/local/rejik3/tools/set-permissions echo 'chown -R proxy:proxy /usr/local/rejik3' >> /usr/local/rejik3/tools/set-permissions chmod 755 /usr/local/rejik3/tools/set-permissions cp tools/kill-cache /usr/local/rejik3/tools chmod 755 /usr/local/rejik3/tools/kill-cache cp tools/benchmark /usr/local/rejik3/tools chmod 755 /usr/local/rejik3/tools/benchmark cp tools/IN.gz /usr/local/rejik3/tools chmod 644 /usr/local/rejik3/tools/IN.gz chown -R proxy:proxy /usr/local/rejik3 chmod 770 /usr/local/rejik3 chmod 644 /usr/local/rejik3/redirector.conf.dist chmod 755 /usr/local/rejik3/redirector chmod 755 /usr/local/rejik3/make-cache |
#ls
[root@debian14:redirector-3.2.1]# cd /usr/local/rejik3/ make-cache redirector redirector.conf.dist tools |
#mv redirector.conf.dist redirector.conf
|
#ls
73 #allow_urls /usr/local/rejik3/banlists/allow_urls 74 75 <BANNER> 76 ban_dir /usr/local/rejik3/banlists/banners 77 url http://127.0.0.1/ban/1x1.gif 78 #log off 79 80 <PORNO> 81 ban_dir /usr/local/rejik3/banlists/porno 82 url http://127.0.0.1/ban/porno.html 83 84 <MP3> 85 ban_dir /usr/local/rejik3/banlists/mp3 86 url http://127.0.0.1/ban/mp3.html 87 88 <JS> 89 ban_dir /usr/local/rejik3/banlists/js 90 url http://127.0.0.1/ban/js.js make-cache redirector redirector.conf tools |
#ls
make-cache redirector redirector.conf tools |
#pwd
70 error_log /usr/local/rejik3/redirector.err 71 change_log /usr/local/rejik3/redirector.log 2 make-cache make-cache 73 #allow_urls /usr/local/rejik3/banlists/allow_urls 4 75 <BANNER> 6 ban_dir /usr/local/rejik3/banlists/banners 77 url http://127.0.0.1/ban/1x1.gif 78 #log off 79 ... url http://127.0.0.1/ban/1x1.gif 87 #log off 88 <PORNO> ban_dir /usr/local/rejik3/banlists/porno 89 url http://127.0.0.1/ban/porno.html 90 <MP3> ban_dir /usr/local/rejik3/banlists/mp3 91 url http://127.0.0.1/ban/mp3.html "redirector.conf" 96L, 3138C записано /usr/local/rejik3 |
#wget -c wget http://rejik.ru/download/banlists-2.x.x.tgz
--19:34:22-- http://wget/ => `index.html' Распознаётся wget... сбой: Name or service not known. --19:34:22-- http://rejik.ru/download/banlists-2.x.x.tgz => `banlists-2.x.x.tgz' Распознаётся rejik.ru... 62.109.4.16 Устанавливается соединение с rejik.ru|62.109.4.16|:80... соединение установлено. Запрос HTTP послан, ожидается ответ... 200 OK Длина: 116.100 (113K) [application/x-gzip] 100%[====================================================================>] 116.100 164.71K/s 19:34:25 (164.39 KB/s) - `banlists-2.x.x.tgz' сохранён [116100/116100] ЗАВЕРШЕНО --19:34:25-- Загружено: 116.100 байт в 1 файлах |
#tar xvzf banlists-2.x.x.tgz
banlists/ banlists/porno/ banlists/porno/urls banlists/banners/ banlists/banners/urls banlists/banners/pcre banlists/js/ banlists/js/urls banlists/mp3/ banlists/mp3/pcre |
#less banlists/porno/urls
|
#vim banlists/porno/urls
|
#vim banlists/mp3/pcre
--- /tmp/l3-saved-1632.20248.12529 2009-08-14 19:35:05.000000000 +0300 +++ banlists/mp3/pcre 2009-08-14 19:35:31.000000000 +0300 @@ -2,4 +2,4 @@ \.mp3([\W_]|$) \.avi([\W_]|$) \.wav([\W_]|$) -\.mpeg([\W_]|$) \ В конце файла нет новой строки +\.mpeg([\W_]|$) |
#apt-get install apache2
Module alias installed; run /etc/init.d/apache2 force-reload to enable. Module autoindex installed; run /etc/init.d/apache2 force-reload to enable. Module dir installed; run /etc/init.d/apache2 force-reload to enable. Module env installed; run /etc/init.d/apache2 force-reload to enable. Module mime installed; run /etc/init.d/apache2 force-reload to enable. Module negotiation installed; run /etc/init.d/apache2 force-reload to enable. Module setenvif installed; run /etc/init.d/apache2 force-reload to enable. Module status installed; run /etc/init.d/apache2 force-reload to enable. Module auth_basic installed; run /etc/init.d/apache2 force-reload to enable. Module authz_default installed; run /etc/init.d/apache2 force-reload to enable. Module authz_user installed; run /etc/init.d/apache2 force-reload to enable. Module authz_groupfile installed; run /etc/init.d/apache2 force-reload to enable. Module authn_file installed; run /etc/init.d/apache2 force-reload to enable. Module authz_host installed; run /etc/init.d/apache2 force-reload to enable. Настраивается пакет apache2-mpm-worker (2.2.3-4+etch6) ... Starting web server (apache2).... Настраивается пакет apache2 (2.2.3-4+etch6) ... |
#cd /var/www/
|
#wget http://rejik.ru/download/www.tgz
--19:36:44-- http://rejik.ru/download/www.tgz => `www.tgz' Распознаётся rejik.ru... 62.109.4.16 Устанавливается соединение с rejik.ru|62.109.4.16|:80... соединение установлено. Запрос HTTP послан, ожидается ответ... 200 OK Длина: 1.319 (1.3K) [application/x-gzip] 100%[====================================================================>] 1.319 --.--K/s 19:36:45 (139.77 MB/s) - `www.tgz' сохранён [1319/1319] |
#tar xvzf www.tgz
www/ www/1x1.gif www/js.js www/mp3.html www/porno.html www/cgi-bin/ www/cgi-bin/ban.cgi |
#cd -
/usr/local/rejik3 |
#echo $OLDPWD
/var/www |
#echo $
/usr/local/rejik3 |
#pwd
/usr/local/rejik3 |
#cd -
/var/www |
#echo $PWD
/var/www |
#echo $OLDPWD
/usr/local/rejik3 |
#cd -
/usr/local/rejik3 |
#echo $OLDPWD
/var/www |
#vim redirector.conf
|
#vim redirector.conf
|
#cd -
/var/www |
#ls -l
итого 4 drwxr-xr-x 2 root root 248 2009-08-14 19:36 apache2-default drwxr-xr-x 3 root root 176 2006-10-20 09:58 www -rw-r--r-- 1 root root 1319 2006-10-20 10:01 www.tgz |
#mv www ban
|
#cd -
/usr/local/rejik3 |
#vim redirector.conf
|
#vim /etc/squid/squid.conf
--- /tmp/l3-saved-1632.31741.21081 2009-08-14 19:39:35.000000000 +0300 +++ /etc/squid/squid.conf 2009-08-14 19:40:08.000000000 +0300 @@ -1460,6 +1460,7 @@ # By default, a URL rewriter is not used. # #Default: +url_rewrite_program /usr/local/rejik3/redirector /usr/local/rejik3/redirector.conf # none # TAG: url_rewrite_children |
#ls -l ../rejik3/
итого 204 drwxr-xr-x 6 nobody nogroup 144 2003-07-25 08:02 banlists -rw-r--r-- 1 root root 116100 2005-11-09 17:36 banlists-2.x.x.tgz -rwxr-xr-x 1 proxy proxy 39292 2009-08-14 19:32 make-cache -rwxr-xr-x 1 proxy proxy 44081 2009-08-14 19:32 redirector -rw-r--r-- 1 proxy proxy 3138 2009-08-14 19:34 redirector.conf drwxr-sr-x 2 proxy proxy 200 2009-08-14 19:32 tools |
#chown -R proxy:proxy ../rejik3/
|
#ls -l ../rejik3/
итого 204 drwxr-xr-x 6 proxy proxy 144 2003-07-25 08:02 banlists -rw-r--r-- 1 proxy proxy 116100 2005-11-09 17:36 banlists-2.x.x.tgz -rwxr-xr-x 1 proxy proxy 39292 2009-08-14 19:32 make-cache -rwxr-xr-x 1 proxy proxy 44081 2009-08-14 19:32 redirector -rw-r--r-- 1 proxy proxy 3138 2009-08-14 19:34 redirector.conf drwxr-sr-x 2 proxy proxy 200 2009-08-14 19:32 tools |
#vim /etc/squid/squid.conf
|
#/usr/local/rejik3/tools/check-redirector
78 #allow_urls /usr/local/rejik3/banlists/allow_urls 79 80 <BANNER> 81 ban_dir /usr/local/rejik3/banlists/banners 82 url http://127.0.0.1/ban/1x1.gif 83 #log off 84 85 <PORNO> 86 ban_dir /usr/local/rejik3/banlists/porno 87 url http://127.0.0.1/ban/porno.html 88 89 <MP3> 90 ban_dir /usr/local/rejik3/banlists/mp3 91 url http://127.0.0.1/ban/mp3.html 92 93 <JS> 94 ban_dir /usr/local/rejik3/banlists/js 95 url http://127.0.0.1/ban/js.js http://127.0.0.1/ban/porno.html 127.0.0.1/- - GET |
#/etc/init.d/squid restart
Restarting Squid HTTP proxy: squid. |
#grep -r AddDefaultCharset /etc/apache2/
/etc/apache2/mods-available/proxy.conf: AddDefaultCharset off /etc/apache2/conf.d/charset:AddDefaultCharset UTF-8 /etc/apache2/apache2.conf: #AddDefaultCharset ISO-8859-1 |
#vim /etc/apache2/mods-available/proxy.conf
|
#vim /etc/apache2/mods-available/proxy.conf
--- /tmp/l3-saved-1632.26397.14178 2009-08-14 19:44:59.000000000 +0300 +++ /etc/apache2/mods-available/proxy.conf 2009-08-14 19:45:07.000000000 +0300 @@ -5,7 +5,7 @@ ProxyRequests Off <Proxy *> - AddDefaultCharset od + AddDefaultCharset on Order deny,allow Deny from all #Allow from .example.com |
#/etc/init.d/apache2 restart
Forcing reload of web server (apache2)... waiting . |
#vim /etc/apache2/mods-available/proxy.conf
|
#grep -r AddDefaultCharset /etc/apache2/
/etc/apache2/mods-available/proxy.conf: AddDefaultCharset on /etc/apache2/conf.d/charset:AddDefaultCharset UTF-8 /etc/apache2/apache2.conf: #AddDefaultCharset ISO-8859-1 |
#vim /etc/apache2/apache2.conf
--- /tmp/l3-saved-1632.28048.22591 2009-08-14 19:46:25.000000000 +0300 +++ /etc/apache2/apache2.conf 2009-08-14 19:46:38.000000000 +0300 @@ -443,7 +443,7 @@ # reasons in browsers, related to javascript and URL parsing # which encourage you to always set a default char set. # - #AddDefaultCharset ISO-8859-1 +AddDefaultCharset on # # Commonly used filename extensions to character sets. You probably |
#/etc/init.d/apache2 restart
Forcing reload of web server (apache2)... waiting . |
#vim /etc/apache2/apache2.conf
--- /tmp/l3-saved-1632.28936.23238 2009-08-14 19:47:54.000000000 +0300 +++ /etc/apache2/apache2.conf 2009-08-14 19:48:55.000000000 +0300 @@ -443,7 +443,7 @@ # reasons in browsers, related to javascript and URL parsing # which encourage you to always set a default char set. # -AddDefaultCharset on +AddDefaultCharset off # # Commonly used filename extensions to character sets. You probably |
#/etc/init.d/apache2 restart
Forcing reload of web server (apache2)... waiting . |
#/etc/init.d/apache2 restart
Forcing reload of web server (apache2)... waiting . |
#ls /etc/apache2/
apache2.conf envvars mods-available ports.conf sites-enabled conf.d httpd.conf mods-enabled sites-available |
#vim /etc/apache2/httpd.conf
|
#vim /etc/apache2/httpd.conf
![]() |
#vim /usr/local/rejik3/banlists/porno/urls
--- /tmp/l3-saved-1632.30580.20163 2009-08-14 19:50:45.000000000 +0300 +++ /usr/local/rejik3/banlists/porno/urls 2009-08-14 19:50:52.000000000 +0300 @@ -1,3 +1,4 @@ +microsoft.com erwp.aslanova.ru antonvolkov.ru eroshop.com.ua |
#squid -k reconfigure
|
##
|
#. /etc/bash_completion
|
##apt-cache search squid
|
#apt-get install sarg
Чтение списков пакетов... Готово Построение дерева зависимостей... Готово Будут установлены следующие дополнительные пакеты: libgd2-noxpm Предлагаемые пакеты: libgd-tools squidguard libapache-mod-php4 НОВЫЕ пакеты, которые будут установлены: libgd2-noxpm sarg обновлено 0, установлено 2 новых пакетов, для удаления отмечено 0 пакетов, и 63 пакетов не обновлено. Необходимо скачать 521kБ архивов. ... Получено:1 http://10.0.35.1 etch/main libgd2-noxpm 2.0.33-5.2etch1 [197kB] Получено:2 http://10.0.35.1 etch/main sarg 2.2.2-1 [324kB] Получено 521kB за 1s (456kB/c) Выбор ранее не выбранного пакета libgd2-noxpm. (Чтение базы данных... на данный момент установлено 24381 файлов и каталогов.) Распаковывается пакет libgd2-noxpm (из файла .../libgd2-noxpm_2.0.33-5.2etch1_i386.deb)... Выбор ранее не выбранного пакета sarg. Распаковывается пакет sarg (из файла .../archives/sarg_2.2.2-1_i386.deb)... Настраивается пакет libgd2-noxpm (2.0.33-5.2etch1) ... Настраивается пакет sarg (2.2.2-1) ... |
#zless /usr/share/doc/sarg/README.Debian
|
# /usr/sbin/squid-reports
![]() bash: /usr/sbin/squid-reports: No such file or directory |
1 http_port 3128 2 hierarchy_stoplist cgi-bin ? 3 acl QUERY urlpath_regex cgi-bin \? 4 cache deny QUERY 5 acl apache rep_header Server ^Apache 6 broken_vary_encoding allow apache 7 access_log /var/log/squid/access.log squid 8 hosts_file /etc/hosts 9 refresh_pattern ^ftp: 1440 20% 10080 10 refresh_pattern ^gopher: 1440 0% 1440 11 refresh_pattern . 0 20% 4320 12 acl all src 0.0.0.0/0.0.0.0 13 acl manager proto cache_object 14 acl localhost src 127.0.0.1/255.255.255.255 15 acl to_localhost dst 127.0.0.0/8 16 acl SSL_ports port 443 # https 17 acl SSL_ports port 563 # snews 18 acl SSL_ports port 873 # rsync 19 acl Safe_ports port 80 # http 20 acl Safe_ports port 21 # ftp 21 acl Safe_ports port 443 # https 22 acl Safe_ports port 70 # gopher 23 acl Safe_ports port 210 # wais 24 acl Safe_ports port 1025-65535 # unregistered ports 25 acl Safe_ports port 280 # http-mgmt 26 acl Safe_ports port 488 # gss-http 27 acl Safe_ports port 591 # filemaker 28 acl Safe_ports port 777 # multiling http 29 acl Safe_ports port 631 # cups 30 acl Safe_ports port 873 # rsync 31 acl Safe_ports port 901 # SWAT 32 acl purge method PURGE 33 acl CONNECT method CONNECT 34 http_access allow manager localhost 35 http_access deny manager 36 http_access allow purge localhost 37 http_access deny purge 38 http_access deny !Safe_ports 39 http_access deny CONNECT !SSL_ports 40 http_access allow localhost 41 http_access deny all 42 http_reply_access allow all 43 icp_access allow all 44 cache_effective_group proxy 45 coredump_dir /var/spool/squid
Время первой команды журнала | 17:48:18 2009- 8-14 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 19:04:58 2009- 8-14 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 100 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 5.00 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 2.00 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 1.28 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 1.30 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|