'프로그램 사용/squid'에 해당되는 글 33건

  1. 2019.04.04 squid 캐시에 합류하기
  2. 2019.04.04 squid hierarchy와 cache
  3. 2019.04.03 squid storeid... 에러
  4. 2019.04.03 squid storeid
  5. 2019.04.02 squid storeurl_rewrite
  6. 2019.03.27 lynx proxy
  7. 2019.03.15 url_rewriter squid
  8. 2019.03.14 squid hierarchy
  9. 2019.03.14 squid url_rewrite_program
  10. 2019.03.01 squid log code
프로그램 사용/squid2019. 4. 4. 15:21

음.. parent로 hier_direct를 돌릴순 있는데

그럼 자기 자신 혼자 사용중에는 자신이 parent가 아닌건가?

4.1 How do I join a cache hierarchy?
To place your cache in a hierarchy, use the cache_host directive in squid.conf to specify the parent and sibling nodes.

For example, the following squid.conf file on childcache.example.com configures its cache to retrieve data from one parent cache and two sibling caches:

        #  squid.conf - On the host: childcache.example.com
        #
        #  Format is: hostname  type  http_port  udp_port
        #
        cache_host parentcache.example.com   parent  3128 3130
        cache_host childcache2.example.com   sibling 3128 3130
        cache_host childcache3.example.com   sibling 3128 3130
The cache_host_domain directive allows you to specify that certain caches siblings or parents for certain domains:

        #  squid.conf - On the host: sv.cache.nlanr.net
        #
        #  Format is: hostname  type  http_port  udp_port
        #

        cache_host electraglide.geog.unsw.edu.au parent 3128 3130
        cache_host cache1.nzgate.net.nz          parent 3128 3130
        cache_host pb.cache.nlanr.net   parent 3128 3130
        cache_host it.cache.nlanr.net   parent 3128 3130
        cache_host sd.cache.nlanr.net   parent 3128 3130
        cache_host uc.cache.nlanr.net   sibling 3128 3130
        cache_host bo.cache.nlanr.net   sibling 3128 3130
        cache_host_domain electraglide.geog.unsw.edu.au .au
        cache_host_domain cache1.nzgate.net.nz   .au .aq .fj .nz
        cache_host_domain pb.cache.nlanr.net     .uk .de .fr .no .se .it
        cache_host_domain it.cache.nlanr.net     .uk .de .fr .no .se .it
        cache_host_domain sd.cache.nlanr.net     .mx .za .mu .zm
The configuration above indicates that the cache will use pb.cache.nlanr.net and it.cache.nlanr.net for domains uk, de, fr, no, se and it, sd.cache.nlanr.net for domains mx, za, mu and zm, and cache1.nzgate.net.nz for domains au, aq, fj, and nz.

[링크 : http://www.comfsm.fm/computing/squid/FAQ-4.html]

[링크 : https://www.christianschenk.org/blog/using-a-parent-proxy-with-squid/]

'프로그램 사용 > squid' 카테고리의 다른 글

squid hierarchy와 cache  (0) 2019.04.04
squid storeid... 에러  (0) 2019.04.03
squid storeid  (0) 2019.04.03
squid storeurl_rewrite  (0) 2019.04.02
lynx proxy  (0) 2019.03.27
Posted by 구차니
프로그램 사용/squid2019. 4. 4. 07:49

관련 문서 정리

흐음.. hier_direct를 못하도록 막으면 통신이 안되고 어떻게 할 방법이 없나..

캐시 구조에서 상위로 돌리도록 하고 상위에서 어떻게 처리가 가능할줄 알았는데..

 

[링크 : http://www.squid-cache.org/Doc/config/nonhierarchical_direct/]

[링크 : https://wiki.squid-cache.org/Features/CacheHierarchy]

[링크 : https://wiki.squid-cache.org/SquidFaq/SquidLogs#Hierarchy_Codes]

[링크 : http://www.squid-cache.org/Doc/config/url_rewrite_program/]

[링크 : https://github.com/rchunping/squid-urlrewrite]

'프로그램 사용 > squid' 카테고리의 다른 글

squid 캐시에 합류하기  (0) 2019.04.04
squid storeid... 에러  (0) 2019.04.03
squid storeid  (0) 2019.04.03
squid storeurl_rewrite  (0) 2019.04.02
lynx proxy  (0) 2019.03.27
Posted by 구차니
프로그램 사용/squid2019. 4. 3. 14:50

storeid를 해보려고 ruby 스크립트까지 해보는데 안되서 급 멘붕..

에러를 천천히 보니 일단은 new_format.rb가 실행이 안되는 듯한데

# systemctl status squid 
● squid.service - Squid caching proxy 
   Loaded: loaded (/usr/lib/systemd/system/squid.service; enabled; vendor preset: disabled) 
   Active: failed (Result: exit-code) since 수 2019-04-03 14:40:47 KST; 5ms ago 
  Process: 20020 ExecStop=/usr/sbin/squid -k shutdown -f $SQUID_CONF (code=exited, status=1/FAILURE) 
  Process: 19848 ExecStart=/usr/sbin/squid $SQUID_OPTS -f $SQUID_CONF (code=exited, status=0/SUCCESS) 
  Process: 19842 ExecStartPre=/usr/libexec/squid/cache_swap.sh (code=exited, status=0/SUCCESS) 
 Main PID: 19851 (code=exited, status=1/FAILURE) 

 4월 03 14:40:47 localhost squid[19851]: Squid Parent: (squid-1) process 19990 started 
 4월 03 14:40:47 localhost (squid-1)[19990]: The store_id helpers are crashing too rapidly, need help! 
 4월 03 14:40:47 localhost squid[19851]: Squid Parent: (squid-1) process 19990 exited with status 1 
 4월 03 14:40:47 localhost squid[19851]: Squid Parent: (squid-1) process 19990 will not be restarted due to repeated, frequent failures 
 4월 03 14:40:47 localhost squid[19851]: Exiting due to repeated, frequent failures 
 4월 03 14:40:47 localhost systemd[1]: squid.service: main process exited, code=exited, status=1/FAILURE 
 4월 03 14:40:47 localhost squid[20020]: squid: ERROR: Could not send signal 15 to process 19990: (3) No such process 
 4월 03 14:40:47 localhost systemd[1]: squid.service: control process exited, code=exited status=1 
 4월 03 14:40:47 localhost systemd[1]: Unit squid.service entered failed state. 
 4월 03 14:40:47 localhost systemd[1]: squid.service failed. 

 

퍼미션은 진작에 +x로 줬는데 안되고

If you get this error:

FATAL: The store_id helpers are crashing too rapidly, need help!

check for permssions

[링크 : https://github.com/rudiservo/pfsense_storeid]

 

그냥 해당 스크립트를 실행해보니 에러 발생.. libxml...?

# ruby new_format.rb
/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- libxml (LoadError)
        from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
        from new_format.rb:8:in `'

그래서 검색해서 해당 모듈을 까는데 안깔린다!!!

# gem install -r libxml-ruby 
Fetching: libxml-ruby-3.1.0.gem (100%) 
Building native extensions.  This could take a while... 
ERROR:  Error installing libxml-ruby: 
        ERROR: Failed to build gem native extension. 

    /usr/bin/ruby extconf.rb 
mkmf.rb can't find header files for ruby at /usr/share/include/ruby.h 


Gem files will remain installed in /usr/local/share/gems/gems/libxml-ruby-3.1.0 for inspection. 
Results logged to /usr/local/share/gems/gems/libxml-ruby-3.1.0/ext/libxml/gem_make.out 

[링크 : https://github.com/xml4r/libxml-ruby]

 

ruby 모듈 하나 설치하려고 먼가 잔뜩 깔게 하다니..

yum install gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison iconv-devel ruby-devel libxml2 libxml2-devel libxslt libxslt-devel git

[링크 : https://gist.github.com/lovellfelix/8135631]

'프로그램 사용 > squid' 카테고리의 다른 글

squid 캐시에 합류하기  (0) 2019.04.04
squid hierarchy와 cache  (0) 2019.04.04
squid storeid  (0) 2019.04.03
squid storeurl_rewrite  (0) 2019.04.02
lynx proxy  (0) 2019.03.27
Posted by 구차니
프로그램 사용/squid2019. 4. 3. 13:32

store_urlrewrite_progam 을 써보려고 했더니 2.7 only로 되어 있어서..

Feature: Store URL Rewriting?
Goal: Separate out the URL used for storage lookups from the URL used for forwarding. This allows for multiple destination URLs to reference the same backend content and cut back on duplicated content, both for forward proxies (think "google maps") and CDN type reverse proxies.

Status: deprecated. see StoreID

[링크 : https://wiki.squid-cache.org/Features/StoreUrlRewrite]

 

이걸 봐야 할 듯..

[링크 : https://wiki.squid-cache.org/Features/StoreID]

'프로그램 사용 > squid' 카테고리의 다른 글

squid hierarchy와 cache  (0) 2019.04.04
squid storeid... 에러  (0) 2019.04.03
squid storeurl_rewrite  (0) 2019.04.02
lynx proxy  (0) 2019.03.27
url_rewriter squid  (0) 2019.03.15
Posted by 구차니
프로그램 사용/squid2019. 4. 2. 19:05

squid의 cache는 url과 rewrite된 url을 기준으로 매칭을 한다는데

다르게 생각하면.. GET 방식으로 주소가 줄줄이 붙어 버리면 당연히 url이 매치가 안되니 hit 할 수 없고

rewrite를 통해서 특정 인자를 빼버리고 놔두면 캐싱이 되려나?

(근데 생각해보면.. youtube에서 많은 부분이 HIRE_NONE이라.. 될런지)

 

[링크 : https://stackoverflow.com/questions/2721919/how-to-ignore-query-parameters-in-web-cache]

[링크 : http://www.squid-cache.org/Doc/config/storeurl_rewrite_program/]

[링크 : http://alter.org.ua/soft/win/squid_url_rewrite/]

'프로그램 사용 > squid' 카테고리의 다른 글

squid storeid... 에러  (0) 2019.04.03
squid storeid  (0) 2019.04.03
lynx proxy  (0) 2019.03.27
url_rewriter squid  (0) 2019.03.15
squid hierarchy  (0) 2019.03.14
Posted by 구차니
프로그램 사용/squid2019. 3. 27. 18:14

귀찮을때 lynx로 테스트 하는데 얘도 proxy 설정가능한지 찾아보니 된다네?

 

$ sudo vi /etc/lynx-site.cfg
http_proxy:http://proxy.abc.xyz:8080

[링크 : https://stackoverflow.com/questions/32822161/how-do-i-set-proxy-for-lynx]

[링크 : https://www.linuxquestions.org/questions/linux-networking-3/proxy-setting-in-lynx-230111/]

'프로그램 사용 > squid' 카테고리의 다른 글

squid storeid  (0) 2019.04.03
squid storeurl_rewrite  (0) 2019.04.02
url_rewriter squid  (0) 2019.03.15
squid hierarchy  (0) 2019.03.14
squid url_rewrite_program  (0) 2019.03.14
Posted by 구차니
프로그램 사용/squid2019. 3. 15. 16:23

store url_rewrite_program within ssl bump


[링크 : https://github.com/rchunping/squid-urlrewrite]

[링크 : https://mindchasers.com/dev/app-squid-redirect]


[링크 : https://www.npmjs.com/package/nodecap2]

'프로그램 사용 > squid' 카테고리의 다른 글

squid storeurl_rewrite  (0) 2019.04.02
lynx proxy  (0) 2019.03.27
squid hierarchy  (0) 2019.03.14
squid url_rewrite_program  (0) 2019.03.14
squid log code  (0) 2019.03.01
Posted by 구차니
프로그램 사용/squid2019. 3. 14. 13:01

두개가 연관이 있는 것 같으면서도 다른거 같은데


계층을 두어 관리하는 이유는 (캐시 계층)

squid 하나가 전체를 캐싱하는게 아니라 부모나 친척 노드에서 분산해서 캐시를 저장하기 위함으로 보인다.

[링크 : https://wiki.squid-cache.org/Features/CacheHierarchy]


그리고 그 계층과는 다르게 데이터를 분석함으로서

어떤 계층으로 나누어서 캐싱을 할지에 대한게 HTTP 프로토콜 레벨에서의 계층으로 나누고

그 계층에서 열외되는 애들은 캐싱을 하지 않도록 한다는 내용

What makes a request hierarchic

The purpose of cache hierarchy is to maximize the chance of finding objects in siblings, so a set of heuristics is applied to try and determine in advance whether an object is likely to be cacheable. A few objects are not cacheable, and are thus not hierarchic. Those are:

  • reload requests
  • cache validations with non-Squid ICP peers
  • requests for HTTP methods other than GETHEAD or TRACE

  • authenticated requests 


[링크 : https://wiki.squid-cache.org/KnowledgeBase/HierarchyControl]


'프로그램 사용 > squid' 카테고리의 다른 글

lynx proxy  (0) 2019.03.27
url_rewriter squid  (0) 2019.03.15
squid url_rewrite_program  (0) 2019.03.14
squid log code  (0) 2019.03.01
squid hier/none direct 관련 설정  (0) 2019.02.27
Posted by 구차니
프로그램 사용/squid2019. 3. 14. 11:19

예전에 찾던 것 중에 php를 통해 무언가를 쓰는게 있었는데

얘 명칭이 helper multiplexer인 듯.

근데 어떤 포맷으로 데이터를 넘겨서 실행하게 하는지에 대해서는 안보이네?


2.4 Helper Multiplexer

The helper multiplexer's purpose is to relieve some of the burden Squid has when dealing with slow helpers. It does so by acting as a middleman between squid and the actual helpers, talking to Squid via the multiplexed concurrent variant of the helper protocol and to the helpers via the non-concurrent variant.

Helpers are started on demand, and in theory the muxer can handle up to 1k helpers per instance. It's up to squid to decide how many helpers to start.

The muxer knows nothing about the actual messages being passed around, and as such can't really (yet?) compensate for broken helpers. It is not yet able to manage dying helpers, but it will.

To configure the multiplexer add its binary name (usually /usr/share/libexec/helper-mux.pl) in front of the name of whichever helper is being multiplexed. It takes the helper binary path and parameters as its own command parameters. The concurrency setting already existing in Squid is used to configure how many child helpers it may run.

For example, a traditional configuration is

        url_rewrite_program /your/redirector.sh
        url_rewrite_children 5
   
the alternative multiplexer configuration is:
        url_rewrite_program /usr/share/libexec/helper-mux.pl /your/redirector.sh
        url_rewrite_children 1 concurrency=5
   

Helpers which are already concurrent protocol enabled gain little benefit from the multiplexer on most systems. However on some systems where Squid spawning helpers causes excess memory usage the reduction in direct helper spawned by Squid can result in a great reduction in resource use.

The helper can be controlled using various signals:

  • SIGHUP: dump the state of all helpers to STDERR

[링크 : ftp://ftp.arnes.si/packages/squid/squid-3.2.14-RELEASENOTES.html]


 # OPTIONS FOR URL REWRITING

# ----------------------------------------------------------------------------- # TAG: storeurl_rewrite_program # Specify the location of the executable for the Store URL rewriter. # The Store URL rewriter allows URLs to be "normalised" ; mapping # multiple URLs to a single URL representation for cache operations. # # For example, if you request an object at: # # http://srv1.example.com/image.gif # # and a subsequent request for: # # http://srv2.example.com/image.gif # # then Squid will treat these both as different URLs and cache them # seperately. # # This is almost the normal case, but an increasing number of sites # distribute the same content between multiple frontend hosts. # The Store URL rewriter allows you to rewrite these URLs to one URL # to use for cache operations, but not -fetches-. Fetches are still # made from the original site, but stored with the store URL rewritten # URL as the store key. # # For each requested URL rewriter will receive on line with the format # # URL <SP> client_ip "/" fqdn <SP> user <SP> method <SP> urlgroup # [<SP> kvpairs] <NL> # # In the future, the rewriter interface will be extended with # key=value pairs ("kvpairs" shown above). Rewriter programs # should be prepared to receive and possibly ignore additional # whitespace-separated tokens on each input line. # # And the rewriter may return a rewritten URL. The other components of # the request line does not need to be returned (ignored if they are). # # By default, a Store URL rewriter is not used. # # Please note - the normal URL rewriter rewrites Squid's _destination_ # URL - ie, what it fetches. The Store URL rewriter rewrites Squid's # _store_ URL - ie, what it uses to store and retrieve objects. # #Default: # none


#  TAG: url_rewrite_program
#	Specify the location of the executable for the URL rewriter.
#	Since they can perform almost any function there isn't one included.
#
#	For each requested URL rewriter will receive on line with the format
#
#	URL <SP> client_ip "/" fqdn <SP> user <SP> method <SP> urlgroup
#	 [<SP> kvpairs] <NL>
#
#	In the future, the rewriter interface will be extended with
#	key=value pairs ("kvpairs" shown above).  Rewriter programs
#	should be prepared to receive and possibly ignore additional
#	whitespace-separated tokens on each input line.
#
#	And the rewriter may return a rewritten URL. The other components of
#	the request line does not need to be returned (ignored if they are).
#
#	The rewriter can also indicate that a client-side redirect should
#	be performed to the new URL. This is done by prefixing the returned
#	URL with "301:" (moved permanently) or 302: (moved temporarily).
#
#	It can also return a "urlgroup" that can subsequently be matched
#	in cache_peer_access and similar ACL driven rules. An urlgroup is
#	returned by prefixing the returned URL with "!urlgroup!".
#
#	By default, a URL rewriter is not used.
#
#Default: 

# none 

[링크 : http://alter.org.ua/soft/win/squid_url_rewrite/squid.conf]


[링크 : https://wiki.squid-cache.org/Features/HelperMultiplexer]

'프로그램 사용 > squid' 카테고리의 다른 글

url_rewriter squid  (0) 2019.03.15
squid hierarchy  (0) 2019.03.14
squid log code  (0) 2019.03.01
squid hier/none direct 관련 설정  (0) 2019.02.27
squid용 인증서 관련 (인증서 변환하기)  (0) 2019.02.25
Posted by 구차니
프로그램 사용/squid2019. 3. 1. 10:16

결과 코드들에 대해서 좀 더 자세히 나와있는데..

그래도 HIER_DIRECT를 어떻게 할 방법이 없나..


6.7 Squid result codes

The TCP_ codes refer to requests on the HTTP port (usually 3128). The UDP_ codes refer to requests on the ICP port (usually 3130). If ICP logging was disabled using the log_icp_queries option, no ICP replies will be logged.


The following result codes were taken from a Squid-2, compare with the log_tags struct in src/access_log.c:


TCP_HIT

A valid copy of the requested object was in the cache.


TCP_MISS

The requested object was not in the cache.


TCP_IMS_HIT

The client issued an IMS request for an object which was in the cache and fresh.


TCP_SWAPFAIL_MISS

The object was believed to be in the cache, but could not be accessed.


TCP_NEGATIVE_HIT

Request for a negatively cached object, e.g. "404 not found", for which the cache believes to know that it is inaccessible. Also refer to the explainations for negative_ttl in your squid.conf file.


TCP_MEM_HIT

A valid copy of the requested object was in the cache and it was in memory, thus avoiding disk accesses.


TCP_DENIED

Access was denied for this request.


TCP_OFFLINE_HIT

The requested object was retrieved from the cache during offline mode. The offline mode never validates any object, see offline_mode in squid.conf file. 

[링크 : http://www.comfsm.fm/computing/squid/FAQ-6.html#ss6.7]


6.10 Hierarchy Codes

The following hierarchy codes are used with Squid-2:


NONE

For TCP HIT, TCP failures, cachemgr requests and all UDP requests, there is no hierarchy information.


DIRECT

The object was fetched from the origin server. 

[링크 : http://www.comfsm.fm/computing/squid/FAQ-6.html#ss6.10]

'프로그램 사용 > squid' 카테고리의 다른 글

squid hierarchy  (0) 2019.03.14
squid url_rewrite_program  (0) 2019.03.14
squid hier/none direct 관련 설정  (0) 2019.02.27
squid용 인증서 관련 (인증서 변환하기)  (0) 2019.02.25
HSTS-HTTP Strict Transport Security / squid  (0) 2019.02.25
Posted by 구차니