프로그램 사용/squid2019. 2. 11. 11:03

squid 설정해도 무언가 저장하는게 없는거 같아 설정파일을 보다보니

cache_dir 이라는게 기본값으로는 주석처리 되어 있다. 

아무튼.. 이걸 해지하고 재가동하니 무언가 생기긴 하는데 내용을 보니


ufs라는 파일 시스템으로 생성되고 최대 100MB 까지 캐싱을 하도록 설정한다 라는 의미인 듯..

16 256 으로 이해


Edit the main configuration file, /etc/squid/squid.conf and confirm that the cache_dir directive is uncommented and looks similar to the following:
cache_dir ufs /var/spool/squid 100 16 256 

This line specifies the default settings for the cache_dir directive to be used in this example; it consists of the Squid storage format (ufs), the directory on the system where the cache resides (/var/spool/squid), the amount of disk space in megabytes to be used for the cache (100), and finally the number of first-level and second-level cache directories to be created (16 and 256 respectively). 

[링크 : https://access.redhat.com/.../sect-managing_confined_services-squid_caching_proxy-configuration_examples]



아래와 같은 형상으로 생겨났는데.. 저런 이유로(?) 1차, 2차 캐시로 구분이 되도록 생성되는 것으로 보인다.

# tree /var/spool/squid

/var/spool/squid

├── 00

│   ├── 00

│   │   ├── 00000000

│   │   ├── 00000001

│   │   ├── 00000002

│   │   ├── 00000003

...

│   │   ├── 0000005D

│   │   └── 0000005E

│   ├── 01

│   ├── 02

│   ├── 03

│   ├── 04

│   ├── 05

│   ├── 06

│   ├── 07

│   ├── 08

...

   └── FF

├── 01

│   ├── 00

│   ├── 01


...

│   └── FF

└── swap.state

 


파일 자체는.. DBase 3 데이터 파일이라는데... 실 데이터는 다른데 있는 건가?

# file /var/spool/squid/00/00/*

/var/spool/squid/00/00/00000000: DBase 3 data file (1049344 records)

/var/spool/squid/00/00/00000001: DBase 3 data file (1049344 records)

/var/spool/squid/00/00/00000002: DBase 3 data file (1049344 records)

/var/spool/squid/00/00/00000003: DBase 3 data file (1049344 records)

/var/spool/squid/00/00/00000004: DBase 3 data file (1049344 records)

/var/spool/squid/00/00/00000005: DBase 3 data file (1049344 records)

/var/spool/squid/00/00/00000006: little endian ispell hash file (?), 8-bit, no capitalization, 26 flags and 768 string characters

... 



Posted by 구차니
프로그램 사용/squid2019. 2. 11. 10:50

윈도우 기준으로 이야기 하면 크롬에서 설정하는게 아니라

크롬에서는 윈도우 네트워크의 proxy 설정창을 띄워준다.



그리고 나서 LAN 설정의 프록시 서버에, squid를 설치한 서버의 아이피를 치고

squid의 포트를 입력해주면 되는데 해당 설정 파일을 열어보면 아래와 비슷하게 나올 것인데...

# cat /etc/squid/squid.conf

#

# Recommended minimum configuration:

#


# Example rule allowing access from your local networks.

# Adapt to list your (internal) IP networks from where browsing

# should be allowed

acl localnet src 192.168.0.0/16 # RFC1918 possible internal network


acl SSL_ports port 443

acl Safe_ports port 80          # http

acl Safe_ports port 21          # ftp

acl Safe_ports port 443         # https

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


#

# Recommended minimum Access Permission configuration:

#

# Deny requests to certain unsafe ports

http_access deny !Safe_ports


# Deny CONNECT to other than secure SSL ports

http_access deny CONNECT !SSL_ports


# Only allow cachemgr access from localhost

http_access allow localhost manager

http_access deny manager


# We strongly recommend the following be uncommented to protect innocent

# web applications running on the proxy server who think the only

# one who can access services on "localhost" is a local user

#http_access deny to_localhost


#

# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS

#


# Example rule allowing access from your local networks.

# Adapt localnet in the ACL section to list your (internal) IP networks

# from where browsing should be allowed

http_access allow localnet

http_access allow localhost


# And finally deny all other access to this proxy

http_access deny all


# Squid normally listens to port 3128

http_port 3128


# Uncomment and adjust the following to add a disk cache directory.

cache_dir ufs /var/spool/squid 100 16 256


# Leave coredumps in the first cache dir

coredump_dir /var/spool/squid


#

# Add any of your own refresh_pattern entries above these.

#

refresh_pattern ^ftp:           1440    20%     10080

refresh_pattern ^gopher:        1440    0%      1440

refresh_pattern -i (/cgi-bin/|\?) 0     0%      0

refresh_pattern .               0       20%     4320 


별다른 설정을 바꾸지 않았다면 기본값인 3128을 입력해주면 된다.


HIT라고 뜨는게 너무 없네..

다들 정적 페이지가 아니다 보니 그런건가.. 아니면 SSL 문제일려나?

$ cat /var/log/squid/access.log | grep HIT

1549848287.564      0 10.0.0.4 TCP_INM_HIT/304 334 GET http://auction.co.kr/ - HIER_NONE/- text/html

1549848307.300      0 10.0.0.4 TCP_IMS_HIT/304 315 GET http://image.iacstatic.co.kr/allkill/item/2019/02/20190208084157581r.jpg - HIER_NONE/- image/jpeg

1549848307.301      0 10.0.0.4 TCP_IMS_HIT/304 315 GET http://image.iacstatic.co.kr/allkill/item/2019/02/20190208104540991r.jpg - HIER_NONE/- image/jpeg

1549848307.303      0 10.0.0.4 TCP_IMS_HIT/304 315 GET http://image.iacstatic.co.kr/allkill/item/2019/02/20190208120658951r.jpg - HIER_NONE/- image/jpeg

1549848308.566      0 10.0.0.4 TCP_INM_HIT/304 333 GET http://www.auction.co.kr/ - HIER_NONE/- text/html

1549848310.806      0 10.0.0.4 TCP_INM_HIT/304 333 GET http://www.auction.co.kr/ - HIER_NONE/- text/html

1549848311.449      0 10.0.0.4 TCP_IMS_HIT/304 315 GET http://image.iacstatic.co.kr/allkill/item/2019/02/20190208110027731r.jpg - HIER_NONE/- image/jpeg

1549848311.453      0 10.0.0.4 TCP_IMS_HIT/304 315 GET http://image.iacstatic.co.kr/allkill/item/2019/02/20190208105748851r.jpg - HIER_NONE/- image/jpeg

1549848311.453      0 10.0.0.4 TCP_IMS_HIT/304 315 GET http://image.iacstatic.co.kr/allkill/item/2019/02/20190208095050481r.jpg - HIER_NONE/- image/jpeg

1549848521.823      0 10.0.0.4 TCP_MEM_HIT/200 1013 GET http://ocsp.trust-provider.com/MFEwTzBNMEswSTAJBgUrDgMCGgUABBR8sWZUnKvbRO5iJhat9GV793rVlAQUrb2YejS0Jvf6xCZU7wO94CTLVBoCEENSAj%2F6qJAfE5%2Fj9OXBRE4%3D - HIER_NONE/- application/ocsp-response

1549848521.832      0 10.0.0.4 TCP_MEM_HIT/200 852 GET http://ocsp.comodoca4.com/MFEwTzBNMEswSTAJBgUrDgMCGgUABBTrJdiQ%2Ficg9B19asFe73bPYs%2BreAQUdXGnGUgZvJ2d6kFH35TESHeZ03kCEFslzmkHxCZVZtM5DJmpVK0%3D - HIER_NONE/- application/ocsp-response

1549848559.829      0 10.0.0.4 TCP_MEM_HIT/200 961 GET http://ocsp.digicert.com/MFEwTzBNMEswSTAJBgUrDgMCGgUABBTBL0V27RVZ7LBduom%2FnYB45SPUEwQU5Z1ZMIJHWMys%2BghUNoZ7OrUETfACEAi4elAbvpzaLRZNPjlRv1U%3D - HIER_NONE/- application/ocsp-response

1549848559.835      0 10.0.0.4 TCP_MEM_HIT/200 961 GET http://ocsp.digicert.com/MFEwTzBNMEswSTAJBgUrDgMCGgUABBTBL0V27RVZ7LBduom%2FnYB45SPUEwQU5Z1ZMIJHWMys%2BghUNoZ7OrUETfACEAiIzVJfGSRETRSlgpHeuVI%3D - HIER_NONE/- application/ocsp-response

1549848559.840      0 10.0.0.4 TCP_MEM_HIT/200 961 GET http://ocsp.digicert.com/MFEwTzBNMEswSTAJBgUrDgMCGgUABBTBL0V27RVZ7LBduom%2FnYB45SPUEwQU5Z1ZMIJHWMys%2BghUNoZ7OrUETfACEAtqs7A%2Bsan2xGCSaqjN%2FrM%3D - HIER_NONE/- application/ocsp-response

1549848559.846      0 10.0.0.4 TCP_MEM_HIT/200 961 GET http://ocsp.digicert.com/MFEwTzBNMEswSTAJBgUrDgMCGgUABBTBL0V27RVZ7LBduom%2FnYB45SPUEwQU5Z1ZMIJHWMys%2BghUNoZ7OrUETfACEA8sEMlbBsCTf7jUSfg%2BhWk%3D - HIER_NONE/- application/ocsp-response 


일단.. TCP_MISS/200 이면 캐싱되지 않아서 원서버에 직접 요청해서 받는거 같은데

TCP_IMS_HIT/304 이런건 거의 안뜨네...

Such as when an allstaff email goes out saying "check this site out..."

  • TCP_MISS/200 means that the requested document was not in the cache but it could fetch it OK from the web server. The direct at the end says that the file was fetched from the webserver.
  • TCP_IMS_HIT/304 means that the client asked if the file has changed, and squid checked its date/time on the webserver and found it had not changed, so it gave a copy of the file to the client out of its local cache. 

[링크 : https://askubuntu.com/questions/323241/how-to-know-if-squid-proxy-is-doing-the-cache-correctly]

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

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

haproxy - https proxy  (0) 2019.02.11
squid cache directory  (0) 2019.02.11
squid 설치 및 설정 유틸리티  (0) 2019.02.08
squid 상태 모니터링  (0) 2019.02.08
https proxy - squid  (0) 2019.02.07
Posted by 구차니
Programming/react.js2019. 2. 10. 22:07

먼가.. 신기한 키워드로 조합이 되었다 -ㅁ-?


[링크 : https://react-bootstrap.github.io/getting-started/introduction/]

[링크 : https://medium.com/@khwsc1/react에-간편하게-bootstrap-4를-달아보자-fdb646904363]

'Programming > react.js' 카테고리의 다른 글

react.js 를 node.js 에서 사용하기 예제  (0) 2019.02.20
react store / flux pattern  (0) 2019.02.01
react.js context, component thru  (0) 2019.02.01
react import {}  (0) 2019.01.31
react html to jsx  (0) 2019.01.29
Posted by 구차니
Programming/bootstrap2019. 2. 10. 22:02

대개 상단 큰 이미지를 여러개 슬라이드 하는 녀석으로 쓰이는 듯?


[링크 : https://getbootstrap.com/docs/4.2/components/carousel/]

'Programming > bootstrap' 카테고리의 다른 글

부트스트랩 상단 메뉴와 container  (0) 2019.02.10
부트스트랩 상단 메뉴 고정하기  (0) 2019.02.09
Posted by 구차니
Programming/bootstrap2019. 2. 10. 18:38

엥.. 머가 엉겼던 걸까.. 이전 버전을 남기지 않고 하다보니 뇌가 꼬였나..

아무튼 nav 안에 .container 해서 적절하게 영역을 나눌수가 있다.



[링크 : https://getbootstrap.com/docs/4.2/components/navbar/]

[링크 : http://pjh445.blog.me/221160822054]

'Programming > bootstrap' 카테고리의 다른 글

부트스트랩 carousel  (0) 2019.02.10
부트스트랩 상단 메뉴 고정하기  (0) 2019.02.09
Posted by 구차니
Programming/bootstrap2019. 2. 9. 18:50

jquery랑 같이 찾아 보는 중


stikcy-top은 상단 공간을 먹으면서(차지하면서) 위에 고정하고

fixed-top은 상단 공간을 차지하지 않고 위에 고정된다. (일부 내용이 상단 메뉴바에 가려져서 안보일 수 있다)


[링크 : http://pjh445.blog.me/221160822054]

[링크 : https://www.codingfactory.net/10745]

'Programming > bootstrap' 카테고리의 다른 글

부트스트랩 carousel  (0) 2019.02.10
부트스트랩 상단 메뉴와 container  (0) 2019.02.10
Posted by 구차니
프로그램 사용/squid2019. 2. 8. 16:24

웬지 모를 파이썬의 스멜이 난다..


[링크 : https://sourceforge.net/projects/squidgui/files/]

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

haproxy - https proxy  (0) 2019.02.11
squid cache directory  (0) 2019.02.11
squid + 크롬 설정 및 log 확인  (0) 2019.02.11
squid 상태 모니터링  (0) 2019.02.08
https proxy - squid  (0) 2019.02.07
Posted by 구차니
프로그램 사용/squid2019. 2. 8. 16:22

centos 에서는 squid 패키지에 포함된 것으로 보이는데


아래 명령어로 무언가 나오는데 멀 보는진 모르겠다 -_ㅠ

# squidclient -h localhost cache_object://localhost/ mgr:utilization 


# squidclient -h localhost cache_object://localhost/counters 

HTTP/1.1 200 OK

Server: squid/3.5.20

Mime-Version: 1.0

Date: Mon, 11 Feb 2019 08:04:04 GMT

Content-Type: text/plain;charset=utf-8

Expires: Mon, 11 Feb 2019 08:04:04 GMT

Last-Modified: Mon, 11 Feb 2019 08:04:04 GMT

X-Cache: MISS from localhost.localdomain

X-Cache-Lookup: MISS from localhost.localdomain:3128

Via: 1.1 localhost.localdomain (squid/3.5.20)

Connection: close


sample_time = 1549872194.638742 (Mon, 11 Feb 2019 08:03:14 GMT)

client_http.requests = 1074

client_http.hits = 0

client_http.errors = 5

client_http.kbytes_in = 977

client_http.kbytes_out = 4855

client_http.hit_kbytes_out = 0

server.all.requests = 707

server.all.errors = 0

server.all.kbytes_in = 4728

server.all.kbytes_out = 1001

server.http.requests = 707

server.http.errors = 0

server.http.kbytes_in = 4728

server.http.kbytes_out = 1001

server.ftp.requests = 0

server.ftp.errors = 0

server.ftp.kbytes_in = 0

server.ftp.kbytes_out = 0

server.other.requests = 0

server.other.errors = 0

server.other.kbytes_in = 0

server.other.kbytes_out = 0

icp.pkts_sent = 0

icp.pkts_recv = 0

icp.queries_sent = 0

icp.replies_sent = 0

icp.queries_recv = 0

icp.replies_recv = 0

icp.query_timeouts = 0

icp.replies_queued = 0

icp.kbytes_sent = 0

icp.kbytes_recv = 0

icp.q_kbytes_sent = 0

icp.r_kbytes_sent = 0

icp.q_kbytes_recv = 0

icp.r_kbytes_recv = 0

icp.times_used = 0

cd.times_used = 0

cd.msgs_sent = 0

cd.msgs_recv = 0

cd.memory = 0

cd.local_memory = 7

cd.kbytes_sent = 0

cd.kbytes_recv = 0

unlink.requests = 843

page_faults = 0

select_loops = 25783

cpu_time = 8.574439

wall_time = 49.492095

swap.outs = 216

swap.ins = 0

swap.files_cleaned = 0

aborted_requests = 4


# squidclient -h localhost mgr:info

HTTP/1.1 200 OK

Server: squid/3.5.20

Mime-Version: 1.0

Date: Mon, 11 Feb 2019 08:02:00 GMT

Content-Type: text/plain;charset=utf-8

Expires: Mon, 11 Feb 2019 08:02:00 GMT

Last-Modified: Mon, 11 Feb 2019 08:02:00 GMT

X-Cache: MISS from localhost.localdomain

X-Cache-Lookup: MISS from localhost.localdomain:3128

Via: 1.1 localhost.localdomain (squid/3.5.20)

Connection: close


Squid Object Cache: Version 3.5.20

Build Info:

Service Name: squid

Start Time:     Mon, 11 Feb 2019 07:51:14 GMT

Current Time:   Mon, 11 Feb 2019 08:02:00 GMT

Connection information for squid:

        Number of clients accessing cache:      2

        Number of HTTP requests received:       1018

        Number of ICP messages received:        0

        Number of ICP messages sent:    0

        Number of queued ICP replies:   0

        Number of HTCP messages received:       0

        Number of HTCP messages sent:   0

        Request failure ratio:   0.00

        Average HTTP requests per minute since start:   94.5

        Average ICP messages per minute since start:    0.0

        Select loop called: 23961 times, 26.970 ms avg

Cache information for squid:

        Hits as % of all requests:      5min: 0.0%, 60min: 0.0%

        Hits as % of bytes sent:        5min: 1.9%, 60min: 2.1%

        Memory hits as % of hit requests:       5min: 0.0%, 60min: 0.0%

        Disk hits as % of hit requests: 5min: 0.0%, 60min: 0.0%

        Storage Swap size:      91804 KB

        Storage Swap capacity:  89.7% used, 10.3% free

        Storage Mem size:       3860 KB

        Storage Mem capacity:    1.5% used, 98.5% free

        Mean Object Size:       135.20 KB

        Requests given to unlinkd:      843

Median Service Times (seconds)  5 min    60 min:

        HTTP Requests (All):   0.04277  0.05633

        Cache Misses:          0.03241  0.03829

        Cache Hits:            0.00000  0.00000

        Near Hits:             0.00000  0.00000

        Not-Modified Replies:  0.00000  0.00000

        DNS Lookups:           0.11405  0.11926

        ICP Queries:           0.00000  0.00000

Resource usage for squid:

        UP Time:        646.235 seconds

        CPU Time:       8.031 seconds

        CPU Usage:      1.24%

        CPU Usage, 5 minute avg:        1.71%

        CPU Usage, 60 minute avg:       1.32%

        Maximum Resident Size: 237808 KB

        Page faults with physical i/o: 0

Memory accounted for:

        Total accounted:         7691 KB

        memPoolAlloc calls:    224798

        memPoolFree calls:     231466

File descriptor usage for squid:

        Maximum number of file descriptors:   16384

        Largest file desc currently in use:     69

        Number of file desc currently in use:   31

        Files queued for open:                   0

        Available number of file descriptors: 16353

        Reserved number of file descriptors:   100

        Store Disk files open:                   0

Internal Data Structures:

           740 StoreEntries

           273 StoreEntries with MemObjects

           264 Hot Object Cache Items

           679 on-disk objects


[링크 : http://www.monitis.com/blog/how-to-monitor-squid-proxy-server/]

[링크 : https://linux.die.net/man/1/squidclient]

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

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

haproxy - https proxy  (0) 2019.02.11
squid cache directory  (0) 2019.02.11
squid + 크롬 설정 및 log 확인  (0) 2019.02.11
squid 설치 및 설정 유틸리티  (0) 2019.02.08
https proxy - squid  (0) 2019.02.07
Posted by 구차니

많네... 귀찮은데 걍 openstack 까는게 편하려나?


[링크 : https://www.linux-kvm.org/page/Management_Tools]



+

아래 두개가 라이센스(apache)문제 없이 쓸수 있는 웹 기반으로 보이고

UI가 심플해서(libvirt 만 지원하는 녀석이라) 무난해 보인다.


[링크 : https://ovirt.org/download/]

[링크 : https://github.com/retspen/webvirtmgr/wiki/Screenshots]

Posted by 구차니

forward는 -ing 붙여서 보면 좀 더 쉬울거 같은 개념..

forward proxy는 proxy에게 요청해서 받은 데이터를 "전달"해 받는 녀석이라면

(물론 forward proxy에 대개 caching 기능이 있기에 외부 대역폭을 줄이는 역활도 함)


reverse proxy는 사용자가 아닌 서버단에 적용하여 외부로 부터의 공격을 막아내는 용도로 쓰이는 개념

사용자가 proxy를 접근해서 쓰는걸 정방향이라고 보면 서버로는 역방향으로 쓴 듯?


[링크 : https://www.lesstif.com/pages/viewpage.action?pageId=21430345]

'이론 관련 > 네트워크 관련' 카테고리의 다른 글

FTPS  (0) 2021.02.07
UDP와 MTU?  (0) 2020.09.07
TLS 암호화 (구, SSL)  (0) 2019.02.07
오픈스택 openstack  (0) 2018.06.27
SDN - Software Defined Networking  (0) 2018.06.27
Posted by 구차니