差異處

這裏顯示兩個版本的差異處。

連向這個比對檢視

兩邊的前次修訂版 前次修改
下次修改
前次修改
tech:squid [2024/04/25 11:06] – 啟用環境變數 jonathantech:squid [2024/09/26 17:57] (目前版本) – 新增 0-Day Vulnerabilities 警告訊息 jonathan
行 1: 行 1:
 ====== Squid Proxy Server 安裝設定 ====== ====== Squid Proxy Server 安裝設定 ======
 +
 +<WRAP center round important 60%>
 +  * 因為在 OpenVAS 主機弱掃會出現 **Squid Multiple 0-Day Vulnerabilities (Oct 2023)**
 +  * 目前改用 [[tech/tinyproxy]] 來替代 Squid
 +</WRAP>
 +
 ====== 使用 docker compose 方式 ===== ====== 使用 docker compose 方式 =====
-  * 採用 [[https://hub.docker.com/r/elestio/squid|elestio/squid 版本]] <cli>+  * 採用 [[https://hub.docker.com/r/ubuntu/squid|ubuntu/squid 版本]] <cli>
 vi docker-compose.yml vi docker-compose.yml
 </cli><file> </cli><file>
-version: '3' 
 services: services:
   squid:   squid:
-    image: elestio/squid:latest+    image: ubuntu/squid:latest
     hostname: squid     hostname: squid
     container_name: squid     container_name: squid
     environment:      environment: 
-      - SQUID_CONFIG_FILE=/etc/squid/squid.conf+      - TZ=Asia/Taipei
     ports:     ports:
       - 3128:3128       - 3128:3128
行 26: 行 31:
 </cli> </cli>
   - 修改 docker-compose.yml <file>   - 修改 docker-compose.yml <file>
-version: '3' 
 services: services:
   squid:   squid:
-    image: elestio/squid:latest+    image: ubuntu/squid:latest
     hostname: squid     hostname: squid
     container_name: squid     container_name: squid
     environment:     environment:
-      - SQUID_CONFIG_FILE=/etc/squid/squid.conf+      - TZ=Asia/Taipei
     ports:     ports:
       - 3128:3128       - 3128:3128
行 61: 行 65:
 </cli> </cli>
  
-====== 使用 docker 方式 ===== +==== Q1 : 如果要修改 container 內的 /etc/hosts ==== 
-  * 採用 [[https://hub.docker.com/r/ubuntu/squid|Ubuntu/squid 版本]] <cli> +  * 參考 - https://stackoverflow.com/questions/74014600/custom-etc-hosts-file-in-dockerfile 
-sudo docker run ---restart=always --name squid-container -TZ=UTC -3128:3128 ubuntu/squid:latest+  將 docker-compose.yml 內加上 extra_hosts: 
 +  - 加上要指定的 hostname 與 IP 資訊 Exp. "www.ichiayi.com:192.168.11.133" "web.ichiayi.com:192.168.11.134" 
 +  - 範例如下:<file> 
 +services: 
 +  squid: 
 +    image: ubuntu/squid:latest 
 +    hostname: squid 
 +    container_name: squid 
 +    environment: 
 +      - TZ=Asia/Taipei 
 +    extra_hosts: 
 +      - "www.ichiayi.com:192.168.11.133"  
 +      - "web.ichiayi.com:192.168.11.134" 
 +    ports: 
 +      - 3128:3128 
 +    volumes: 
 +      - './conf/squid.conf:/etc/squid/squid.conf:ro' 
 +    #   - './conf/passwords:/etc/squid/passwords:ro' 
 +    restart: always 
 +</file> 
 +  - 重啟 docker compose <cli> 
 +docker compose up -d
 </cli> </cli>
  
-===== 一般安裝程序 =====+ 
 +====== 一般安裝程序 ======
 以下是在 CentOS 7 與 Ubuntu 20.04 底下安裝與設定 Squid Proxy Server 以下是在 CentOS 7 與 Ubuntu 20.04 底下安裝與設定 Squid Proxy Server
 ==== Ubuntu 20.04 ==== ==== Ubuntu 20.04 ====
  • tech/squid.1714014383.txt.gz
  • 上一次變更: 2024/04/25 11:06
  • jonathan