* [Sysadmins] Squid и Apache не работают
@ 2012-11-02 12:59 waryhint
2012-11-03 15:47 ` Michael Shigorin
2012-11-14 12:05 ` Pavel
0 siblings, 2 replies; 3+ messages in thread
From: waryhint @ 2012-11-02 12:59 UTC (permalink / raw)
To: sysadmins
Добрый день! Подскажите пожалуйста что неправильно делаю? Есть точка
доступа на которой подняты dns (bind), прокси (squid), samba, и веб сервер
(apache).
Сетевая карта имеет два адреса 192.168.1.2 и 192.168.2.1, первым смотрит
на модем, вторим в локальную сеть.
Столкнулся с проблемой в работе Apache. Сервер очень долго обрабатывает
запросы, подозреваю что с этим связан прокси Squid.
Когда пускаю Интернет мимо Squid (в nat убираю строку
iptables -I PREROUTING -t nat -s 192.168.2.0/24 -p tcp --dport 80 -j DNAT
--to 192.168.2.1:3128 \)
Apache начинает нормально работать…
Подскажите пожалуста, что нужно убрать или поменять в squid.conf что б
сервер нормально работал?
Вот мой конфиг:
visible_hostname BRDA
acl manager proto cache_object
acl localhost src 127.0.0.1/32 ::1
acl to_localhost dst 127.0.0.0/8
acl localnet src 192.168.2.0/24
acl Safe_ports port 901 # SWAT
acl Safe_ports port 488 # GSS-HTTP
acl Safe_ports port 777 # Multilingual HTTP
acl Safe_ports port 70 # GOPHER
acl Safe_ports port 443 # HTTPS
acl Safe_ports port 631 # CUPS
acl SSL_ports port 8080 # Alterator
acl Safe_ports port 1025-65535 # Other ports
acl Safe_ports port 873 # RSYNC
acl Safe_ports port 591 # Filemaker
acl Safe_ports port 280 # HTTP-MGMT
acl SSL_ports port 443 # HTTPS (C)
acl Safe_ports port 80 # HTTP
acl SSL_ports port 563 # SNEWS (C)
acl SSL_ports port 5222-5223 # Jabber
acl Safe_ports port 210 # WAIS
acl Safe_ports port 21 # FTP
acl Safe_ports port 563 # SNEWS
acl SSL_ports port 873 # RSYNC (C)
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
acl CONNECT method CONNECT
http_access deny CONNECT !SSL_ports
acl mb2 src 192.168.2.107
http_access allow mb2
acl mb1 src 192.168.2.5
http_access allow mb1
acl anya src 192.168.2.27
http_access allow anya
acl maks src 192.168.2.17
http_access allow maks
acl urvd1 src 192.168.2.25
http_access allow urvd1
acl golova src 192.168.2.30
http_access allow golova
#доступ для OTHER-NET-USER
acl othernetuser src 192.168.2.2-192.168.2.30
acl sblock dstdomain "/etc/squid/block.acl"
# Определяем ACL флэш контента
acl media rep_mime_type video/flv video/x-flv
acl mediapr urlpath_regex \.flv(\?.*)?$
acl media rep_mime_type application/x-shockwave-flash
acl mediapr urlpath_regex \.swf(\?.*)?$
# Закрываем доступ к Flash
http_access deny mediapr
http_reply_access deny media
http_access deny othernetuser sblock
http_access allow othernetuser
http_port 3128 transparent
hierarchy_stoplist cgi-bin ?
cache_dir ufs /var/spool/squid 2048 16 256
maximum_object_size 65536 KB
access_log /var/log/squid/access.log squid
cache_log /var/log/squid/cache.log
cache_store_log /var/log/squid/store.log
debug_options ALL,1
acl QUERY urlpath_regex cgi-bin \?
cache deny QUERY
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
acl apache rep_header Server ^Apache
retry_on_error on
coredump_dir /var/spool/squid
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Sysadmins] Squid и Apache не работают
2012-11-02 12:59 [Sysadmins] Squid и Apache не работают waryhint
@ 2012-11-03 15:47 ` Michael Shigorin
2012-11-14 12:05 ` Pavel
1 sibling, 0 replies; 3+ messages in thread
From: Michael Shigorin @ 2012-11-03 15:47 UTC (permalink / raw)
To: sysadmins
On Fri, Nov 02, 2012 at 03:59:44PM +0300, waryhint wrote:
> Столкнулся с проблемой в работе Apache. Сервер очень долго
> обрабатывает запросы, подозреваю что с этим связан прокси
> Squid.
Если очень долго, но всё же работает -- возможно, где-то
по цепочке возникают таймауты при разрешении DNS-имён.
> Когда пускаю Интернет мимо Squid (в nat убираю строку
> iptables -I PREROUTING -t nat -s 192.168.2.0/24 -p tcp --dport 80 -j DNAT
> --to 192.168.2.1:3128 \)
> Apache начинает нормально работать???
Посмотрите netstat -pan, есть ли соединение между процессами
httpd* и squid при такой длительной обработке и если да --
можно для апача проковырять отдельную дырочку в файрволе,
поставив правило для прямого пропуска со 192.168.2.1 либо
127.0.0.1, смотря откуда идёт.
--
---- WBR, Michael Shigorin <mike@altlinux.ru>
------ Linux.Kiev http://www.linux.kiev.ua/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Sysadmins] Squid и Apache не работают
2012-11-02 12:59 [Sysadmins] Squid и Apache не работают waryhint
2012-11-03 15:47 ` Michael Shigorin
@ 2012-11-14 12:05 ` Pavel
1 sibling, 0 replies; 3+ messages in thread
From: Pavel @ 2012-11-14 12:05 UTC (permalink / raw)
To: sysadmins
> iptables -I PREROUTING -t nat -s 192.168.2.0/24 -p tcp --dport 80 -j
> DNAT --to 192.168.2.1:3128
Если нет необходимости из локальной сети на apache ходить через squid,
то замените на:
iptables -t nat -I PREROUTING -s 192.168.2.0/24 ! -d 192.168.2.1 -p tcp
--dport 80 -j DNAT --to 192.168.2.1:3128
--
Pavel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-11-14 12:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-02 12:59 [Sysadmins] Squid и Apache не работают waryhint
2012-11-03 15:47 ` Michael Shigorin
2012-11-14 12:05 ` Pavel
ALT Linux sysadmins discussion
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/sysadmins/0 sysadmins/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 sysadmins sysadmins/ http://lore.altlinux.org/sysadmins \
sysadmins@lists.altlinux.org sysadmins@lists.altlinux.ru sysadmins@lists.altlinux.com
public-inbox-index sysadmins
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.sysadmins
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git