LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 629|回复: 7

squid问题

[复制链接]
发表于 2003-11-20 15:22:30 | 显示全部楼层 |阅读模式
怎么控制上网?例如:让192.168.0.1上网,而192.168.0.2不让上网,那么squid应该去怎么设置?谢谢.
发表于 2003-11-20 16:08:21 | 显示全部楼层
用acl的命令来控制啊!例如编辑squid.conf
acl baduser src 192.168.0.2
acl our_networks src 192.168.0.0/24
http_access deny baduser
http_access allow our_networks
这样192.168.0.2就不可以上网了!
 楼主| 发表于 2003-11-21 08:10:50 | 显示全部楼层
# ACCESS CONTROLS
# -----------------------------------------------------------------------------

#  TAG: acl
#        Defining an Access List
#
#        acl aclname acltype string1 ...
#        acl aclname acltype "file" ...
#
#        when using "file", the file should contain one item per line
#
#        acltype is one of the types described below
#
#        By default, regular expressions are CASE-SENSITIVE.  To make
#        them case-insensitive, use the -i option.
#
#        acl aclname src      addr1-addr2/netmask ... (range of addresses)
#        acl aclname dst      ip-address/netmask ... (URL host's IP address)
#        acl aclname myip     ip-address/netmask ... (local socket IP address)
#
#        acl aclname srcdomain   .foo.com ...    # reverse lookup, client IP
#        acl aclname dstdomain   .foo.com ...    # Destination server from URL
#        acl aclname srcdom_regex [-i] xxx ...   # regex matching client name
#        acl aclname dstdom_regex [-i] xxx ...   # regex matching server
#          # For dstdomain and dstdom_regex  a reverse lookup is tried if a IP
#          # based URL is used. The name "none" is used if the reverse lookup
#          # fails.
#
#        acl aclname time     [day-abbrevs]  [h1:m1-h2:m2]
#            day-abbrevs:
#                S - Sunday
#                M - Monday
#                T - Tuesday
#                W - Wednesday
#                H - Thursday
#                F - Friday
#                A - Saturday
#            h1:m1 must be less than h2:m2
#        acl aclname url_regex [-i] ^http:// ...        # regex matching on whole URL
#        acl aclname urlpath_regex [-i] \.gif$ ...        # regex matching on URL path
#        acl aclname port     80 70 21 ...
#        acl aclname port     0-1024 ...                # ranges allowed
#        acl aclname myport   3128 ...                # (local socket TCP port)
#        acl aclname proto    HTTP FTP ...
#        acl aclname method   GET POST ...
#        acl aclname browser  [-i] regexp ...
#          # pattern match on User-Agent header
#        acl aclname referer_regex  [-i] regexp ...
#          # pattern match on Referer header
#          # Referer is highly unreliable, so use with care
#        acl aclname ident    username ...
#        acl aclname ident_regex [-i] pattern ...
#          # string match on ident output.
#          # use REQUIRED to accept any non-null ident.
#        acl aclname src_as   number ...
#        acl aclname dst_as   number ...
#          # Except for access control, AS numbers can be used for
#          # routing of requests to specific caches. Here's an
#          # example for routing all requests for AS#1241 and only
#          # those to mycache.mydomain.net:
#          # acl asexample dst_as 1241
#          # cache_peer_access mycache.mydomain.net allow asexample
#          # cache_peer_access mycache_mydomain.net deny all
#
#        acl aclname proxy_auth username ...
#        acl aclname proxy_auth_regex [-i] pattern ...
#          # list of valid usernames
#          # use REQUIRED to accept any valid username.
#          #
#          # NOTE: when a Proxy-Authentication header is sent but it is not
#          # needed during ACL checking the username is NOT logged
#          # in access.log.
#          #
#          # NOTE: proxy_auth requires a EXTERNAL authentication program
#          # to check username/password combinations (see
#          # authenticate_program).
#          #
#          # WARNING: proxy_auth can't be used in a transparent proxy. It
#          # collides with any authentication done by origin servers. It may
#          # seem like it works at first, but it doesn't.
#
#        acl aclname snmp_community string ...
#          # A community string to limit access to your SNMP Agent
#          # Example:
#          #
#          #        acl snmppublic snmp_community public
#
#        acl aclname maxconn number
#          # This will be matched when the client's IP address has
#          # more than <number> HTTP connections established.
#
#        acl aclname max_user_ip [-s] number
#          # This will be matched when the user attempts to log in from more
#          # than <number> different ip addresses. The authenticate_ip_ttl
#          # parameter controls the timeout on the ip entries.
#          # If -s is specified then the limit is strict, denying browsing
#          # from any further IP addresses until the ttl has expired. Without
#          # -s Squid will just annoy the user by "randomly" denying requests.
#          # (the counter is then reset each time the limit is reached and a
#          # request is denied)
#          # NOTE: in acceleration mode or where there is mesh of child proxies,
#          # clients may appear to come from multiple addresses if they are
#          # going through proxy farms, so a limit of 1 may cause user problems.
#
#        acl aclname req_mime_type mime-type1 ...
#          # regex match agains the mime type of the request generated
#          # by the client. Can be used to detect file upload or some
#          # types HTTP tunelling requests.
#          # NOTE: This does NOT match the reply. You cannot use this
#          # to match the returned file type.
#
#        acl aclname rep_mime_type mime-type1 ...
#          # regex match against the mime type of the reply recieved by
#          # squid. Can be used to detect file download or some
#          # types HTTP tunelling requests.
#          # NOTE: This has no effect in http_access rules. It only has
#          # effect in rules that affect the reply data stream such as
#          # http_reply_access.
#
#        acl acl_name external class_name [arguments...]
#          # external ACL lookup via a helper class defined by the
#          # external_acl_type directive.
#
#Examples:
#acl myexample dst_as 1241
#acl password proxy_auth REQUIRED
#acl fileupload req_mime_type -i ^multipart/form-data$
#acl javascript rep_mime_type -i ^application/x-javascript$
#
#Recommended minimum configuration:
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl my_network src 192.168.0.0/24
#acl dyw src 192.168.0.2/24
acl SSL_ports port 443 563
acl Safe_ports port 80                # http
acl Safe_ports port 21                # ftp
acl Safe_ports port 443 563        # https, snews
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

#  TAG: http_access
#        Allowing or Denying access based on defined access lists
#
#        Access to the HTTP port:
#        http_access allow|deny [!]aclname ...
#
#        NOTE on default values:
#
#        If there are no "access" lines present, the default is to deny
#        the request.
#
#        If none of the "access" lines cause a match, the default is the
#        opposite of the last line in the list.  If the last line was
#        deny, then the default is allow.  Conversely, if the last line
#        is allow, the default will be deny.  For these reasons, it is a
#        good idea to have an "deny all" or "allow all" entry at the end
#        of your access lists to avoid potential confusion.
#
#Default:
#
#Recommended minimum configuration:
#
# Only allow cachemgr access from localhost
http_access allow manager localhost
http_access deny manager
# Deny requests to unknown ports
http_access deny !Safe_ports
# Deny CONNECT to other than SSL ports
http_access deny CONNECT !SSL_ports
http_access deny dyw
http_access allow my_network
#
# We strongly recommend to uncomment the following to protect innocent
# web applications running on the proxy server who think that 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

# Exampe rule allowing access from your local networks. Adapt
# to list your (internal) IP networks from where browsing should
# be allowed
#acl our_networks src 192.168.1.0/24 192.168.2.0/24
#http_access allow our_networks

# And finally deny all other access to this proxy
http_access allow localhost
http_access deny all
 楼主| 发表于 2003-11-21 08:16:31 | 显示全部楼层
以上的目的是不让192.168.0.2上网,其它都可以,上面的贴子不知道什么地方出了问题,控制不了192.168.0.2上网,谢谢大家的相互!(acl dyw src 192.168.0.2/24前面的#号贴错了,原是没有的)
 楼主| 发表于 2003-11-21 14:46:55 | 显示全部楼层
哎,在里面想求一点儿东西,好难,好难...啊!
 楼主| 发表于 2003-11-22 08:42:54 | 显示全部楼层
以上的目的是不让192.168.0.2上网,其它都可以,上面的贴子不知道什么地方出了问题,控制不了192.168.0.2上网,谢谢大家的相互!(acl dyw src 192.168.0.2/24前面的#号贴错了,原是没有的)
ACCESS CONTROLS
# -----------------------------------------------------------------------------

# TAG: acl
# Defining an Access List
#
# acl aclname acltype string1 ...
# acl aclname acltype "file" ...
#
# when using "file", the file should contain one item per line
#
# acltype is one of the types described below
#
# By default, regular expressions are CASE-SENSITIVE. To make
# them case-insensitive, use the -i option.
#
# acl aclname src addr1-addr2/netmask ... (range of addresses)
# acl aclname dst ip-address/netmask ... (URL host's IP address)
# acl aclname myip ip-address/netmask ... (local socket IP address)
#
# acl aclname srcdomain .foo.com ... # reverse lookup, client IP
# acl aclname dstdomain .foo.com ... # Destination server from URL
# acl aclname srcdom_regex [-i] xxx ... # regex matching client name
# acl aclname dstdom_regex [-i] xxx ... # regex matching server
# # For dstdomain and dstdom_regex a reverse lookup is tried if a IP
# # based URL is used. The name "none" is used if the reverse lookup
# # fails.
#
# acl aclname time [day-abbrevs] [h1:m1-h2:m2]
# day-abbrevs:
# S - Sunday
# M - Monday
# T - Tuesday
# W - Wednesday
# H - Thursday
# F - Friday
# A - Saturday
# h1:m1 must be less than h2:m2
# acl aclname url_regex [-i] ^http:// ... # regex matching on whole URL
# acl aclname urlpath_regex [-i] \.gif$ ... # regex matching on URL path
# acl aclname port 80 70 21 ...
# acl aclname port 0-1024 ... # ranges allowed
# acl aclname myport 3128 ... # (local socket TCP port)
# acl aclname proto HTTP FTP ...
# acl aclname method GET POST ...
# acl aclname browser [-i] regexp ...
# # pattern match on User-Agent header
# acl aclname referer_regex [-i] regexp ...
# # pattern match on Referer header
# # Referer is highly unreliable, so use with care
# acl aclname ident username ...
# acl aclname ident_regex [-i] pattern ...
# # string match on ident output.
# # use REQUIRED to accept any non-null ident.
# acl aclname src_as number ...
# acl aclname dst_as number ...
# # Except for access control, AS numbers can be used for
# # routing of requests to specific caches. Here's an
# # example for routing all requests for AS#1241 and only
# # those to mycache.mydomain.net:
# # acl asexample dst_as 1241
# # cache_peer_access mycache.mydomain.net allow asexample
# # cache_peer_access mycache_mydomain.net deny all
#
# acl aclname proxy_auth username ...
# acl aclname proxy_auth_regex [-i] pattern ...
# # list of valid usernames
# # use REQUIRED to accept any valid username.
# #
# # NOTE: when a Proxy-Authentication header is sent but it is not
# # needed during ACL checking the username is NOT logged
# # in access.log.
# #
# # NOTE: proxy_auth requires a EXTERNAL authentication program
# # to check username/password combinations (see
# # authenticate_program).
# #
# # WARNING: proxy_auth can't be used in a transparent proxy. It
# # collides with any authentication done by origin servers. It may
# # seem like it works at first, but it doesn't.
#
# acl aclname snmp_community string ...
# # A community string to limit access to your SNMP Agent
# # Example:
# #
# # acl snmppublic snmp_community public
#
# acl aclname maxconn number
# # This will be matched when the client's IP address has
# # more than <number> HTTP connections established.
#
# acl aclname max_user_ip [-s] number
# # This will be matched when the user attempts to log in from more
# # than <number> different ip addresses. The authenticate_ip_ttl
# # parameter controls the timeout on the ip entries.
# # If -s is specified then the limit is strict, denying browsing
# # from any further IP addresses until the ttl has expired. Without
# # -s Squid will just annoy the user by "randomly" denying requests.
# # (the counter is then reset each time the limit is reached and a
# # request is denied)
# # NOTE: in acceleration mode or where there is mesh of child proxies,
# # clients may appear to come from multiple addresses if they are
# # going through proxy farms, so a limit of 1 may cause user problems.
#
# acl aclname req_mime_type mime-type1 ...
# # regex match agains the mime type of the request generated
# # by the client. Can be used to detect file upload or some
# # types HTTP tunelling requests.
# # NOTE: This does NOT match the reply. You cannot use this
# # to match the returned file type.
#
# acl aclname rep_mime_type mime-type1 ...
# # regex match against the mime type of the reply recieved by
# # squid. Can be used to detect file download or some
# # types HTTP tunelling requests.
# # NOTE: This has no effect in http_access rules. It only has
# # effect in rules that affect the reply data stream such as
# # http_reply_access.
#
# acl acl_name external class_name [arguments...]
# # external ACL lookup via a helper class defined by the
# # external_acl_type directive.
#
#Examples:
#acl myexample dst_as 1241
#acl password proxy_auth REQUIRED
#acl fileupload req_mime_type -i ^multipart/form-data$
#acl javascript rep_mime_type -i ^application/x-javascript$
#
#Recommended minimum configuration:
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl my_network src 192.168.0.0/24
#acl dyw src 192.168.0.2/24
acl SSL_ports port 443 563
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 563 # https, snews
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

# TAG: http_access
# Allowing or Denying access based on defined access lists
#
# Access to the HTTP port:
# http_access allow|deny [!]aclname ...
#
# NOTE on default values:
#
# If there are no "access" lines present, the default is to deny
# the request.
#
# If none of the "access" lines cause a match, the default is the
# opposite of the last line in the list. If the last line was
# deny, then the default is allow. Conversely, if the last line
# is allow, the default will be deny. For these reasons, it is a
# good idea to have an "deny all" or "allow all" entry at the end
# of your access lists to avoid potential confusion.
#
#Default:
#
#Recommended minimum configuration:
#
# Only allow cachemgr access from localhost
http_access allow manager localhost
http_access deny manager
# Deny requests to unknown ports
http_access deny !Safe_ports
# Deny CONNECT to other than SSL ports
http_access deny CONNECT !SSL_ports
http_access deny dyw
http_access allow my_network
#
# We strongly recommend to uncomment the following to protect innocent
# web applications running on the proxy server who think that 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

# Exampe rule allowing access from your local networks. Adapt
# to list your (internal) IP networks from where browsing should
# be allowed
#acl our_networks src 192.168.1.0/24 192.168.2.0/24
#http_access allow our_networks

# And finally deny all other access to this proxy
http_access allow localhost
http_access deny all
 楼主| 发表于 2003-11-22 09:54:48 | 显示全部楼层
我真得很着急啊!!!
 楼主| 发表于 2003-12-1 09:04:27 | 显示全部楼层

mysql编译不成功

这是怎么回事,我应该怎么去解决?
mkdir .libs
c++ -O3 -DDBUG_OFF -fno-implicit-templates -fno-exceptions -fno-rtti -rdynamic -o .libs/mysql mysql.o readline.o sql_string.o completion_hash.o ../readline/libreadline.a -lncurses ../libmysql/.libs/libmysqlclient.so -lz -lcrypt -lnsl -lm -lz -lcrypt -lnsl -lm -Wl,--rpath -Wl,/usr/local/mysql/lib/mysql
mysql.o(.text+0x1828): In function `com_source(String*, char*)':
: undefined reference to `errno'
collect2: ld returned 1 exit status
make[2]: *** [mysql] Error 1
make[2]: Leaving directory `/home/dyw/mysql-3.23.44/client'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/dyw/mysql-3.23.44'
make: *** [all-recursive-am] Error 2
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表