Magento – Domain Issue and Varnish Extension

apachemagento-1.9varnish

I ınstalled Nexcess Turpentine Varnish Cache extension and installed varnish 3. to my server. Configured files to listen port 8080.
This is my Tcp check:

tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 5223/varnishd
tcp 0 0 :::80 :::* LISTEN 5223/varnishd

No httpd appears as you see.

I changed default port of apache to 8080 via Cpanel>Tweak Settings.

My problem is when i try to type my address bar "solempet.com" and click enter it appears as "Default Website Page"

But when i try to type my address bar "www.solempet.com" or https://solempet.com my site loads perfectly.

It's a fresh magento installation and i setted "use secure urls" beginning at the magento installation.
Here is some screenshots about my configuration of varnish and httpd.conf;

Virtualhosts
Htpd.conf Listen Ports

Varnish default.vcl
enter image description here

Problem page

Best Answer

this issue is 100 years old...

first of all you need to use Turpentine vcl file, after you go to Cache Management, click save Varnish Config, will be located in

/home/solempet/public_html/var/default.vcl

to make it more easier for you, you can symlink it:

cd /etc/varnish
rm default.vcl
ln -s /home/solempet/public_html/var/default.vcl  ./default.vcl

second part, is that your backend IP address must be the same as per cPanel account configuration. configure it in Turpentine settings, in magento admin.

your Varnish startup config file:

/etc/sysconfig/varnish


DAEMON_OPTS="-a :80 \
             -T 127.0.0.1:6082 \
             -f /etc/varnish/default.vcl \
             -u varnish -g varnish \
             -p thread_pool_min=200 \
             -p thread_pool_max=4000 \
             -p thread_pool_add_delay=2 \
             -p cli_timeout=25 \
             -p cli_buffer=26384 \
             -p esi_syntax=0x2 \
             -p session_linger=100 \
             -S /etc/varnish/secret \
             -s malloc,3G"