The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Running Squid proxy on a specific IP, not the main server IP - how?

Discussion in 'General Discussion' started by tomfra, Jan 3, 2007.

  1. tomfra

    tomfra Well-Known Member

    Joined:
    Sep 30, 2002
    Messages:
    62
    Likes Received:
    0
    Trophy Points:
    6
    Hi everyone,

    I have successfully installed Squid on my server (VPS, CentOS 4.4, CPanel) and it runs just fine. However, there is a small problem that's driving me crazy...

    I have more than one IP address on the server. Let's say the main server IP is 1.2.3.4, it's the IP address for the main DNS server etc. Then I have another IP address - let's say 1.2.3.5 that's also assigned to my server. I can ping it with no problems.

    Now, what I would like to do is to force Squid to listen on the second IP only so I edit squid.conf with something like:

    http_port 1.2.3.5:8080

    This indeed makes Squid to listen only on the IP 1.2.3.5 and port 8080 and everything seems to work as intended. Except for one detail...

    Despite Squid is listening and accepting connections on the second IP, it reveals the first/main server IP to the destination page. Even if I config my Firefox or MSIE to use IP 1.2.3.5, port 8080, services such as http://www.danasoft.com/vipersig.jpg tell me my IP is 1.2.3.4 .

    Do you have an idea what could be causing this?

    Thanks!

    Tomas
     
  2. tomfra

    tomfra Well-Known Member

    Joined:
    Sep 30, 2002
    Messages:
    62
    Likes Received:
    0
    Trophy Points:
    6
    OK, I got the answer elsewhere meanwhile. In case someone else is wondering about the same thing as I did, you need to set udp_outgoing_address, tcp_outgoing_address in squid.conf to the IP you want to use.

    Tomas
     
  3. p.kiula

    p.kiula Member

    Joined:
    Sep 13, 2007
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    Hello tomfra, could you share with this forum how you got squid working? Installing is easy, but how have you configured it, and is it any good -- for instance, how do you make sure that if I edit and update a file that has been cached by Squid, it should be refreshed in the cache? Also, does it cache non-static files? Thanks in advance!
     
  4. tomfra

    tomfra Well-Known Member

    Joined:
    Sep 30, 2002
    Messages:
    62
    Likes Received:
    0
    Trophy Points:
    6
    Well, it wasn't that difficult to make it work, the sample config files I found helped me a lot as well as the docs at visolve.com . I am using the 3.0 branch.

    My setup is somewhat special - I am not using Squid for caching but instead in conjunction with SSH tunnelling to provide "anonymization". It's all a bit complex and I do not want to go into detail for now. I am not really a "Squid guru". I found a lot of answers at http://www.experts-exchange.com . I can show you my config file if you want but as I said, it's a special purpose one and may be useless for you.

    Tomas


     
Loading...

Share This Page