Solved

Varnish with WHM - cPanel

Posted on 2013-11-10
4
964 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

Are end users causing IT problems again?

You’ve taken the time to design and update all your end user’s email signatures, only to find out they’re messing up the HTML, changing the font and ruining the imagery. What can you do to prevent this? Find out how you can save your signatures from end users today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

912 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

17 Experts available now in Live!

Get 1:1 Help Now