Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Varnish help on setting up for multiple internal webservers

    Scheduled Pinned Locked Moved pfSense Packages
    66 Posts 10 Posters 29.2k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      kegler
      last edited by

      my pfsense management port i change to https

      change domain name on conf only for security purpose

      1 Reply Last reply Reply Quote 0
      • marcellocM
        marcelloc
        last edited by

        The conf looks fine. Are you still unable to start varnish?
        What files do you have on /usr/local/etc/rc.d ?

        Treinamentos de Elite: http://sys-squad.com

        Help a community developer! ;D

        1 Reply Last reply Reply Quote 0
        • K
          kegler
          last edited by

          @marcelloc:

          The conf looks fine. Are you still unable to start varnish?
          What files do you have on /usr/local/etc/rc.d ?

          varnish.sh
          varnishd
          varnishlog
          varnishncsa
          clamd

          1 Reply Last reply Reply Quote 0
          • marcellocM
            marcelloc
            last edited by

            The file is there and package is installed, it should work.  ???

            Just to check, see if varnish package is installed with pkg_info on console.

            ps ax | grep varnish will show if there is any varnish process running.

            Treinamentos de Elite: http://sys-squad.com

            Help a community developer! ;D

            1 Reply Last reply Reply Quote 0
            • K
              kegler
              last edited by

              @marcelloc:

              The file is there and package is installed, it should work.  ???

              Just to check, see if varnish package is installed with pkg_info on console.

              ps ax | grep varnish will show if there is any varnish process running.

              18796  0  S+    0:00.00 grep varnish

              looks like not running?

              1 Reply Last reply Reply Quote 0
              • marcellocM
                marcelloc
                last edited by

                What about pkg_info cmd?

                What does returns /usr/local/etc/rc.d/varnish.sh start

                Treinamentos de Elite: http://sys-squad.com

                Help a community developer! ;D

                1 Reply Last reply Reply Quote 0
                • K
                  kegler
                  last edited by

                  @marcelloc:

                  What about pkg_info cmd?

                  What does returns /usr/local/etc/rc.d/varnish.sh start

                  sorry what is the cmd to check the above ?

                  1 Reply Last reply Reply Quote 0
                  • K
                    kegler
                    last edited by

                    [2.0-RELEASE][admin@kegpfs.kegnet.com]/usr/local/etc/rc.d(6): varnish.sh start
                    varnish.sh: Command not found.

                    seems something not installed ?

                    1 Reply Last reply Reply Quote 0
                    • marcellocM
                      marcelloc
                      last edited by

                      Do not chdir to rc.d, Run varnish.sh with full path

                      Treinamentos de Elite: http://sys-squad.com

                      Help a community developer! ;D

                      1 Reply Last reply Reply Quote 0
                      • K
                        kegler
                        last edited by

                        @marcelloc:

                        Do not chdir to rc.d, Run varnish.sh with full path

                        kern.ipc.nmbclusters: 65536
                        sysctl: kern.ipc.nmbclusters: Invalid argument
                        kern.ipc.somaxconn: 16384 -> 16384
                        kern.maxfiles: 131072 -> 131072
                        kern.maxfilesperproc: 104856 -> 104856
                        kern.threads.max_threads_per_proc: 4096 -> 4096

                        wondering could it be due to my domain is host by no-ip.com?

                        1 Reply Last reply Reply Quote 0
                        • K
                          kegler
                          last edited by

                          php: /pkg_edit.php: The command '/usr/local/etc/rc.d/varnish.sh' returned exit code '2', the output was 'kern.ipc.nmbclusters: 65536 sysctl: kern.ipc.nmbclusters: Invalid argument kern.ipc.somaxconn: 16384 -> 16384 kern.maxfiles: 131072 -> 131072 kern.maxfilesperproc: 104856 -> 104856 kern.threads.max_threads_per_proc: 4096 -> 4096 storage_malloc: max size 1024 MB. Message from VCC-compiler: Expected ';' got '/' (program line 369), at (input Line 28 Pos 26) .url = ""/""; –-----------------------#--- In backend specification starting at: (input Line 21 Pos 1) backend kegapp33BACKEND { #######------------------ Running VCC-compiler failed, exit 1 VCL compilation failed'

                          saw this in my log… but i dont quite understand what went wrong

                          and i kvm into my pfsense and saw this on the screen.... seems like its stucked at the loading of varnish....

                          i think i messed up the pfsense somewhere

                          1 Reply Last reply Reply Quote 0
                          • marcellocM
                            marcelloc
                            last edited by

                            Remove quotes from your backend Test url

                            .url = ""/"";

                            Treinamentos de Elite: http://sys-squad.com

                            Help a community developer! ;D

                            1 Reply Last reply Reply Quote 0
                            • K
                              kegler
                              last edited by

                              omg…it worked now...thank you very much....

                              1 Reply Last reply Reply Quote 0
                              • C
                                canefield
                                last edited by

                                @marcelloc:

                                Each backend means a webserver

                                inside each configuration, you must provide:

                                • Backend name = WindowsServer

                                • Ip Address = 192.168.1.4

                                • Port = 80 <– Q

                                • Probe URL = "/"(if your server has a valid page on "/")

                                • Probe Interval = 5

                                • Probe Timeout = 1

                                • Probe window = 5

                                • Probe Threshold = 3

                                Q:
                                Can I enter multiple listening ports e.g. port: "80, 443"? Or should I configure that host several times according to how many ports it is listening on?

                                Thanks,
                                Canefield

                                1 Reply Last reply Reply Quote 0
                                • marcellocM
                                  marcelloc
                                  last edited by

                                  I think you need one port for each config as varnish is going to check backend health as well send traffic based on this port.

                                  Keep in mind That varnish implemets http balance/cache only. If you what to balance https as well, haproxy can do this.

                                  Pound and relayd can do client/firewall ssl comunication and then forward client request to varnish, but there is no gui options for this yet.

                                  Treinamentos de Elite: http://sys-squad.com

                                  Help a community developer! ;D

                                  1 Reply Last reply Reply Quote 0
                                  • L
                                    Landmine
                                    last edited by

                                    Hate to jump on someone else's thread, but I've gone threw all the same motions, but still no results.

                                    web1.domain.com
                                    web2.domain.com

                                    All end up pointing to the pfSense login, so my question is simply this… What IP do you point the Rule to? the pfSense box that host Varnish?

                                    1 Reply Last reply Reply Quote 0
                                    • marcellocM
                                      marcelloc
                                      last edited by

                                      Did you changed  pfsense gui port?
                                      This current varnish gui implementation listens deamon on all interfaces.

                                      Treinamentos de Elite: http://sys-squad.com

                                      Help a community developer! ;D

                                      1 Reply Last reply Reply Quote 0
                                      • L
                                        Landmine
                                        last edited by

                                        I did now and it works!

                                        Guess next time I need to slow down and read all the helpful text.

                                        Thank you

                                        1 Reply Last reply Reply Quote 0
                                        • L
                                          Landmine
                                          last edited by

                                          Correction, it was working. I didnt change anything and I'm getting the 503 errors again  :(

                                          –---------- Update ------------

                                          I only get the 503 error on 1 of the 2 domains.

                                          ------------ Update ------------

                                          Removing the Backend mapping with the http:// on it seemed to fix the issue.

                                          ------------ Update ------------

                                          Down again after about 30 seconds.  >:(

                                          1 Reply Last reply Reply Quote 0
                                          • marcellocM
                                            marcelloc
                                            last edited by

                                            That's probably a backend health url check problem.

                                            Add varnish widget to dashboard to see backend status.

                                            The 503 error means could not find any available backend.

                                            Also try to see backend configuration file on view configuration.

                                            Treinamentos de Elite: http://sys-squad.com

                                            Help a community developer! ;D

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.