Showing posts with label squid. Show all posts
Showing posts with label squid. Show all posts

Sunday, July 21, 2013

squid proxy error NONE/417

เริ่มต้นจากอยากจะเข้า e-fin กะเค้าบ้าง แต่พอเข้าโปรแกรมทีไร ก็จะให้ใส่ proxy เหมือนดังรูปข้างบนตลอด ซึ่งเจ้า squid proxy เราก็ติดตั้งเอง เรื่อง authentication ก็ไม่มี ลองเทสหลายหนก็เข้าใช้งานไม่ได้
ลองหาข้อมูลในอากู๋ ที่หลาย ๆ คนใช้งาน ก็เจอหลายที่ที่มีคนถามว่าเข้าไม่ได้ แต่ส่วนใหญ่จะตอบให้ติดต่อ "ผู้ดูแลระบบ" เพื่อขอรหัสผ่านในการใช้งาน อ้าวก็เราเนี่ยแหละดูแลระบบ และเราก็ไม่ได้มีรหัสให้ต้องใช้งาน แล้วจะทำยังไงดี ...

หลังจากเกิดปัญหาดังกล่าวก็ปล่อยปัญหาไปสักพัก ใจก็ยังอยากจะเข้าให้ได้ ตอนนี้ความอยากเข้าใช้งานยังเท่าเดิม แต่ความอยากรู้ว่าทำไมเข้าโปรแกรมไม่ได้กลับมากกว่า แล้วก็นึกขึ้นได้ว่าทำไมเราไม่ลองดูใน log ของ squid ดูล่ะว่าเกิดอะไรขึ้น เมื่อนึกขึ้นได้ก็จัดการ remote เข้าไปดู แล้วเราก็เจอแบบนี้

NONE/417

ไม่ได้ก๊อปมาทั้งหมด เอามาแค่ส่วนสำคัญ ก็เลยกลับไปลองถาม google อีกครั้งนึง ก็ได้คำตอบจากเว็บนี้ ว่าต้องเพิ่มคำสั่งใน config file แบบนี้
ignore_expect_100 on
เลยจัดการเพิ่มเข้าไป แล้วจัดการให้ squid เรียก config file ที่เราแก้ไขมาใช้
bingo !!! เข้าใช้งานได้แล้ว

Read More

Bookmark and Share

Wednesday, October 19, 2011

Cache .dep with squid-deb-proxy server

ปกติถ้าหากใช้เครื่องที่มี ubuntu เพียงเครื่องเดียวก็จะไม่มีความจำเป็นที่จะต้องเก็บ .dep ไว้ในเครื่อง server แต่ถ้าหากมีคนใช้ ubuntu ในออฟฟิศเดียวกันหลาย ๆ คน ครั้นจะให้แต่ละคนอัพเดตของตัวเองก็เกรงจะเปลือง bandwidth โดยใช่เหตุ ดังนั้นตัวช่วยในบทความนี้คือ squid-deb-proxy โดยมีขั้นตอนการติดตั้ง
[server]
  1. Install packages
    sudo apt-get install avahi-utils
    sudo apt-get install squid-deb-proxy
  2. Edit Configuration
    sudo vi /etc/squid-deb-proxy/allowed-networks-src.acl
    Add LAN IP such as LAN IP is 192.168.1.0 - 192.168.1.255 :
    192.168.1.0/24

    sudo vi /etc/squid-deb-proxy/mirror-dstdomain.acl
    Add all repository from all client ( can see in file /etc/apt/source.list ) to configuration file :
    # default ubuntu and ubuntu country archive mirrors
    .archive.ubuntu.com
    ports.ubuntu.com
    security.ubuntu.com
    #official third party repositories
    archive.canonical.com
    extras.ubuntu.com


  3. Restart service :
    sudo service avahi-daemon restart
    sudo service squid-deb-proxy start
    
  4. Check log file at :
    sudo tail -f /var/log/squid-deb-proxy/access.log

[Client]
  1. Install squid-deb-proxy-client
    sudo apt-get install squid-deb-proxy-client
  2. Check client con connect to proxy

    avahi-browse -kprt _apt_proxy._tcp
    +;eth2;IPv4;Squid\032deb\032proxy;_apt_proxy._tcp;local
    =;eth2;IPv4;Squid\032deb\032proxy;_apt_proxy._tcp;local;squidserver.local;192.168.1.10;8000;

    192.168.1.10 is squid-proxy-server
และหากต้องการยกเลิกการใช้งาน proxy ชั่วคราว สามารถทำการแก้ไขไฟล์ 30autoproxy ได้
sudo vi /etc/apt/apt.conf.d/30autoproxy
จากนั้นใส่เครื่องหมาย # ด้านหน้าบรรทัดแบบนี้
#Acquire::http { Proxy "http://192.168.1.10:8000/"; };

Read More

Bookmark and Share