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.

Varnish on different IP

Discussion in 'General Discussion' started by areha, Jun 27, 2014.

  1. areha

    areha Well-Known Member

    Joined:
    Oct 30, 2002
    Messages:
    52
    Likes Received:
    0
    Trophy Points:
    6
    I have gotten Varnish to work on port 8089, however, I have a question..

    If I go to .27:8089, I get the Varnish version of the site and I see performance gain.

    But when I change Varnish configration to run on port 80, it doesn't start. Is this because of the general 0.0.0.0:80 rule that hots runs on today? As you see below, I managed to get Varnish to listen to 8089, but I suspect I have to change the 0.0.0.0:80 in Apache config?

    tcp 0 0 .27:8080 0.0.0.0:* LISTEN 32711/httpd
    tcp 0 0 .26:8080 0.0.0.0:* LISTEN 32711/httpd
    tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 32711/httpd
    tcp 0 0 .27:8089 0.0.0.0:* LISTEN 30872/varnishd
    tcp 0 0 :::80 :::* LISTEN 32711/httpd
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Could you elaborate on how you installed Varnish? Did you make specific changes to the Apache configuration when installing it?

    Thank you.
     
  3. areha

    areha Well-Known Member

    Joined:
    Oct 30, 2002
    Messages:
    52
    Likes Received:
    0
    Trophy Points:
    6
    I changed httpd.conf so that this spesific IP .27 listens to port 8080 instread of port 80 and restarted Apache.

    NameVirtualHost 27:8080
    <VirtualHost 27:8080>

    I change Varnish to the below:

    VARNISH_LISTEN_ADDRESS=27
    VARNISH_LISTEN_PORT=80

    And also in default.vcl:

    backend default {
    .host = "27";
    .port = "8080";
    }

    Shouldn't that be it?

    Varnish refuses to start, without giving any error message as soon as I try to bring it up on port 80 and the log-file directory /var/log/vanish is empty... As long as I run on port 8090 or something, then it works by going to that port.
     
    #3 areha, Jun 27, 2014
    Last edited: Jun 27, 2014
  4. areha

    areha Well-Known Member

    Joined:
    Oct 30, 2002
    Messages:
    52
    Likes Received:
    0
    Trophy Points:
    6
    Solved it by using tweak and changing all sites to listen to 8080 and then start Varnish.

    Now I'm using Varnish for all sites on server, but let's see how it goes :) I suspect problems with sessions, but I hope not.
     
    #4 areha, Jun 27, 2014
    Last edited: Jun 27, 2014
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page