DutchDaemon said:No need for lsof, just use sockstat(1), e.g. [cmd=]sockstat -l4p 3128[/cmd].
2010/02/10 20:04:42| commBind: Cannot bind socket FD 27 to *:3128: (48) Address already in use
FATAL: Cannot open HTTP Port
Squid Cache (Version 2.7.STABLE7): Terminated abnormally.
CPU Usage: 0.018 seconds = 0.009 user + 0.009 sys
Maximum Resident Size: 5888 KB
Page faults with physical i/o: 0
proxy# sockstat -l4p 3128
USER COMMAND PID FD PROTO LOCAL ADDRESS FOREIGN ADDRESS
squid squid 1900 27 tcp4 *:3128
*:*
# /usr/local/etc/rc.d/squid stop
or # squid -k shutdown
, and wait at least one full minute before trying to start it up again. Squid needs time to shut down its processes and file descriptors in the background. A [cmd=]tail -f /usr/local/squid/log/cache.log[/cmd] should give you enough insight to know what Squid does.# killall -9 diskd
as well.It's work! ThanksDutchDaemon said:Squid is already running. Either run# /usr/local/etc/rc.d/squid stop
or# squid -k shutdown
, and wait at least one full minute before trying to start it up again. Squid needs time to shut down its processes and file descriptors in the background. A [cmd=]tail -f /usr/local/squid/log/cache.log[/cmd] should give you enough insight to know what Squid does.
If shutting it down doesn't work, it's stuck. Use [cmd=]killall -9 squid[/cmd] as a last resort; do it twice to make sure it's really gone (you should get 'no processes found' when it's gone). If you're using diskd as well, run a# killall -9 diskd
as well.
http_access allow manager localhost
http_access deny manager
cachemgr_passwd
cache_mgr admin
cachemgr_passwd 123456 all
cache_effective_user squid
cache_effective_group squid
visible_hostname proxy.d0ne.net
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localnet src 192.168.1.0/24
acl localcom src 11.1.1.0/24
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.1
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 631 # cups
acl Safe_ports port 777 # multiling http
acl Safe_ports port 901 # SWAT
acl CONNECT method CONNECT
# Only allow cachemgr access from localhost
http_access allow manager localhost to_localhost
http_access deny manager
http_access deny CONNECT !SSL_ports
# my own rules
http_access allow localhost
http_access allow localnet
http_access allow localcom
# And finally deny all other access to this proxy
http_access deny all
# no X-Forwarded-For header
forwarded_for off
d0ne said:Code:2010/02/10 18:32:50| commBind: Cannot bind socket FD 27 to *:3128: (48) Address already in use FATAL: Cannot open HTTP Port
I change to other por like 8080, 8081 or 8787 but same error
how to fix it ?
Thanks
2010/10/02 11:11:38| commBind: Cannot bind socket FD 13 to 127.0.0.1:3128: (48) Address already in use
2010/10/02 11:11:38| commBind: Cannot bind socket FD 13 to *:3128: (48) Address already in use
FATAL: Cannot open HTTP Port
Squid Cache (Version 2.7.STABLE6): Terminated abnormally.
CPU Usage: 0.017 seconds = 0.006 user + 0.011 sys
Maximum Resident Size: 4952 KB
Page faults with physical i/o: 0
Abort
kamote# sockstat -l4p 3128
USER COMMAND PID FD PROTO LOCAL ADDRESS FOREIGN ADDRESS
squid squid 774 13 tcp4 127.0.0.1:3128 *:*
squid squid 774 14 tcp4 *:3128 *:*
Myron said:hi done i have same problem as yours hehehe look
Code:2010/10/02 11:11:38| commBind: Cannot bind socket FD 13 to 127.0.0.1:3128: (48) Address already in use 2010/10/02 11:11:38| commBind: Cannot bind socket FD 13 to *:3128: (48) Address already in use FATAL: Cannot open HTTP Port Squid Cache (Version 2.7.STABLE6): Terminated abnormally. CPU Usage: 0.017 seconds = 0.006 user + 0.011 sys Maximum Resident Size: 4952 KB Page faults with physical i/o: 0 Abort
in sockstat the result is
Code:kamote# sockstat -l4p 3128 USER COMMAND PID FD PROTO LOCAL ADDRESS FOREIGN ADDRESS squid squid 774 13 tcp4 127.0.0.1:3128 *:* squid squid 774 14 tcp4 *:3128 *:*
DutchDaemon said:Squid is already running. Either run# /usr/local/etc/rc.d/squid stop
or# squid -k shutdown
, and wait at least one full minute before trying to start it up again. Squid needs time to shut down its processes and file descriptors in the background. A [cmd=]tail -f /usr/local/squid/log/cache.log[/cmd] should give you enough insight to know what Squid does.
If shutting it down doesn't work, it's stuck. Use [cmd=]killall -9 squid[/cmd] as a last resort; do it twice to make sure it's really gone (you should get 'no processes found' when it's gone). If you're using diskd as well, run a# killall -9 diskd
as well.
DutchDaemon said:Well, I can't tell you more than what is in the following locations about this:
cachemgr.cgi(8)
squid(8)
The Squid Cache Manager FAQ
proxy# tail -f /usr/local/squid/logs/cache.log
Page faults with physical i/o: 0
2010/02/10 21:57:24| CACHEMGR: <unknown>@127.0.0.1: password needed for 'menu'
2010/02/10 21:57:32| CACHEMGR: @127.0.0.1: incorrect password for 'menu'
2010/02/10 21:57:40| CACHEMGR: @127.0.0.1 requesting 'menu'
2010/02/10 21:57:42| CACHEMGR: <unknown>@127.0.0.1: password needed for 'via_headers'
2010/02/10 21:57:48| CACHEMGR: <unknown>@127.0.0.1: password needed for 'external_acl'
2010/02/10 21:57:56| CACHEMGR: <unknown>@127.0.0.1: password needed for 'counters'
d0ne said:Hi Myron just follow this :
squid squid 774 13 tcp4 127.0.0.1:3128 *:*
squid squid 774 14 tcp4 *:3128 *:*
DutchDaemon said:Myron, check you config again. You're starting two Squid sessions at the same time.
Code:squid squid 774 13 tcp4 127.0.0.1:3128 *:* squid squid 774 14 tcp4 *:3128 *:*
It is one single squid process (pid 774), but you appear to have instructed it to listen on localhost and all other interfaces for some reason. You should have only one (valid) http_port statement in there.
d0ne said:my problem solved!
Thanks
grep -vE "(^$|^#)" /usr/local/etc/squid/squid.conf
DutchDaemon said:Would you be so kind to share your solution? That's what forums are for: sharing solutions.
DutchDaemon said:Myron, postgrep -vE "(^$|^#)" /usr/local/etc/squid/squid.conf
#acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
acl localnet src 172.0.0.0/24 # RFC1918 possible internal network
#acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
#squid config
http_port 127.0.0.1:3128 transparent
cache_dir diskd /squidcache/squid/cache 124000 291 256
cache_access_log /var/log/squid/access.log
cache_store_log none
pid_filename /var/run/squid.pid
hosts_file /etc/hosts
http_access allow localhost
acl manager proto cache_object
cache_mgr kamote.net
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 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
defaultrouter="192.168.1.1"
hostname="kamote.net"
ifconfig_age0="inet 192.168.1.2 netmask 255.255.255.0"
linux_enable="YES"
sshd_enable="YES"
cloned_interfaces="bridge0"
ifconfig_bridge0="addm age0 addm rl0 up"
ifconfig_age0="up"
ifconfig_rl0="up"
ifconfig_bridge0_alias0="inet 192.168.1.3 netmask 255.255.255.0"
squid_enable="YES"
pf_enable="YES"
pf_rules="/etc/pf.conf"
pf_flags=""
pflog_enable="YES"
pflog_logfile="/var/log/pflog"
pflog_flags=""
web="{80:83 1080 8080:8081 8088 11523}"
set skip on lo0
rdr on $age0 inet proto tcp from any to any port $web -> 127.0.0.1 port 3128
pass in quick on $age0 route-to lo0 inet proto tcp from any to 127.0.0.1 port 31
tags around system output.
ifconfig_age0="inet 192.168.1.2 netmask 255.255.255.0"
ifconfig_bridge0_alias0="inet 192.168.1.3 netmask 255.255.255.0"
Accepting transparently proxied HTTP connections at 127.0.0.1, port 3128, FD 13.