nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

Problem with squid

This is a discussion on Problem with squid within the Linux software forums, part of the Linux Getting Started category; Squid is easy to setup, it just take 5 mins. It seems you are new and got confused with tons ...


Go Back   nixCraft Linux Forum > Linux Getting Started > Linux software

Linux answers from nixCraft.


Linux software General questions and discussion about Redhat/Fedora Core/Cent OS, Debian and Ubuntu Linux related to softwares should go here.

Reply

 

LinkBack Thread Tools Display Modes
  #11 (permalink)  
Old 08-06-2006, 03:42 PM
tom tom is offline
Contributors
User
 
Join Date: Jun 2005
Location: London, UK
Posts: 213
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 5
tom is on a distinguished road
Default

Squid is easy to setup, it just take 5 mins. It seems you are new and got confused with tons of shit out there...anyway

I hope 192.168.7.151 (your Linux server IP) is static IP address. What is the ip address of Windows XP?

Basic troubleshooting
Can you ping from windows xp to linux box? Goto start > run > type command :
Code:
 ping 192.168.7.151
Can you telnet from windows xp to linux squid port 3128? Goto start > run > type command:
Code:
telnet 192.168.7.151 3128
Type . (dot) and hit enter key see what response you get. Lemee know output of above commands and then we can try to solve it
Reply With Quote
  #12 (permalink)  
Old 09-06-2006, 09:45 AM
LRC LRC is offline
Junior Member
User
 
Join Date: Jun 2006
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
LRC
Default

Went to work came back and it was going again. Got onto kanotix forum and changed kernel to the one most suited to my setup. I haven't done a reboot so far after dist-update, but things seem to be going ok. I have been usin Win since late80's, but I have been only working with Linux for about a month. My learning stategy. Is to diving in the deep end unable to swimm, then learn how to swim after hitting bottom. It is amazing the amout of stuff you pick up that way, but it does tend to lead to alot of computer down time. Fortunately this is a hobby not work. To answer you, the XP box is 192.168.7.150 and the router internal IP is 192.168.7.1. A question I have is the lan IP is only excepted if it is 0, is that like a * when you do searches for files? The Linux box sees XP bo fine. Will work with XP tomorrow. I am still very pleased that provided you asked the right question in the right place there is accurate easy to follow advice. M$ I learnt more on my own then I ever got from forums. Many thanks
Reply With Quote
  #13 (permalink)  
Old 09-06-2006, 09:32 PM
LRC LRC is offline
Junior Member
User
 
Join Date: Jun 2006
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
LRC
Default

pinged the IP from XP box works fine. Telnet the port and it didn't work. Believe I have setup the IPTables at this point. Do I use one or both of:
# iptables -t nat -A OUTPUT -p tcp --dport 80 -m owner --uid-owner squid -j ACCEPT
# iptables -t nat -A OUTPUT -p tcp --dport 3128 -m owner --uid-owner squid -j ACCEPT ?
I would like to set it up so that it only goes through squid. The end plans are to set up Dansguardian. By the way setting up things are very easy and simple if you do it right the first time. The fun part is correcting things when you run into a ditch.
Reply With Quote
  #14 (permalink)  
Old 09-06-2006, 11:24 PM
tom tom is offline
Contributors
User
 
Join Date: Jun 2005
Location: London, UK
Posts: 213
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 5
tom is on a distinguished road
Default

Well stop the firewall as pointed out by monk and telnet to port 3128 from Windows xp and let us know what error or output your are getting?

Also what is output of following command on Linux box:
Code:
netstat -vat | grep 3128
Above two command will tell us where is problem … in network or in squid itself
Reply With Quote
  #15 (permalink)  
Old 10-06-2006, 01:18 AM
LRC LRC is offline
Junior Member
User
 
Join Date: Jun 2006
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
LRC
Default

Ran netstat -vat | grep 3128 and it just went to the next # line. I thought at first that ment everything was fine, then again it might have ment n/a.
Reply With Quote
  #16 (permalink)  
Old 10-06-2006, 06:46 AM
LRC LRC is offline
Junior Member
User
 
Join Date: Jun 2006
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
LRC
Default

Reran netstat -vat | grep 3128 (just went to the next # after a short pause) and telnet 192.168.7.151 3128 (connection failed) after running /root/firewall.stop I ran grep -v "#" /etc/squid/squid.conf | sed -e '/^$/d' again just so that we can double check that I didn't do something stupid (quite normal for me) and got this
http_port 3128
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY
maximum_object_size 32768 KB
maximum_object_size_in_memory 8 KB
cache_dir ufs /var/spool/squid 1400 16 256
refresh_pattern Release$ 0 41% 720
refresh_pattern Packages\.gz$ 0 41% 720
refresh_pattern Sources\.gz$ 0 41% 720
refresh_pattern \.orig.tar.gz$ 525600 0% 525600 override-lastmod ignore-reload
refresh_pattern \.diff.gz$ 525600 0% 525600 override-lastmod ignore-reload
refresh_pattern \.deb$ 525600 0% 525600 override-lastmod ignore-reload
refresh_pattern \.dsc$ 525600 0% 525600 override-lastmod ignore-reload
refresh_pattern ^ftp: 0 50% 43200
refresh_pattern ^gopher: 0 50% 720
refresh_pattern \.shtml$ 0 10% 720
refresh_pattern \.html$ 0 50% 720
refresh_pattern \.htm$ 0 50% 720
refresh_pattern \.php.$ 0 10% 720
refresh_pattern \.img$ 0 50% 720
refresh_pattern \.jpeg$ 0 50% 720
refresh_pattern \.jpg$ 0 50% 720
refresh_pattern . 0 20% 720
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 lan src 192.168.7.0/255.255.255.0
acl SSL_ports port 443 563
acl Safe_ports port 80
acl Safe_ports port 21
acl Safe_ports port 443 563
acl Safe_ports port 70
acl Safe_ports port 210
acl Safe_ports port 280
acl Safe_ports port 488
acl Safe_ports port 591
acl Safe_ports port 777
acl Safe_ports port 901
acl purge method PURGE
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
http_access allow lan
http_access deny all
icp_access allow all
cache_mgr admin
cache_effective_user squid
cache_effective_group squid
visible_hostname (host name)
Reply With Quote
  #17 (permalink)  
Old 10-06-2006, 01:20 PM
monk's Avatar
Senior Member
User
 
Join Date: Jan 2005
Location: Tibet
OS: Debian GNU/Linux
Posts: 506
Thanks: 0
Thanked 8 Times in 6 Posts
Rep Power: 7
monk has a spectacular aura about monk has a spectacular aura about
Default

If you are not getting any output … it means your squid server is not running. When you type command
Code:
/etc/init.d/squid start
It should say following without any sort of error:
Starting Squid HTTP proxy: squid.

Then it will open a port 3128. Here is output from my server:
Code:
netstat -vat | grep 3128
tcp 0 0 *:3128 *:* LISTEN

It seems that your squid configuration file has some bug somewhere. Here is my fresh copy, just rename your old copy and put my copy:
Code:
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY
hosts_file /etc/hosts
refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern .               0       20%     4320
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 purge method PURGE
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
acl lan src 192.168.7.0/255.255.255.0
http_access allow localhost
http_access allow lan
http_access deny all
http_reply_access allow all
icp_access allow all
visible_hostname SET-HOSTNAME
coredump_dir /var/spool/squid
Only replace SET-HOSTNAME with your linux servername which can be find with hostname command:
Code:
visible_hostname SET-HOSTNAME
Your configuration is giving me error, so try ouy my config. Only change hostname. Restart squid and run netstat command and see what output you get
Reply With Quote
  #18 (permalink)  
Old 10-06-2006, 07:52 PM
LRC LRC is offline
Junior Member
User
 
Join Date: Jun 2006
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
LRC
Default

As you can see did a major cleanup.
http_port 3128
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY
hosts_file /etc/hosts
refresh_pattern ^ftp: 0 50% 43200
refresh_pattern ^gopher: 0 50% 720
refresh_pattern . 0 20% 720
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 purge method PURGE
acl CONNECT method CONNECT
acl SSL_ports port 443 563
acl Safe_ports port 80
acl purge method PURGE
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
acl lan src 192.168.7.0/255.255.255.0
http_access allow localhost
http_access allow lan
http_access deny all
http_reply_access allow all
icp_access allow all
cache_effective_user squid
cache_effective_group squid
visible_hostname (hostname as listed)
coredump_dir /var/spool/squid

Restarting squid gave me Starting Squid HTTP proxy: squid. netstat -vat | grep 3128 still hasn't given me any response. I have stopped iptables firewall. Therefore that means I have either a) another firewall stopping it (I have no idea how linux works these things so that might be out of the question because I have already stopped iptables) or b) In my browsing around trying to fix this I seem to remember someone posting that if your kernel didn't have a certain feature set right, it would block what squid was doing. But because I saw dozens of sites I cann't remember what it was and of course it didn't say how you were supposed to find out, so I ignored it. By the way my kernel is kanotix 2.6.17-rc6-slh-up-1.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Squid configuration problem jhn_daz@yahoo.com Networking, Firewalls and Security 1 29-06-2007 01:58 AM
Squid Problem B!n@ry Linux software 3 15-04-2007 03:36 PM
problem with Squid puppen Linux software 4 04-01-2007 02:45 PM
squid problem dev_dks Linux software 1 01-08-2006 01:42 PM
SQUID ACL Problem kasimani Linux software 15 13-07-2006 05:29 PM


All times are GMT +5.5. The time now is 08:50 PM.


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38