Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Varnish with WHM - cPanel

Posted on 2013-11-10
4
Medium Priority
?
1,063 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 2000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

715 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