LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-28-2009, 08:57 PM   #1
moekad
Member
 
Registered: Feb 2009
Posts: 64

Rep: Reputation: 15
squid help


hey need help with this
i try to use
acl 6arab url_regex http://www.saidacity.net
no_cache allow 6arab
and try
refresh_pattern ^http://www.saidacity.net 0 80% 99999 ignore-no-cache ignore-no-store

it sometimes give me TCP_HIT and sometimes TCP_MISS
i try different browser
not only this site , different site

and when it give me TCP_HIT , when i open the site, it's some how slow!!

one more thing, if i cache file.exe for example and i change the min age which is 0 to 9999 , and restart squid, does the object expire? since when i change the min age all objects .exe are expired

Thanks for your help and hope can someone help me thx alot
 
Old 07-29-2009, 05:56 AM   #2
chitambira
Member
 
Registered: Oct 2008
Location: Online
Distribution: RHEL, Centos
Posts: 373
Blog Entries: 1

Rep: Reputation: 51
What are your trying to achieve??
what are the defaults? and have you commented them out? what the order of the refresh_pattern line? show me your complete squid.conf

Please note: by default, regular expressions are CASE-SENSITIVE. To make them case-insensitive, use the -i option.

From Squid documentation:
Quote:
ignore-no-store ignores any ``Cache-control: no-store'' headers received from a server. Doing this VIOLATES the HTTP standard. Enabling this feature could make you liable for problems which it causes.
So you were forewarned!
 
Old 07-29-2009, 07:19 AM   #3
moekad
Member
 
Registered: Feb 2009
Posts: 64

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by chitambira View Post
What are your trying to achieve??
what are the defaults? and have you commented them out? what the order of the refresh_pattern line? show me your complete squid.conf

Please note: by default, regular expressions are CASE-SENSITIVE. To make them case-insensitive, use the -i option.

From Squid documentation:

So you were forewarned!
hey Thanks for reply
all i want to cache
like sometimes site have huge pic so to cache them
but not working even i want to enforce to cache facebook on startup like the pics banners and so on not working check my config
///////////acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443
acl SSL_ports port 10000
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 10000 #webmin
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 manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports

http_access allow localhost




htcp_access deny all
hierarchy_stoplist cgi-bin ?



cache_mem 500 MB
maximum_object_size_in_memory 256 MB





cache_dir ufs /home/cache 39999 16 256
store_dir_select_algorithm least-load








access_log /var/log/squid3/access.log squid


cache_log /var/log/squid3/cache.log

cache_store_log /var/log/squid3/store.log

refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
refresh_pattern -i \.exe$ 0 50% 99999 reload-into-ims override-lastmod ignore-no-store ignore-no-cache
refresh_pattern \.ram$ 99999 50% 99999 ignore-reload ignore-no-store ignore-no-cache
refresh_pattern ^http: 99999 50% 99999 override-expire ignore-reload ignore-no-store
refresh_pattern \.html$ 99999 50% 99999 ignore-no-cache ignore-reload ignore-no-store
refresh_pattern \.jpg$ 99999 50% 99999 ignore-no-cache refresh-ims ignore-reload
refresh_pattern \.png$ 99999 50% 99999 ignore-no-cache refresh-ims ignore-reload
refresh_pattern \.gif$ 99999 50% 99999 ignore-reload ignore-no-cache
refresh_pattern \.swf$ 99999 50% 99999 reload-into-ims ignore-no-cache refresh-ims
refresh_pattern ^http://b.static.ak.fbcdn.net/images/...r_logo_big.gif 99999 50% 99999 ignore-reload ignore-no-cache ignore-no-store
refresh_pattern ^http://www.6arab.com 999999 50% 99999 ignore-reload ignore-no-cache

acl facebook url_regex http://b.static.ak.fbcdn.net/images/...r_logo_big.gif http://www.facebook.com/images/ui/UI...tton_Green.png http://www.facebook.com/images/ui/UILinkButton_Blue.png http://www.facebook.com/images/welco...e_page_map.png http://b.static.ak.fbcdn.net/images/...e_5005_ltr.png http://b.static.ak.fbcdn.net/ http://www.facebook.com http://www.6arab.com
no_cache allow facebook

acl facebook2 dstdomain facebook.com saidacity.net 6arab.com
no_cache allow facebook2
dns_nameservers 192.168.222.1 195.112.195.34 192.168.0.1 192.168.0.2

hosts_file /etc/hosts

coredump_dir /var/spool/squid3










http_port 3128

cache_mgr h4ckXx@hotmail.com

visible_hostname kad.lan

dns_nameservers 192.168.222.1 195.112.195.34

acl my_network src 192.168.0.0/24


acl bad_sites url_regex -i "/etc/squid3/bad_sites"
deny_info http://www.google.com.lb bad_sites
http_access deny bad_sites

acl bad_domain dstdom_regex -i "/etc/squid3/bad_domain"
http_access deny bad_domain

acl bad_extensions urlpath_regex "/etc/squid3/bad_extensions"
http_access deny bad_extensions


acl windowsupdate dstdomain windowsupdate.microsoft.com
acl windowsupdate dstdomain .update.microsoft.com
acl windowsupdate dstdomain download.windowsupdate.com
acl windowsupdate dstdomain redir.metaservices.microsoft.com
acl windowsupdate dstdomain images.metaservices.microsoft.com
acl windowsupdate dstdomain c.microsoft.com
acl windowsupdate dstdomain www.download.windowsupdate.com
acl windowsupdate dstdomain wustat.windows.com
acl windowsupdate dstdomain crl.microsoft.com
acl windowsupdate dstdomain sls.microsoft.com
acl windowsupdate dstdomain productactivation.one.microsoft.com
acl windowsupdate dstdomain ntservicepack.microsoft.com

http_access deny windowsupdate

acl hotmail dstdomain .hotmail.com
always_direct allow hotmail

acl bad_time time 07:00-23:00
acl bad_site_domain dstdomain .youtube.com
delay_pools 1
delay_class 1 2
delay_parameters 1 10250/10250 1500000/1500000
delay_access 1 allow bad_time
http_access deny bad_time bad_site_domain


acl cache_download url_regex "/etc/squid3/cache_download
no_cache deny cache_download


http_access allow my_network
http_access deny all

//////////
Thanks alot =)
 
Old 07-29-2009, 09:48 AM   #4
chitambira
Member
 
Registered: Oct 2008
Location: Online
Distribution: RHEL, Centos
Posts: 373
Blog Entries: 1

Rep: Reputation: 51
there you go! your confs are just splattered around. Put all your acls together, then your http_access lines together. It will be a good i dea to follow headlines like global configs, acl configs, cache_perfomance tuning, logging etc. and group your configs accordinmg to this.
You will note that squid.conf obeys ORDER, so the order in which your configs are layed out matters, and have greater impact on the behaviour of your proxy server. For example, your own refresh_pattern configs should come first before the defaults. You have not commented on ignore-no-store and imho, you dont need to use it.
you config file is not sane, so you cant expect advanced settings to work when basic settings are not done properly. I think you would do better by understanding squid structure first before attempting to fiddle with cache settings. trial and error will only leave you frustrated.
Read: http://www.squid-cache.org/Doc/config/refresh_pattern/

Last edited by chitambira; 07-29-2009 at 09:51 AM.
 
Old 07-29-2009, 09:09 PM   #5
moekad
Member
 
Registered: Feb 2009
Posts: 64

Original Poster
Rep: Reputation: 15
hey thx alot
do u know any site where i can get a vedio can teach me everything regard squid?
Thanks alot =)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Squid+DansGuardian not working properly. squid blocking sites that should be linuxlover.chaitanya Linux - Server 13 11-10-2014 10:34 AM
squid conf: squid failed when I type insert redirect_program /usr/bin/squidguard laxmantsharma Linux - Software 1 02-24-2009 06:02 AM
Squid 2.6 Reverse Proxy from Squid(3128) to OrginServer(80) Not working rraj Linux - Server 0 06-06-2008 02:29 PM
LDAP authentication for squid squid 2.6.STABLE16 release 2.fc8 farrukhndm Linux - Security 2 04-03-2008 01:57 AM
squid conf: squid failed when I type insert redirect_program /usr/bin/squidguard Niceman2005 Linux - Software 1 11-24-2004 02:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration