Find the answer to your Linux question:
Results 1 to 4 of 4
Hey guys, so I setup squid for the first time, and it kind of works, but not completely... Here is my config file as it is now.. # egrep -v ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2011
    Posts
    4

    Setting up sqid for the first time. Kinda got it..


    Hey guys, so I setup squid for the first time, and it kind of works, but not completely...

    Here is my config file as it is now..

    # egrep -v "^#" /etc/squid/squid.conf | sed -e '/^$/d'
    http_port 80 defaultsite=##.##.##.## # Main IP Of Central web server here
    hierarchy_stoplist cgi-bin ?
    acl QUERY urlpath_regex cgi-bin \?
    cache deny QUERY
    acl apache rep_header Server ^Apache
    access_log /var/log/squid/access.log squid
    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
    cache_dir ufs /var/spool/squid 1000 16 256
    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 SSL_ports port 443 563 # https, snews
    acl SSL_ports port 873 # rsync
    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 Safe_ports port 631 # cups
    acl Safe_ports port 873 # rsync
    acl Safe_ports port 901 # SWAT
    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
    acl lan src 10.0.0.0/8
    http_access allow all
    http_access allow lan
    http_reply_access allow all
    icp_access allow all
    always_direct allow all
    coredump_dir /var/spool/squid
    Two things wrong with the above..
    1) Its wicked wicked slow after a bit. I will use browsermob to time the page load when I kill apache and start squid, and it will be just as fast running apache as it will be running squid to pipe traffic to the main server... give it a few minutes, and it will go from 1 second load time per a page to like 7, or more, or wont even load... What kind of cache settings do you recommend?

    2) For this one, I guess I need to explain how it will work. Lets say I have 3 servers, 1 is the central server which is the real httpd/mysql/php server, which serves the web pages. The other 2 are reverse squid proxies, which do nothing but pipe the traffic back to the main central server, and act as front end web pages. My question is.. how do I let the central server know which domain its being visited from? Im guessing I need to use vhosts somehow? I have like 6 domains all doing this, and if you look at the $_SERVER['SERVER_NAME'] or $_SREVER['HTTP_HOST'], both will say the default IP thats configured in the squid server... How do I fix that?

    Thanks guys, any help is appriceated

  2. #2
    Just Joined!
    Join Date
    Feb 2011
    Posts
    4
    I think im closer...

    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 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
    http_access allow manager localhost
    http_access deny manager
    http_access deny !Safe_ports
    http_access deny CONNECT !SSL_ports
    http_access allow all
    icp_access allow all
    http_port 80 vhost
    cache_peer IP_OF_CENTRAL_SREVER parent 80 0 no-query originserver name=myAccel
    cache_peer_access myAccel allow all
    hierarchy_stoplist cgi-bin ?
    cache_dir ufs /var/spool/squid 1000 16 256
    access_log /var/log/squid/access.log squid
    acl QUERY urlpath_regex cgi-bin \?
    cache deny QUERY
    refresh_pattern ^ftp: 1440 20% 10080
    refresh_pattern ^gopher: 1440 0% 1440
    refresh_pattern . 0 20% 4320
    acl apache rep_header Server ^Apache
    broken_vary_encoding allow apache
    always_direct allow all
    coredump_dir /var/spool/squid
    Now I get...
    The following error was encountered:

    * Unable to forward this request at this time.

    This request could not be forwarded to the origin server or to any parent caches. The most likely cause for this error is that:

    * The cache administrator does not allow this cache to make direct connections to origin servers, and
    * All configured parent caches are currently unreachable.
    Ive googled the **** out of it..

  3. #3
    Just Joined!
    Join Date
    Feb 2011
    Posts
    4
    I GOT IT! An entry for the site needed to be in /etc/hosts

    TOTALLY random guess, didnt find that in any google results..

    Now.. How can I make it fast?..
    Last edited by iuselinux; 02-10-2011 at 06:20 AM.

  4. #4
    Just Joined!
    Join Date
    Feb 2011
    Posts
    4
    I notice I totally misspelled squid in the title, lol

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •