squid 透明代理配置过程 -- CentOS

[root@centos45 squid]# rpm -qa |grep squid
squid-2.5.STABLE14-1.4E

[root@centos45 squid]# service squid start
在未设置squid.conf状况下出现错误"/var/spool/squid....."

[root@centos45 squid]# vi squid.conf
http_port 3128
icp_prot 3130
cache_dir ufs /var/spool/squid 100 16 256
cache_access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
cache_store_log /var/log/squid/store.log
pid_filename /var/run/squid.pid
#auth_param basic children 5
#auth_param basic realm Squid proxy-caching web server
#auth_param basic credentialsttl 2 hours
http_access allow all
cache_effective_user squid
cache_effective_group squid
cache_mgr
[email protected]

[root@centos45 etc]# su -l squid -c "/usr/sbin/squid -D"
This account is currently not available.

[root@centos45 etc]# ll /usr/sbin/squid
-rwxr-xr-x 1 root root 654724 May 5 08:13 /usr/sbin/squid
[root@centos45 etc]# /usr/sbin/squid -D     这一步虽然不能启动squid,但可以侦察错误,不检测DNS,有一定副助作用
FATAL: Could not determine fully qualified hostname. Please set 'visible_hostname'
Squid Cache (Version 2.5.STABLE14): Terminated abnormally.
CPU Usage: 0.028 seconds = 0.019 user + 0.009 sys
Maximum Resident Size: 0 KB
Page faults with physical i/o: 0
Aborted
[root@centos45 squid]# vi /etc/squid/squid.conf
visible_hostname feng-squid
[root@centos45 squid]# /usr/sbin/squid -D
[root@centos45 squid]# netstat -tln | grep 312
[root@centos45 squid]# service squid start
init_cache_dir /var/spool/squid... Starting squid: .       [ OK ]
[root@centos45 squid]# netstat -tln | grep 3128
tcp        0      0 0.0.0.0:3128                0.0.0.0:*                   LISTEN

你可能感兴趣的:(centos,squid,休闲,--,透明代理配置过程)