Squid 3.0

Discussion in 'Server Operation' started by chyi, Jan 23, 2010.

  1. chyi

    chyi New Member

    Hi, i'm very new to linux environment. I struggled to set up Squid 3.0 and finally got it working which route to the default site.

    What I intend to achieve is that when user try to browse www2.super.net, it will come to squid server (already point www2.super.net to squid server). The outcome will forward them to the defaultsite instead. I understand it could be missing the command of vhost at the http_port. But when I add vhost, it becomes inaccessible.

    I also intended to add other "rerouting" domains such as when I type www3.super.net, it will actually go to www.google.com, www3.super.net -> www.yahoo.com, etc (just an example)

    My question is, based on the existing settings, how can i achieve that? and if i also want to use this squid server as proxy server (different port), can it be done?

    Thanks. I hope someone can helped me here as I have tried google it and to no avail.




    Code:
    cache_peer localhost parent 80 0 no-query originserver name=accel_super
    
    acl manager proto cache_object
    acl localhost src 127.0.0.1/32
    acl to_localhost dst 127.0.0.0/8 0.0.0.0/32
    acl localnet src 10.0.0.0/8	# RFC1918 possible internal network
    acl localnet src 172.16.0.0/12	# RFC1918 possible internal network
    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 3724
    acl Safe_ports port 6112-6119
    acl Safe_ports port 6881-6999
    # 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
    
    acl examplenet url_regex example.net
    acl superfrxnet dstdomain .super.net
    cache_peer_access accel_super allow supernet
    
    http_access allow examplenet  
    http_access allow supernet
    
    http_access allow manager localhost
    http_access deny manager
    http_access deny !Safe_ports
    http_access deny CONNECT !SSL_ports
    http_access allow localnet
    http_access allow localhost
    http_access deny all
    icp_access allow localnet
    icp_access deny all
    htcp_access allow localnet
    htcp_access deny all
    
    http_port 80 accel defaultsite=www.example.net
    
    always_direct allow all
    hierarchy_stoplist cgi-bin ?
    
     

Share This Page