Solved

Varnish with WHM - cPanel

Posted on 2013-11-10
4
1,031 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
What You Need to Know when Searching for a Webhost Provider
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa‚Ķ

734 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