Решено: Ubuntu. настройка squid (ERROR The requested URL could not be retrieved)

Обсуждение настройки и работы сервисов, резервирования, сетевых настроек и вопросов безопасности ОС.

Модераторы: SLEDopit, Модераторы разделов

Cartmans
Сообщения: 6
ОС: sasas

Решено: Ubuntu. настройка squid

Сообщение Cartmans »

Нужна помощь в настройки squid. В общем проблема в следующем, установил SQUID 2.7.STABLE3 на один из компьютеров локальной сети (IP-192.168.1.33) с доступом в интернет через ADSL модем → роутер, прописал в файле /etc/squid/squid.conf следующие настройки:

Код: Выделить всё

cache_mem 200 MB
 cache_dir ufs /var/spool/squid 1024 16 256
 http_port 192.168.1.33:3128
 dns_nameservers 192.168.1.1
 acl manager proto cache_object
 acl allowed_hosts src 192.168.1.2-192.168.1.255
 acl SSL_ports port 443        # https
 acl SSL_ports port 563        # snews
 acl SSL_ports port 873        # rsync
 acl Safe_ports port 80        # http
 acl CONNECT  method CONNECT

 http_access allow manager localhost
 http_access allow allowed_hosts
 http_access deny CONNECT !SSL_ports
 http_access deny all
 icp_access deny all

В настройках браузера прописал:
IP- 192.168.1.33
порт прокси — 3128

при попытки открыть в браузере какой либо адрес выдает сообщение
«ERROR The requested URL could not be retrieved»

Файл /var/log/squid/access.log содержит след. инфу

Код: Выделить всё

1241075198.883      0 192.168.1.33 TCP_DENIED/403 1372 GET http://ya.ru/ - NONE/- text/html
1241075201.895      0 192.168.1.33 TCP_DENIED/403 1394 GET http://ya.ru/favicon.ico - NONE/- text/html
1241075201.897      0 192.168.1.33 TCP_DENIED/403 1394 GET http://ya.ru/favicon.ico - NONE/- text/html


/var/log/squid/cache.log

Код: Выделить всё

CPU Usage: 0.020 seconds = 0.012 user + 0.008 sys
Maximum Resident Size: 0 KB
Page faults with physical i/o: 0
Memory usage for squid via mallinfo():
    total space in arena:    2444 KB
    Ordinary blocks:         2299 KB      7 blks
    Small blocks:               0 KB      5 blks
    Holding blocks:           396 KB      1 blks
    Free Small blocks:          0 KB
    Free Ordinary blocks:     144 KB
    Total in use:            2695 KB 95%
    Total free:               144 KB 5%
2009/04/30 10:06:13| logfileClose: closing log /var/log/squid/store.log
2009/04/30 10:06:13| logfileClose: closing log /var/log/squid/access.log
2009/04/30 10:06:13| Squid Cache (Version 2.7.STABLE3): Exiting normally.
2009/04/30 10:06:22| Starting Squid Cache version 2.7.STABLE3 for amd64-debian-linux-gnu...
2009/04/30 10:06:22| Process ID 4706
2009/04/30 10:06:22| With 1024 file descriptors available
2009/04/30 10:06:22| Using epoll for the IO loop
2009/04/30 10:06:22| DNS Socket created at 0.0.0.0, port 40902, FD 6
2009/04/30 10:06:22| Adding nameserver 192.168.1.1 from squid.conf
2009/04/30 10:06:22| User-Agent logging is disabled.
2009/04/30 10:06:22| Referer logging is disabled.
2009/04/30 10:06:22| logfileOpen: opening log /var/log/squid/access.log
2009/04/30 10:06:22| Unlinkd pipe opened on FD 11
2009/04/30 10:06:22| Swap maxSize 1048576 KB, estimated 80659 objects
2009/04/30 10:06:22| Target number of buckets: 4032
2009/04/30 10:06:22| Using 8192 Store buckets
2009/04/30 10:06:22| Max Mem  size: 204800 KB
2009/04/30 10:06:22| Max Swap size: 1048576 KB
2009/04/30 10:06:22| Local cache digest enabled; rebuild/rewrite every 3600/3600 sec
2009/04/30 10:06:22| logfileOpen: opening log /var/log/squid/store.log
2009/04/30 10:06:22| Rebuilding storage in /var/spool/squid (CLEAN)
2009/04/30 10:06:22| Using Least Load store dir selection
2009/04/30 10:06:22| Set Current Directory to /var/spool/squid
2009/04/30 10:06:22| Loaded Icons.
2009/04/30 10:06:23| Accepting proxy HTTP connections at 0.0.0.0, port 3128, FD 13.
2009/04/30 10:06:23| commBind: Cannot bind socket FD 14 to 192.168.1.33:3128: (98) Address already in use
2009/04/30 10:06:23| Accepting ICP messages at 0.0.0.0, port 3130, FD 14.
2009/04/30 10:06:23| HTCP Disabled.
2009/04/30 10:06:23| WCCP Disabled.
2009/04/30 10:06:23| Ready to serve requests.
2009/04/30 10:06:23| Done reading /var/spool/squid swaplog (0 entries)
2009/04/30 10:06:23| Finished rebuilding storage from disk.
2009/04/30 10:06:23|         0 Entries scanned
2009/04/30 10:06:23|         0 Invalid entries.
2009/04/30 10:06:23|         0 With invalid flags.
2009/04/30 10:06:23|         0 Objects loaded.
2009/04/30 10:06:23|         0 Objects expired.
2009/04/30 10:06:23|         0 Objects cancelled.
2009/04/30 10:06:23|         0 Duplicate URLs purged.
2009/04/30 10:06:23|         0 Swapfile clashes avoided.
2009/04/30 10:06:23|   Took 0.3 seconds (   0.0 objects/sec).
2009/04/30 10:06:23| Beginning Validation Procedure
2009/04/30 10:06:23|   Completed Validation Procedure
2009/04/30 10:06:23|   Validated 0 Entries
2009/04/30 10:06:23|   store_swap_size = 0k
2009/04/30 10:06:24| storeLateRelease: released 0 objects


как это лечить ?? :huh:
Спасибо сказали:
skor
Сообщения: 419
ОС: RTFM-OS v127.0.0.1

Re: Решено: Ubuntu. настройка squid

Сообщение skor »

acl allowed_hosts src 192.168.1.2-192.168.1.254/255.255.255.0
А лучше заменить на такое
acl allowed_hosts src 192.168.1.0/255.255.255.0
Спасибо сказали:
dr-evil
Сообщения: 159
ОС: Fedora 18

Re: Решено: Ubuntu. настройка squid

Сообщение dr-evil »

а еще лучше маску писать как /24
и
1. «ERROR The requested URL could not be retrieved»
это сообщение о том что нельзя вам показать запрошенный адрес, это не ошибка, а информационное сообщение, читайте дальше там написана причина невозможности.
В вашем случае должно быть что-то вида "Access Denied"

2. Access denied выдается тем, у кого не должно быть доступа на прокси. Как выше написали это может быть из-за неверного указания маски в acl allowed_hosts
Анализ подозрительных файлов тут
Все что вы скажете может быть использовано как баян.
Jabber-конференция: sysadmins.ru на conference.jabber.ru - всем добро пожаловать!
Спасибо сказали:
Cartmans
Сообщения: 6
ОС: sasas

Re: Решено: Ubuntu. настройка squid

Сообщение Cartmans »

в общем проблема решена. Нужно было удалить в squid.conf настройки по умолчанию и прописать свои
Спасибо сказали:
Аватара пользователя
Sacred
Сообщения: 106

Re: Решено: Ubuntu. настройка squid

Сообщение Sacred »

Народ у меня тоже появилась не обходимость поднять прокси. Выбрал Squid. погуглил, нашел:

Код: Выделить всё

http_port 3128
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY
auth_param basic children 5
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours
refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern .               0       20%     4320
acl all src 192.168.7.0/255.255.255.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443 563
acl Jabber_ports port 5222 5223
acl Safe_ports port 80          # http
acl Safe_ports port 21          # ftp
acl Safe_ports port 443 563     # https, snews
acl Safe_ports port 70          # gopher
acl Safe_ports port 210         # wais
acl Safe_ports port 1025-65535  # unregistered ports
acl Safe_ports port 280         # http-mgmt
acl Safe_ports port 488         # gss-http
acl Safe_ports port 591         # filemaker
acl Safe_ports port 777         # multiling http
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports !Jabber_ports
acl our_networks src 192.168.7.0/24
http_access allow our_networks
http_access allow localhost manager
http_access deny all
http_reply_access allow all
visible_hostname floriana.rom
acl FTP proto FTP
coredump_dir /var/spool/squid

acl our_networks src 192.168.7.0/24
http_access allow our_networks

но начав искать такие строки, выяснил что они вообще отсутствуют...
не подскажите что конкретно небходимо из всего этого, для раздачи инета в локалку(из двух компов)...???
Спасибо сказали: