LinuxForum.Fans
Тема

Squid+SAMS

Автор: Stum74 56 сообщений 17446 просмотров
#153077

Это я заметил кстати тоже. но та мнет сквида
[console]root@sams:/var/run# ls
acpid.pid apache2.pid crond.reboot mysqld portmap.pid rsyslogd.pid sm-notify.pid utmp
acpid.socket atd.pid exim4 ntpd.pid postgresql samsdaemon.pid sshd
apache2 crond.pid motd portmap_mapping rpc.statd.pid sams.pid sshd.pid
root@sams:/var/run#
[/console]

и еще. я в очередной раз перезагрузил машину и у меня в очередной раз не поднялся сквид. я думаю как раз из за подобных вещей.
[console]Last login: Tue Apr 19 14:45:31 2011 from 172.21.2.23
root@sams:~# ps -aux | grep sams
Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html
root 1574 0.0 0.0 4816 860 ? S 16:53 0:00 /usr/local/bin/ samsdaemon
root 1629 0.0 0.0 3324 764 pts/0 R+ 16:57 0:00 grep sams
root@sams:~# ps -aux | grep sams
Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html
root 1574 0.0 0.0 4816 860 ? S 16:53 0:00 /usr/local/bin/samsdaemon
root 1631 0.0 0.0 3324 768 pts/0 R+ 16:57 0:00 grep sams
root@sams:~# squid start
root@sams:~# ps -aux | grep sams
Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html
root 1574 0.0 0.0 4816 860 ? S 16:53 0:00 /usr/local/bin/samsdaemon
proxy 1637 0.0 0.0 2052 500 ? S 16:57 0:00 (ncsa_auth) /etc/squid/ncsa.sams
proxy 1638 0.0 0.0 2052 504 ? S 16:57 0:00 (ncsa_auth) /etc/squid/ncsa.sams
proxy 1639 0.0 0.0 2052 504 ? S 16:57 0:00 (ncsa_auth) /etc/squid/ncsa.sams
proxy 1640 0.0 0.0 2052 496 ? S 16:57 0:00 (ncsa_auth) /etc/squid/ncsa.sams
proxy 1641 0.0 0.0 2052 496 ? S 16:57 0:00 (ncsa_auth) /etc/squid/ncsa.sams
root 1644 0.0 0.0 3324 776 pts/0 S+ 16:58 0:00 grep sams
root@sams:~# chkconfig --list squid
squid 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[/console]

То есть. когда машина воднялась после раебута. прокси не работет. когда я стартанул сквид вручную. прокси работает. но старт прокси никаких ошибок не выдает. но всеже почемуто не стартует при включении машины.
[console]Apr 19 16:04:17 sams samslogparser[3571]: Disable user test traffic 22138463>10485760
Apr 19 16:04:17 sams samslogparser[3571]: Send message to admin. script /usr/local/share/sams/src/script/none
Apr 19 16:04:17 sams samsdaemon[1216]: Reading request to reconfigure SQUID
Apr 19 16:04:17 sams kernel: [26608.633254] samsdaemon[1216]: segfault at 72617633 ip b741f59a sp bfb1f8bc error 4 in libc-2.11.2.so[b73b4000+140000]
Apr 19 16:57:56 sams squid[1633]: Squid Parent: child process 1635 started[/console]

#153083

В конфиге сквида поправте строку

text
pid_filename /var/run/squid/squid.pid

на

text
pid_filename /var/run/squid.pid

И перезапустите сквид. Посмотрите на последние строки в cache.log нет ли там после этого ошыбки доступа к squid.pid файлу.
Сначала нуна сквид настроить чтобы работал без ошыбок, а потом с остальным разбирёмся. wink

#153086
kisil написал:
У вас от какого пользователя Сквид запускаетса. Процес не может создать pid файл в дериктории. Проверте права.
И ещё. В cache.log есть ошыбки нащот отсутствие в базе таблицы. Вы верно создали базу??
text
mysql_real_connect() error 4. no open database squidctrl, DELAY 3 sec

Кстати имя пользователя и групи от имени которых должен работать Сквид задаётса в его конфиге.

Базу я создал по мануалу с оф сайта

Показать

Создание БД:
Для работы SAMS необходимо создать пользователя sams в БД MySQL:

mysql -u root -p
GRANT ALL ON squidctrl.* TO sams@localhost IDENTIFIED BY "yourpassword";
GRANT ALL ON squidlog.* TO sams@localhost IDENTIFIED BY "yourpassword";

Где:

yourpassword - пароль

После этого имя пользователя и пароль надо сохранить в файле конфигурации SAMS /etc/sams.conf:

MYSQLUSER=sams - Имя пользователя MySQL, от имени которого будет работать SAMS
MYSQLPASSWORD=yourpasswd - Пароль пользователя в MySQL

Создаем базы SAMS в MySQL
Для этого перемещаемся в каталог ./mysql и там даем команды:

cd ./mysql
mysql -u root -p < sams_db.sql
mysql -u root -p < squid_db.sql

А на счет групы запуска процеса сквид. я конфиг сквида выложил в первом посте. просто у моего знакомого конфиг брал и у нег овсе работает.

#153088

Хорошо.

Как нащот этого

kisil написал:
В конфиге сквида поправте строку
text
pid_filename /var/run/squid/squid.pid

на

text
pid_filename /var/run/squid.pid

И перезапустите сквид. Посмотрите на последние строки в cache.log нет ли там после этого ошыбки доступа к squid.pid файлу.
Сначала нуна сквид настроить чтобы работал без ошыбок, а потом с остальным разбирёмся. wink

#153089
kisil написал:
В конфиге сквида поправте строку
text
pid_filename /var/run/squid/squid.pid

на

text
pid_filename /var/run/squid.pid

И перезапустите сквид. Посмотрите на последние строки в cache.log нет ли там после этого ошыбки доступа к squid.pid файлу.
Сначала нуна сквид настроить чтобы работал без ошыбок, а потом с остальным разбирёмся. wink

Ya wol'. но и в /var/run/ нет squid.pid

Показать

2011/04/19 17:21:03| Starting Squid Cache version 2.7.STABLE9 for i386-debian-linux-gnu...
2011/04/19 17:21:03| Process ID 1740
2011/04/19 17:21:03| With 1024 file descriptors available
2011/04/19 17:21:03| Using epoll for the IO loop
2011/04/19 17:21:03| Performing DNS Tests...
2011/04/19 17:21:03| Successful DNS name lookup tests...
2011/04/19 17:21:03| DNS Socket created at 0.0.0.0, port 35641, FD 6
2011/04/19 17:21:03| Adding domain system.lan from /etc/resolv.conf
2011/04/19 17:21:03| Adding domain system.lan from /etc/resolv.conf
2011/04/19 17:21:03| Adding nameserver 172.21.2.101 from /etc/resolv.conf
2011/04/19 17:21:03| helperOpenServers: Starting 5 'ncsa_auth' processes
2011/04/19 17:21:03| User-Agent logging is disabled.
2011/04/19 17:21:03| Referer logging is disabled.
2011/04/19 17:21:03| logfileOpen: opening log /var/log/squid/access.log
2011/04/19 17:21:03| Unlinkd pipe opened on FD 16
2011/04/19 17:21:03| Swap maxSize 102400 + 8192 KB, estimated 8507 objects
2011/04/19 17:21:03| Target number of buckets: 425
2011/04/19 17:21:03| Using 8192 Store buckets
2011/04/19 17:21:03| Max Mem size: 8192 KB
2011/04/19 17:21:03| Max Swap size: 102400 KB
2011/04/19 17:21:03| Local cache digest enabled; rebuild/rewrite every 3600/3600 sec
2011/04/19 17:21:03| logfileOpen: opening log /var/log/squid/store.log
2011/04/19 17:21:03| Rebuilding storage in /var/spool/squid (DIRTY)
2011/04/19 17:21:03| Using Least Load store dir selection
2011/04/19 17:21:03| Current Directory is /var/run
2011/04/19 17:21:03| Loaded Icons.
2011/04/19 17:21:03| commBind: Cannot bind socket FD 18 to 172.21.2.68:3128: (98) Address already in use
FATAL: Cannot open HTTP Port
Squid Cache (Version 2.7.STABLE9): Terminated abnormally.
CPU Usage: 0.012 seconds = 0.000 user + 0.012 sys
Maximum Resident Size: 18896 KB
Page faults with physical i/o: 0
Memory usage for squid via mallinfo():
total space in arena: 2112 KB
Ordinary blocks: 2063 KB 2 blks
Small blocks: 0 KB 1 blks
Holding blocks: 280 KB 1 blks
Free Small blocks: 0 KB
Free Ordinary blocks: 48 KB
Total in use: 2343 KB 98%
Total free: 48 KB 2%
2011/04/19 17:21:06| Starting Squid Cache version 2.7.STABLE9 for i386-debian-linux-gnu...
2011/04/19 17:21:06| Process ID 1749
2011/04/19 17:21:06| With 1024 file descriptors available
2011/04/19 17:21:06| Using epoll for the IO loop
2011/04/19 17:21:06| Performing DNS Tests...
2011/04/19 17:21:06| Successful DNS name lookup tests...
2011/04/19 17:21:06| DNS Socket created at 0.0.0.0, port 54348, FD 6
2011/04/19 17:21:06| Adding domain system.lan from /etc/resolv.conf
2011/04/19 17:21:06| Adding domain system.lan from /etc/resolv.conf
2011/04/19 17:21:06| Adding nameserver 172.21.2.101 from /etc/resolv.conf
2011/04/19 17:21:06| helperOpenServers: Starting 5 'ncsa_auth' processes
2011/04/19 17:21:06| User-Agent logging is disabled.
2011/04/19 17:21:06| Referer logging is disabled.
2011/04/19 17:21:06| logfileOpen: opening log /var/log/squid/access.log
2011/04/19 17:21:06| Unlinkd pipe opened on FD 16
2011/04/19 17:21:06| Swap maxSize 102400 + 8192 KB, estimated 8507 objects
2011/04/19 17:21:06| Target number of buckets: 425
2011/04/19 17:21:06| Using 8192 Store buckets
2011/04/19 17:21:06| Max Mem size: 8192 KB
2011/04/19 17:21:06| Max Swap size: 102400 KB
2011/04/19 17:21:06| Local cache digest enabled; rebuild/rewrite every 3600/3600 sec
2011/04/19 17:21:06| logfileOpen: opening log /var/log/squid/store.log
2011/04/19 17:21:06| Rebuilding storage in /var/spool/squid (DIRTY)
2011/04/19 17:21:06| Using Least Load store dir selection
2011/04/19 17:21:06| Current Directory is /var/run
2011/04/19 17:21:06| Loaded Icons.
2011/04/19 17:21:06| commBind: Cannot bind socket FD 18 to 172.21.2.68:3128: (98) Address already in use
FATAL: Cannot open HTTP Port
Squid Cache (Version 2.7.STABLE9): Terminated abnormally.
CPU Usage: 0.008 seconds = 0.000 user + 0.008 sys
Maximum Resident Size: 18896 KB
Page faults with physical i/o: 0
Memory usage for squid via mallinfo():
total space in arena: 2112 KB
Ordinary blocks: 2063 KB 2 blks
Small blocks: 0 KB 1 blks
Holding blocks: 280 KB 1 blks
Free Small blocks: 0 KB
Free Ordinary blocks: 48 KB
Total in use: 2343 KB 98%
Total free: 48 KB 2%
2011/04/19 17:21:09| Starting Squid Cache version 2.7.STABLE9 for i386-debian-linux-gnu...
2011/04/19 17:21:09| Process ID 1759
2011/04/19 17:21:09| With 1024 file descriptors available
2011/04/19 17:21:09| Using epoll for the IO loop
2011/04/19 17:21:09| Performing DNS Tests...
2011/04/19 17:21:09| Successful DNS name lookup tests...
2011/04/19 17:21:09| DNS Socket created at 0.0.0.0, port 58859, FD 6
2011/04/19 17:21:09| Adding domain system.lan from /etc/resolv.conf
2011/04/19 17:21:09| Adding domain system.lan from /etc/resolv.conf
2011/04/19 17:21:09| Adding nameserver 172.21.2.101 from /etc/resolv.conf
2011/04/19 17:21:09| helperOpenServers: Starting 5 'ncsa_auth' processes
2011/04/19 17:21:09| User-Agent logging is disabled.
2011/04/19 17:21:09| Referer logging is disabled.
2011/04/19 17:21:09| logfileOpen: opening log /var/log/squid/access.log
2011/04/19 17:21:09| Unlinkd pipe opened on FD 16
2011/04/19 17:21:09| Swap maxSize 102400 + 8192 KB, estimated 8507 objects
2011/04/19 17:21:09| Target number of buckets: 425
2011/04/19 17:21:09| Using 8192 Store buckets
2011/04/19 17:21:09| Max Mem size: 8192 KB
2011/04/19 17:21:09| Max Swap size: 102400 KB
2011/04/19 17:21:09| Local cache digest enabled; rebuild/rewrite every 3600/3600 sec
2011/04/19 17:21:09| logfileOpen: opening log /var/log/squid/store.log
2011/04/19 17:21:09| Rebuilding storage in /var/spool/squid (DIRTY)
2011/04/19 17:21:09| Using Least Load store dir selection
2011/04/19 17:21:09| Current Directory is /var/run
2011/04/19 17:21:09| Loaded Icons.
2011/04/19 17:21:09| commBind: Cannot bind socket FD 18 to 172.21.2.68:3128: (98) Address already in use
FATAL: Cannot open HTTP Port
Squid Cache (Version 2.7.STABLE9): Terminated abnormally.
CPU Usage: 0.008 seconds = 0.000 user + 0.008 sys
Maximum Resident Size: 18896 KB
Page faults with physical i/o: 0
Memory usage for squid via mallinfo():
total space in arena: 2112 KB
Ordinary blocks: 2063 KB 2 blks
Small blocks: 0 KB 1 blks
Holding blocks: 280 KB 1 blks
Free Small blocks: 0 KB
Free Ordinary blocks: 48 KB
Total in use: 2343 KB 98%
Total free: 48 KB 2%
2011/04/19 17:21:09| Starting Squid Cache version 2.7.STABLE9 for i386-debian-linux-gnu...
2011/04/19 17:21:09| Process ID 1767
2011/04/19 17:21:09| With 1024 file descriptors available
2011/04/19 17:21:09| Using epoll for the IO loop
2011/04/19 17:21:09| Performing DNS Tests...
2011/04/19 17:21:09| Successful DNS name lookup tests...
2011/04/19 17:21:09| DNS Socket created at 0.0.0.0, port 36607, FD 6
2011/04/19 17:21:09| Adding domain system.lan from /etc/resolv.conf
2011/04/19 17:21:09| Adding domain system.lan from /etc/resolv.conf
2011/04/19 17:21:09| Adding nameserver 172.21.2.101 from /etc/resolv.conf
2011/04/19 17:21:09| helperOpenServers: Starting 5 'ncsa_auth' processes
2011/04/19 17:21:09| User-Agent logging is disabled.
2011/04/19 17:21:09| Referer logging is disabled.
2011/04/19 17:21:09| logfileOpen: opening log /var/log/squid/access.log
2011/04/19 17:21:09| Unlinkd pipe opened on FD 16
2011/04/19 17:21:09| Swap maxSize 102400 + 8192 KB, estimated 8507 objects
2011/04/19 17:21:09| Target number of buckets: 425
2011/04/19 17:21:09| Using 8192 Store buckets
2011/04/19 17:21:09| Max Mem size: 8192 KB
2011/04/19 17:21:09| Max Swap size: 102400 KB
2011/04/19 17:21:09| Local cache digest enabled; rebuild/rewrite every 3600/3600 sec
2011/04/19 17:21:09| logfileOpen: opening log /var/log/squid/store.log
2011/04/19 17:21:09| Rebuilding storage in /var/spool/squid (DIRTY)
2011/04/19 17:21:09| Using Least Load store dir selection
2011/04/19 17:21:09| Current Directory is /var/run
2011/04/19 17:21:09| Loaded Icons.
2011/04/19 17:21:09| commBind: Cannot bind socket FD 18 to 172.21.2.68:3128: (98) Address already in use
FATAL: Cannot open HTTP Port
Squid Cache (Version 2.7.STABLE9): Terminated abnormally.
CPU Usage: 0.008 seconds = 0.000 user + 0.008 sys
Maximum Resident Size: 18912 KB
Page faults with physical i/o: 0
Memory usage for squid via mallinfo():
total space in arena: 2112 KB
Ordinary blocks: 2063 KB 2 blks
Small blocks: 0 KB 1 blks
Holding blocks: 280 KB 1 blks
Free Small blocks: 0 KB
Free Ordinary blocks: 48 KB
Total in use: 2343 KB 98%
Total free: 48 KB 2%
2011/04/19 17:21:12| Starting Squid Cache version 2.7.STABLE9 for i386-debian-linux-gnu...
2011/04/19 17:21:12| Process ID 1775
2011/04/19 17:21:12| With 1024 file descriptors available
2011/04/19 17:21:12| Using epoll for the IO loop
2011/04/19 17:21:12| Performing DNS Tests...
2011/04/19 17:21:12| Successful DNS name lookup tests...
2011/04/19 17:21:12| DNS Socket created at 0.0.0.0, port 37730, FD 6
2011/04/19 17:21:12| Adding domain system.lan from /etc/resolv.conf
2011/04/19 17:21:12| Adding domain system.lan from /etc/resolv.conf
2011/04/19 17:21:12| Adding nameserver 172.21.2.101 from /etc/resolv.conf
2011/04/19 17:21:12| helperOpenServers: Starting 5 'ncsa_auth' processes
2011/04/19 17:21:12| User-Agent logging is disabled.
2011/04/19 17:21:12| Referer logging is disabled.
2011/04/19 17:21:12| logfileOpen: opening log /var/log/squid/access.log
2011/04/19 17:21:12| Unlinkd pipe opened on FD 16
2011/04/19 17:21:12| Swap maxSize 102400 + 8192 KB, estimated 8507 objects
2011/04/19 17:21:12| Target number of buckets: 425
2011/04/19 17:21:12| Using 8192 Store buckets
2011/04/19 17:21:12| Max Mem size: 8192 KB
2011/04/19 17:21:12| Max Swap size: 102400 KB
2011/04/19 17:21:12| Local cache digest enabled; rebuild/rewrite every 3600/3600 sec
2011/04/19 17:21:12| logfileOpen: opening log /var/log/squid/store.log
2011/04/19 17:21:12| Rebuilding storage in /var/spool/squid (DIRTY)
2011/04/19 17:21:12| Using Least Load store dir selection
2011/04/19 17:21:12| Current Directory is /var/run
2011/04/19 17:21:12| Loaded Icons.
2011/04/19 17:21:12| commBind: Cannot bind socket FD 18 to 172.21.2.68:3128: (98) Address already in use
FATAL: Cannot open HTTP Port
Squid Cache (Version 2.7.STABLE9): Terminated abnormally.
CPU Usage: 0.008 seconds = 0.008 user + 0.000 sys
Maximum Resident Size: 18880 KB
Page faults with physical i/o: 0
Memory usage for squid via mallinfo():
total space in arena: 2112 KB
Ordinary blocks: 2063 KB 2 blks
Small blocks: 0 KB 1 blks
Holding blocks: 280 KB 1 blks
Free Small blocks: 0 KB
Free Ordinary blocks: 48 KB
Total in use: 2343 KB 98%
Total free: 48 KB 2%
2011/04/19 17:21:12| Starting Squid Cache version 2.7.STABLE9 for i386-debian-linux-gnu...
2011/04/19 17:21:12| Process ID 1783
2011/04/19 17:21:12| With 1024 file descriptors available
2011/04/19 17:21:12| Using epoll for the IO loop
2011/04/19 17:21:12| Performing DNS Tests...
2011/04/19 17:21:12| Successful DNS name lookup tests...
2011/04/19 17:21:12| DNS Socket created at 0.0.0.0, port 49747, FD 6
2011/04/19 17:21:12| Adding domain system.lan from /etc/resolv.conf
2011/04/19 17:21:12| Adding domain system.lan from /etc/resolv.conf
2011/04/19 17:21:12| Adding nameserver 172.21.2.101 from /etc/resolv.conf
2011/04/19 17:21:12| helperOpenServers: Starting 5 'ncsa_auth' processes
2011/04/19 17:21:12| User-Agent logging is disabled.
2011/04/19 17:21:12| Referer logging is disabled.
2011/04/19 17:21:12| logfileOpen: opening log /var/log/squid/access.log
2011/04/19 17:21:12| Unlinkd pipe opened on FD 16
2011/04/19 17:21:12| Swap maxSize 102400 + 8192 KB, estimated 8507 objects
2011/04/19 17:21:12| Target number of buckets: 425
2011/04/19 17:21:12| Using 8192 Store buckets
2011/04/19 17:21:12| Max Mem size: 8192 KB
2011/04/19 17:21:12| Max Swap size: 102400 KB
2011/04/19 17:21:12| Local cache digest enabled; rebuild/rewrite every 3600/3600 sec
2011/04/19 17:21:12| logfileOpen: opening log /var/log/squid/store.log
2011/04/19 17:21:12| Rebuilding storage in /var/spool/squid (DIRTY)
2011/04/19 17:21:12| Using Least Load store dir selection
2011/04/19 17:21:12| Current Directory is /var/run
2011/04/19 17:21:12| Loaded Icons.
2011/04/19 17:21:13| commBind: Cannot bind socket FD 18 to 172.21.2.68:3128: (98) Address already in use
FATAL: Cannot open HTTP Port
Squid Cache (Version 2.7.STABLE9): Terminated abnormally.
CPU Usage: 0.008 seconds = 0.000 user + 0.008 sys
Maximum Resident Size: 18880 KB
Page faults with physical i/o: 0
Memory usage for squid via mallinfo():
total space in arena: 2112 KB
Ordinary blocks: 2063 KB 2 blks
Small blocks: 0 KB 1 blks
Holding blocks: 280 KB 1 blks
Free Small blocks: 0 KB
Free Ordinary blocks: 48 KB
Total in use: 2343 KB 98%
Total free: 48 KB 2%
2011/04/19 17:21:15| Starting Squid Cache version 2.7.STABLE9 for i386-debian-linux-gnu...
2011/04/19 17:21:15| Process ID 1791
2011/04/19 17:21:15| With 1024 file descriptors available
2011/04/19 17:21:15| Using epoll for the IO loop
2011/04/19 17:21:15| Performing DNS Tests...
2011/04/19 17:21:15| Successful DNS name lookup tests...
2011/04/19 17:21:15| DNS Socket created at 0.0.0.0, port 60670, FD 6
2011/04/19 17:21:15| Adding domain system.lan from /etc/resolv.conf
2011/04/19 17:21:15| Adding domain system.lan from /etc/resolv.conf
2011/04/19 17:21:15| Adding nameserver 172.21.2.101 from /etc/resolv.conf
2011/04/19 17:21:15| helperOpenServers: Starting 5 'ncsa_auth' processes
2011/04/19 17:21:15| User-Agent logging is disabled.
2011/04/19 17:21:15| Referer logging is disabled.
2011/04/19 17:21:15| logfileOpen: opening log /var/log/squid/access.log
2011/04/19 17:21:15| Unlinkd pipe opened on FD 16
2011/04/19 17:21:15| Swap maxSize 102400 + 8192 KB, estimated 8507 objects
2011/04/19 17:21:15| Target number of buckets: 425
2011/04/19 17:21:15| Using 8192 Store buckets
2011/04/19 17:21:15| Max Mem size: 8192 KB
2011/04/19 17:21:15| Max Swap size: 102400 KB
2011/04/19 17:21:15| Local cache digest enabled; rebuild/rewrite every 3600/3600 sec
2011/04/19 17:21:15| logfileOpen: opening log /var/log/squid/store.log
2011/04/19 17:21:15| Rebuilding storage in /var/spool/squid (DIRTY)
2011/04/19 17:21:15| Using Least Load store dir selection
2011/04/19 17:21:15| Current Directory is /var/run
2011/04/19 17:21:15| Loaded Icons.
2011/04/19 17:21:15| commBind: Cannot bind socket FD 18 to 172.21.2.68:3128: (98) Address already in use
FATAL: Cannot open HTTP Port
Squid Cache (Version 2.7.STABLE9): Terminated abnormally.
CPU Usage: 0.008 seconds = 0.008 user + 0.000 sys
Maximum Resident Size: 18912 KB
Page faults with physical i/o: 0
Memory usage for squid via mallinfo():
total space in arena: 2112 KB
Ordinary blocks: 2063 KB 2 blks
Small blocks: 0 KB 1 blks
Holding blocks: 280 KB 1 blks
Free Small blocks: 0 KB
Free Ordinary blocks: 48 KB
Total in use: 2343 KB 98%
Total free: 48 KB 2%
2011/04/19 17:21:16| Starting Squid Cache version 2.7.STABLE9 for i386-debian-linux-gnu...
2011/04/19 17:21:16| Process ID 1799
2011/04/19 17:21:16| With 1024 file descriptors available
2011/04/19 17:21:16| Using epoll for the IO loop
2011/04/19 17:21:16| Performing DNS Tests...
2011/04/19 17:21:16| Successful DNS name lookup tests...
2011/04/19 17:21:16| DNS Socket created at 0.0.0.0, port 54316, FD 6
2011/04/19 17:21:16| Adding domain system.lan from /etc/resolv.conf
2011/04/19 17:21:16| Adding domain system.lan from /etc/resolv.conf
2011/04/19 17:21:16| Adding nameserver 172.21.2.101 from /etc/resolv.conf
2011/04/19 17:21:16| helperOpenServers: Starting 5 'ncsa_auth' processes
2011/04/19 17:21:16| User-Agent logging is disabled.
2011/04/19 17:21:16| Referer logging is disabled.
2011/04/19 17:21:16| logfileOpen: opening log /var/log/squid/access.log
2011/04/19 17:21:16| Unlinkd pipe opened on FD 16
2011/04/19 17:21:16| Swap maxSize 102400 + 8192 KB, estimated 8507 objects
2011/04/19 17:21:16| Target number of buckets: 425
2011/04/19 17:21:16| Using 8192 Store buckets
2011/04/19 17:21:16| Max Mem size: 8192 KB
2011/04/19 17:21:16| Max Swap size: 102400 KB
2011/04/19 17:21:16| Local cache digest enabled; rebuild/rewrite every 3600/3600 sec
2011/04/19 17:21:16| logfileOpen: opening log /var/log/squid/store.log
2011/04/19 17:21:16| Rebuilding storage in /var/spool/squid (DIRTY)
2011/04/19 17:21:16| Using Least Load store dir selection
2011/04/19 17:21:16| Current Directory is /var/run
2011/04/19 17:21:16| Loaded Icons.
2011/04/19 17:21:16| commBind: Cannot bind socket FD 18 to 172.21.2.68:3128: (98) Address already in use
FATAL: Cannot open HTTP Port
Squid Cache (Version 2.7.STABLE9): Terminated abnormally.
CPU Usage: 0.008 seconds = 0.000 user + 0.008 sys
Maximum Resident Size: 18880 KB
Page faults with physical i/o: 0
Memory usage for squid via mallinfo():
total space in arena: 2112 KB
Ordinary blocks: 2063 KB 2 blks
Small blocks: 0 KB 1 blks
Holding blocks: 280 KB 1 blks
Free Small blocks: 0 KB
Free Ordinary blocks: 48 KB
Total in use: 2343 KB 98%
Total free: 48 KB 2%
2011/04/19 17:21:18| Starting Squid Cache version 2.7.STABLE9 for i386-debian-linux-gnu...
2011/04/19 17:21:18| Process ID 1807
2011/04/19 17:21:18| With 1024 file descriptors available
2011/04/19 17:21:18| Using epoll for the IO loop
2011/04/19 17:21:18| Performing DNS Tests...
2011/04/19 17:21:18| Successful DNS name lookup tests...
2011/04/19 17:21:18| DNS Socket created at 0.0.0.0, port 55557, FD 6
2011/04/19 17:21:18| Adding domain system.lan from /etc/resolv.conf
2011/04/19 17:21:18| Adding domain system.lan from /etc/resolv.conf
2011/04/19 17:21:18| Adding nameserver 172.21.2.101 from /etc/resolv.conf
2011/04/19 17:21:18| helperOpenServers: Starting 5 'ncsa_auth' processes
2011/04/19 17:21:18| User-Agent logging is disabled.
2011/04/19 17:21:18| Referer logging is disabled.
2011/04/19 17:21:18| logfileOpen: opening log /var/log/squid/access.log
2011/04/19 17:21:18| Unlinkd pipe opened on FD 16
2011/04/19 17:21:18| Swap maxSize 102400 + 8192 KB, estimated 8507 objects
2011/04/19 17:21:18| Target number of buckets: 425
2011/04/19 17:21:18| Using 8192 Store buckets
2011/04/19 17:21:18| Max Mem size: 8192 KB
2011/04/19 17:21:18| Max Swap size: 102400 KB
2011/04/19 17:21:18| Local cache digest enabled; rebuild/rewrite every 3600/3600 sec
2011/04/19 17:21:18| logfileOpen: opening log /var/log/squid/store.log
2011/04/19 17:21:18| Rebuilding storage in /var/spool/squid (DIRTY)
2011/04/19 17:21:18| Using Least Load store dir selection
2011/04/19 17:21:18| Current Directory is /var/run
2011/04/19 17:21:18| Loaded Icons.
2011/04/19 17:21:19| commBind: Cannot bind socket FD 18 to 172.21.2.68:3128: (98) Address already in use
FATAL: Cannot open HTTP Port
Squid Cache (Version 2.7.STABLE9): Terminated abnormally.
CPU Usage: 0.008 seconds = 0.000 user + 0.008 sys
Maximum Resident Size: 18880 KB
Page faults with physical i/o: 0
Memory usage for squid via mallinfo():
total space in arena: 2112 KB
Ordinary blocks: 2063 KB 2 blks
Small blocks: 0 KB 1 blks
Holding blocks: 280 KB 1 blks
Free Small blocks: 0 KB
Free Ordinary blocks: 48 KB
Total in use: 2343 KB 98%
Total free: 48 KB 2%
2011/04/19 17:21:22| Starting Squid Cache version 2.7.STABLE9 for i386-debian-linux-gnu...
2011/04/19 17:21:22| Process ID 1815
2011/04/19 17:21:22| With 1024 file descriptors available
2011/04/19 17:21:22| Using epoll for the IO loop
2011/04/19 17:21:22| Performing DNS Tests...
2011/04/19 17:21:22| Successful DNS name lookup tests...
2011/04/19 17:21:22| DNS Socket created at 0.0.0.0, port 57987, FD 6
2011/04/19 17:21:22| Adding domain system.lan from /etc/resolv.conf
2011/04/19 17:21:22| Adding domain system.lan from /etc/resolv.conf
2011/04/19 17:21:22| Adding nameserver 172.21.2.101 from /etc/resolv.conf
2011/04/19 17:21:22| helperOpenServers: Starting 5 'ncsa_auth' processes
2011/04/19 17:21:22| User-Agent logging is disabled.
2011/04/19 17:21:22| Referer logging is disabled.
2011/04/19 17:21:22| logfileOpen: opening log /var/log/squid/access.log
2011/04/19 17:21:22| Unlinkd pipe opened on FD 16
2011/04/19 17:21:22| Swap maxSize 102400 + 8192 KB, estimated 8507 objects
2011/04/19 17:21:22| Target number of buckets: 425
2011/04/19 17:21:22| Using 8192 Store buckets
2011/04/19 17:21:22| Max Mem size: 8192 KB
2011/04/19 17:21:22| Max Swap size: 102400 KB
2011/04/19 17:21:22| Local cache digest enabled; rebuild/rewrite every 3600/3600 sec
2011/04/19 17:21:22| logfileOpen: opening log /var/log/squid/store.log
2011/04/19 17:21:22| Rebuilding storage in /var/spool/squid (DIRTY)
2011/04/19 17:21:22| Using Least Load store dir selection
2011/04/19 17:21:22| Current Directory is /var/run
2011/04/19 17:21:22| Loaded Icons.
2011/04/19 17:21:22| commBind: Cannot bind socket FD 18 to 172.21.2.68:3128: (98) Address already in use
FATAL: Cannot open HTTP Port
Squid Cache (Version 2.7.STABLE9): Terminated abnormally.
CPU Usage: 0.008 seconds = 0.004 user + 0.004 sys
Maximum Resident Size: 18880 KB
Page faults with physical i/o: 0
Memory usage for squid via mallinfo():
total space in arena: 2112 KB
Ordinary blocks: 2063 KB 2 blks
Small blocks: 0 KB 1 blks
Holding blocks: 280 KB 1 blks
Free Small blocks: 0 KB
Free Ordinary blocks: 48 KB
Total in use: 2343 KB 98%
Total free: 48 KB 2%

сквид конфиг щас

Показать

# created by SAMS _sams_ 2011-4-19 15:59:36
http_port 172.21.2.68:3128


#cache_mem 1024 MB
cache_dir ufs /var/spool/squid 100 16 256
cache_access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
cache_store_log /var/log/squid/store.log
#mime_table /etc/squid/mime.conf
#pid_filename /var/run/squid/squid.pid
pid_filename /var/run/squid.pid
hosts_file /etc/hosts
diskd_program /usr/lib/squid/diskd-daemon
unlinkd_program /usr/lib/squid/unlinkd

#url_rewrite_program /usr/local/rejik3/redirector /usr/local/rejik3/redirector.conf
#url_rewrite_children 10
#error_directory /usr/share/squid/errors/Russian-1251


auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/ncsa.sams
auth_param basic children 5
auth_param basic realm Log Pass na INET:
auth_param basic credentialsttl 2 hours
auth_param basic casesensitive off

acl all src 0.0.0.0/0.0.0.0
acl users proxy_auth REQUIRED



http_access allow users
http_access deny all
#153092

Офигеть. А что теперь весит на 3128 порту что сквид к нему подцепитса не может.
[console]ps ax | grep squid
netstat -lnp | grep squid
[/console]

#153098

ммм. у меня ИЕ через прокси нормально работает

Показать
[console]root@sams:/var/run# ps ax | grep squid
1633 ? Ss 0:00 squid start
1635 ? S 0:00 (squid) start
1637 ? S 0:00 (ncsa_auth) /etc/squid/ncsa.sams
1638 ? S 0:00 (ncsa_auth) /etc/squid/ncsa.sams
1639 ? S 0:00 (ncsa_auth) /etc/squid/ncsa.sams
1640 ? S 0:00 (ncsa_auth) /etc/squid/ncsa.sams
1641 ? S 0:00 (ncsa_auth) /etc/squid/ncsa.sams
1857 pts/0 S+ 0:00 grep squid
[/console]
#153115

Это я не понял. Вы что пробывали запустить сквид при работающем экземпляре. Если правите конфиг, то потом просто в консоли набираете
[console]/path/to/bin_squid/squid -k reconfigure[/console].
Проделайте это щас когда поправили конфиг и выправили сроку с pid файлом. И тогда выложыте последние строки из cache.log.
Нащот этой команды не уверен. У вас 2,7 версия у меня 3,0.

#153118

помогло. я ребут сдела.

Показать
011/04/19 17:55:12| Preparing for shutdown after 60 requests
2011/04/19 17:55:12| Waiting 30 seconds for active connections to finish
2011/04/19 17:55:12| FD 18 Closing HTTP connection
2011/04/19 17:55:12| WARNING: basicauthenticator #4 (FD 10) exited
2011/04/19 17:55:12| WARNING: basicauthenticator #2 (FD 8) exited
2011/04/19 17:55:12| WARNING: basicauthenticator #3 (FD 9) exited
2011/04/19 17:55:12| Too few basicauthenticator processes are running
2011/04/19 17:55:12| Starting new helpers
2011/04/19 17:55:12| helperOpenServers: Starting 5 'ncsa_auth' processes
2011/04/19 17:55:12| WARNING: basicauthenticator #5 (FD 11) exited
2011/04/19 17:55:12| WARNING: basicauthenticator #1 (FD 7) exited
2011/04/19 17:55:35| Starting Squid Cache version 2.7.STABLE9 for i386-debian-linux-gnu...
2011/04/19 17:55:35| Process ID 1093
2011/04/19 17:55:35| With 1024 file descriptors available
2011/04/19 17:55:35| Using epoll for the IO loop
2011/04/19 17:55:35| DNS Socket created at 0.0.0.0, port 60217, FD 6
2011/04/19 17:55:35| Adding domain system.lan from /etc/resolv.conf
2011/04/19 17:55:35| Adding domain system.lan from /etc/resolv.conf
2011/04/19 17:55:35| Adding nameserver 172.21.2.101 from /etc/resolv.conf
2011/04/19 17:55:35| helperOpenServers: Starting 5 'ncsa_auth' processes
2011/04/19 17:55:35| User-Agent logging is disabled.
2011/04/19 17:55:35| Referer logging is disabled.
2011/04/19 17:55:35| logfileOpen: opening log /var/log/squid/access.log
2011/04/19 17:55:35| Unlinkd pipe opened on FD 16
2011/04/19 17:55:35| Swap maxSize 102400 + 8192 KB, estimated 8507 objects
2011/04/19 17:55:35| Target number of buckets: 425
2011/04/19 17:55:35| Using 8192 Store buckets
2011/04/19 17:55:35| Max Mem size: 8192 KB
2011/04/19 17:55:35| Max Swap size: 102400 KB
2011/04/19 17:55:35| Local cache digest enabled; rebuild/rewrite every 3600/3600 sec
2011/04/19 17:55:35| logfileOpen: opening log /var/log/squid/store.log
2011/04/19 17:55:35| Rebuilding storage in /var/spool/squid (DIRTY)
2011/04/19 17:55:35| Using Least Load store dir selection
2011/04/19 17:55:35| Current Directory is /
2011/04/19 17:55:35| Loaded Icons.
2011/04/19 17:55:35| Accepting proxy HTTP connections at 172.21.2.68, port 3128, FD 18.
2011/04/19 17:55:35| Accepting ICP messages at 0.0.0.0, port 3130, FD 19.
2011/04/19 17:55:35| HTCP Disabled.
2011/04/19 17:55:35| WCCP Disabled.
2011/04/19 17:55:35| Ready to serve requests.
2011/04/19 17:55:35| Done reading /var/spool/squid swaplog (3309 entries)
2011/04/19 17:55:35| Finished rebuilding storage from disk.
2011/04/19 17:55:35| 2746 Entries scanned
2011/04/19 17:55:35| 0 Invalid entries.
2011/04/19 17:55:35| 0 With invalid flags.
2011/04/19 17:55:35| 2746 Objects loaded.
2011/04/19 17:55:35| 0 Objects expired.
2011/04/19 17:55:35| 563 Objects cancelled.
2011/04/19 17:55:35| 0 Duplicate URLs purged.
2011/04/19 17:55:35| 0 Swapfile clashes avoided.
2011/04/19 17:55:35| Took 0.4 seconds (7349.8 objects/sec).
2011/04/19 17:55:35| Beginning Validation Procedure
2011/04/19 17:55:35| Completed Validation Procedure
2011/04/19 17:55:35| Validated 2183 Entries
2011/04/19 17:55:35| store_swap_size = 32632k
2011/04/19 17:55:36| storeLateRelease: released 0 objects
Показать

root@sams:~# ps ax | grep squid
1088 ? Ss 0:00 /usr/sbin/squid -D -YC
1093 ? S 0:00 (squid) -D -YC
1099 ? S 0:00 (ncsa_auth) /etc/squid/ncsa.sams
1100 ? S 0:00 (ncsa_auth) /etc/squid/ncsa.sams
1101 ? S 0:00 (ncsa_auth) /etc/squid/ncsa.sams
1102 ? S 0:00 (ncsa_auth) /etc/squid/ncsa.sams
1103 ? S 0:00 (ncsa_auth) /etc/squid/ncsa.sams
1672 pts/0 S+ 0:00 grep squid
root@sams:~#

побежал домой. завтра продолжим
ОГРОМНОЕ СПАСИБО ЗА ПОМОЩЬ!!!! ПОБЕЖАЛ А ТО ОПАЗДАЮ НА АВТОБУС)

#153120

Давай удачи. :D

#153338

Доброго утра :) мы продолжаем нашу телепередачу :P

Ну вобщем как показано в моем последнем посте сквид стал правильно запускаца, без матюков. и что самое главное сам.

Очередной рабочий вопрос:
не блокируется пользователь в реальном времени по пересходу трафика.

Наблюдения:

syslog
[console]Apr 20 10:10:03 sams samslogparser[1769]: Disable user test traffic 6742559>5242880
Apr 20 10:10:03 sams samslogparser[1769]: Send message to admin. script /usr/local/share/sams/src/script/send_winpopup_message
Apr 20 10:10:03 sams samsdaemon[1659]: Reading request to reconfigure SQUID
Apr 20 10:10:05 sams samsdaemon[1775]: Reconfigure & restart SQUID... Ok[/console]
но эффекта нет. юзер даже после релогина в ИЕ продолжает замечательно качать трафик.
если я сделаю ребут машины, то все задизейбленные юзеры не смогу зайти в инет. то есть всетки чтото работает из этой связки. чтобы юзер зашел в инет мне нужно сделать: обнулить трафик юзеру в самсе, сохранить конфиг самса и реконфигурировать сквид - все из веб морды самс.
После этого юзер идет в итнет.

Попытка погуглить.
я еще вчера нашел заметку для себя http://www.permlug.org/node/4916

Показать
mrpot, 23.04.2009 — 09:13

У меня похожая проблема, авторизация стоит по ip и автоматическая блокировка по превышению трафика не происходит хотя реконфигурация SQUID'а происходит, редиректор sams.

2009-04-22 14:48:14 sams Disable user maxim traffic 54069682>52428800
2009-04-22 14:48:14 samsdaemon Send message to admin. script /usr/local/share/sams/src/scri
2009-04-22 14:48:14 samsdaemon Reading request to reconfigure SQUID
2009-04-22 14:48:16 samsdaemon Reconfigure & restart SQUID... Ok

В таблице reconfig следующее:

number service action value
1 sams


SuSE 8.1
SQUID 2.4 STABLE7
Apache 1.3.26 [PHP4]
sams-1.0

Я так понимаю он должен удалить строчку с ip из файлика ACL, в чем может быть проблема?

*
*

epuyc, 01.04.2009 — 13:16

Решил свою задачу.
В файл grouptray.php в функцию

function DisableGroupUsers()

была добавлена строка

print(" parent.basefrm.location.href=\"main.php?show=exe&function=reconfigsquidform&filename=squidbuttom_0_reconfig.php\";\n"); # Move to Squid Reconfigure

И закоментарина строка

# print(" parent.tray.location.href=\"tray.php?show=usergrouptray&groupname=$groupname\";\n");

Таким образом, при нажатии на кнопку "изменить" пользователь перекидывается на страничку с переконфигурацией сквида. Решение из серии "непонятно зачем оно надо", но мне оно надо чтобы неопытному человеку не объяснять долго последовательность действий и не отвечать на вопросы типа " А я галочку сняла и кнопочку нажало, а оно не влючается"

Спасибо за помощь!! Буду ждать нового релиза.

Выполнил по данной статейке:

Показать
В файл grouptray.php в функцию

function DisableGroupUsers()

была добавлена строка

print(" parent.basefrm.location.href=\"main.php?show=exe&function=reconfigsquidform&filename=squidbuttom_0_reconfig.php\";\n"); # Move to Squid Reconfigure

И закоментарина строка

# print(" parent.tray.location.href=\"tray.php?show=usergrouptray&groupname=$groupname\";\n");

но не помогло. сделанные изменения не откатывал.

Жду помощи знатоков smile

#153339

Привет! wink
Я так понял ты смоделировал ситуацыю с превышением трафика и переконфигурацыей сквида. Хорошо. Покажы щас вывод команды
[console]ls -l /etc/squid[/console]
и содержымое файлов
4dac741d1bad3.sams
4dad0e92209e7.sams
disabled_id.sams
ncsa.sams

#153342

вот такие пироги :)

[console]

root@sams:~# ls -l /etc/squid
итого 224
-rw-r--r-- 1 root root 7 Апр 20 10:10 4dac741d1bad3.sams
-rw-r--r-- 1 root root 21 Апр 20 10:10 4dad0e92209e7.sams
-rw-r--r-- 1 root root 26009 Апр 20 10:10 banners.sams
-rw-r--r-- 1 root root 16 Апр 20 10:10 disabled_id.sams
-rw-r--r-- 1 root root 0 Апр 20 10:10 ncsa.sams
-rwxrwxrwx 1 root root 951 Апр 20 10:10 squid.conf
-rw-r--r-- 1 root root 908 Апр 20 10:10 squid.conf.bak
-rw------- 1 root root 169404 Апр 18 15:42 squid.conf.orig
-rw-r--r-- 1 root root 1264 Июн 3 2010 squidGuard.conf
root@sams:~#

[/console]

вот решил для упрощения закинуть архивчик .http://webfiles.ru/23075121

#153352

Если ничего щас не минял сделай в консоли
[console]squid -k reconfigure[/console]
и тогда попробуй ещё раз зайти под test

#153354

Не помогло
[console]root@sams:~# squid -k reconfigure
root@sams:~#
[/console]

кеш лог

Показать
2011/04/20 11:52:28| Reconfiguring Squid Cache (version 2.7.STABLE9)...
2011/04/20 11:52:28| FD 15 Closing HTTP connection
2011/04/20 11:52:28| FD 16 Closing ICP connection
2011/04/20 11:52:28| Closing unlinkd pipe on FD 17
2011/04/20 11:52:28| logfileClose: closing log /var/log/squid/store.log
2011/04/20 11:52:28| logfileClose: closing log /var/log/squid/access.log
2011/04/20 11:52:28| Including Configuration File: /etc/squid/squid.conf (depth 0)
2011/04/20 11:52:28| Cache dir '/var/spool/squid' size remains unchanged at 102400 KB
2011/04/20 11:52:28| logfileOpen: opening log /var/log/squid/access.log
2011/04/20 11:52:28| logfileOpen: opening log /var/log/squid/store.log
2011/04/20 11:52:28| User-Agent logging is disabled.
2011/04/20 11:52:28| Referer logging is disabled.
2011/04/20 11:52:28| DNS Socket created at 0.0.0.0, port 58171, FD 8
2011/04/20 11:52:28| Adding domain system.lan from /etc/resolv.conf
2011/04/20 11:52:28| Adding domain system.lan from /etc/resolv.conf
2011/04/20 11:52:28| Adding nameserver 172.21.2.101 from /etc/resolv.conf
2011/04/20 11:52:28| helperOpenServers: Starting 5 'ncsa_auth' processes
2011/04/20 11:52:28| Unlinkd pipe opened on FD 17
2011/04/20 11:52:28| Accepting proxy HTTP connections at 172.21.2.68, port 3128, FD 15.
2011/04/20 11:52:28| Accepting ICP messages at 0.0.0.0, port 3130, FD 16.
2011/04/20 11:52:28| HTCP Disabled.
2011/04/20 11:52:28| WCCP Disabled.
2011/04/20 11:52:28| Loaded Icons.
2011/04/20 11:52:28| Ready to serve requests.

сислог не изменился

пс. припоминаю, что в самом начале когда я конфигурировал самс он сам конфиг скида правил и добавлял вроди строки содержащие 4dac741d1bad3.sams 4dad0e92209e7.sams . не знаю . может эта инфа поможет

хм. пока писал пост. еще раз проверил. доступ теста закрыт. все юзеры перерасходовавшие трафи в инет не пускает.

Показать

ERROR
Cache Access Denied.

--------------------------------------------------------------------------------

The following error was encountered while trying to retrieve the URL:
#153361

Да это плохо что вы поправили файл сквида после того как там порилса САМС. Он создаёт в нём вот такие отметки

text
#TAG

которые не надо было трогать.

#153365

Могу предложыть вот что сделать. Сохранить все теперешние конфиги гдето в домашней директории. Оставить тока конфиг сквида и самса и поробывать сначала его сконфигурировать, чтобы он сам поправил конфиг сквида. И пересоздать базу даных.

#153367

тогда вопрос. я взял конфиг сквида с рабочей машины самс+ сквид. почему тогда в нем нет этих тагов? парадокс

#153373

Незнаю. А у вас не осталса тот ваш конфиг сквида, которого подправил SAMS??

#153376

Нет. тут я дал маху без бекапа.
ладно буду переставлять неспеша. посмотрим что получица

Войдите или зарегистрируйтесь, чтобы ответить.