Solved

Varnish with WHM - cPanel

Posted on 2013-11-10
4
954 Views
Last Modified: 2013-11-11
We have a server right now with over 300 domains.

I have set the apache non ssl port to 82.

I have installed varnish and set varnish up to listen on port 80

in default.vcl

The port is set to 82 and the host I have tried both localhost and the actual main IP of the server.

I have rebuilt the vhosts file using the cpanel script: /scripts/rebuildhttpdconf

And restarted apache and varnish...

No matter what... every domain ends up going to the default cPanel page.

domainname.com/cgi-sys/defaultwebpage.cgi

Every answer I have seen with others having this issue, have done nothing that I haven't already tried.

So hopefully someone here has run into this before?

Thanks
0
Comment
Question by:kelvan
  • 2
  • 2
4 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 39637714
Have you set up the backend and the routing in the vcl? e.g.

This needs repeating for every domain.
backend site1{
  .host = "127.0.0.1";
  .port = "82";
}

sub vcl_recv {
; Repeat this block for every domain
   if (req.http.host == "site1.com") {
        set req.http.host = "www.site1.com";
        set req.backend = site1;
        return (lookup);
    }
0
 
LVL 1

Author Comment

by:kelvan
ID: 39637750
Well I set the backend up with the single IP...
I thought about doing it the way you just showed here,
but the information seems to be awfully conflicting on this.

With WHM/cPanel setup, a lot of people keep saying you
don't needto do anything but set the host to localhost or
127.0.0.1?

There are 1100 domains on this server...
I have to set the vcl file up with every single domain and
IP address?
0
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 39639006
Is the .vcl file including another file that has the routing in place?  What plugin are you using?
The host needs to be passed back to Apache else it will not know what domain is being accessed and it will just go to the default domain.

a lot of people keep saying you don't needto do anything but set the host to localhost or 127.0.0.1
That's fine where there is only one domain.
0
 
LVL 1

Author Closing Comment

by:kelvan
ID: 39639029
yep... added the routing and all is fine now. Just seem to have to figure some things out with wordpress.
0

Featured Post

Do email signature updates give you a headache?

Do you feel like all of your time is spent managing email signatures? Too busy to visit every user’s desk to make updates? Want high-quality HTML signatures on all devices, including on mobiles and Macs? Then, let Exclaimer solve all your email signature problems today!

Join & Write a Comment

Preface There are many applications where some computing systems need have their system clocks running synchronized within a small margin and eventually need to be in sync with the global time. There are different solutions for this, i.e. the W3…
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now