Solved

Varnish with WHM - cPanel

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
DNS @ Naked Domain Record 5 103
Can't connect to WAMP server 5 72
Apache LDAP Authentication 20 33
Create link to folder for use with apache. 7 33
Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
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 video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

828 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