Varnish cache with Litespeed web server, vBulletin v4.1.2 Server Port

Testing vBulletin 4.1.2 with Varnish cache as proxy frontend to Litespeed web server v4.0.20 on a VPS server and came across an interesting problem, in admincp editing options i.e. turning on/off forums, it would timeout. If you use Unixy Varnish Cpanel plugin or Varnish cache, please read below.

Looking at Firebug NET monitoring I would see it trying to call forumdomainname:82/options.php?do

This is even with /admincp defined in Varnish vcl to be ignored from cache

if (req.url ~ "/admincp") { return (pass); }

I found out you need to add the Varnish vcl defined backend port for your server i.e. apache or litespeed to 2 php files in vBulletin v4.1.2.

i.e. Add port 82 for Unixy.net Cpanel Varnish plugin script.

in includes/class_core.php find on line 2003 the server port array

change from

		// Get server port
		$port = intval($_SERVER['SERVER_PORT']);
		$port = in_array($port, array(80, 443)) ? '' : ':' . $port;

to

		// Get server port
		$port = intval($_SERVER['SERVER_PORT']);
		$port = in_array($port, array(80, 82, 443)) ? '' : ':' . $port;

in install/includes/class_upgrade_install.php find on line 305 and change

from

		$port = intval($_SERVER['SERVER_PORT']);
		$port = in_array($port, array(80, 443)) ? '' : ':' . $port;

to

		$port = intval($_SERVER['SERVER_PORT']);
		$port = in_array($port, array(80, 82, 443)) ? '' : ':' . $port;

To date, I only tested Varnish cache as a proxy frontend to Apache or Litespeed with vBulletin 3.8.x series which didn’t have such problems. It’s my first test with vBulletin 4.x series with Varnish cache in front of Litespeed web server so not sure if this applies to Varnish/Apache combination too ? If others have tested Varnish and vBulletin v4.1.2, let me know if you encountered a similar problem.

Varnish cache, vBulletin Admincp port error

Varnish cache, vBulletin v4.1.2 server port modification

Varnish cache, vBulletin v4.1.2 server port modification


Previous:
Next:



MaxCDN Site Acceleration

Get Cost Effective Content Delivery
Unbeatable speed, stats, & price
http://www.maxcdn.com



2 Comments

  1. Hi George,

    Can you tell me what VCL configuration you was using for vbulletin 4?

    I cannot seem to find a working VCL, they all seem to have session, and cookie issues… using varnish 3.0.0

    Thank you for your time.

    Mick

  2. Hi Mick, the above was with Varnish 2.1 not 3.x which I haven’t played with much these days for manual installs, as I follow Cpanel Unixy Varnish plugins method of using per user session cookies – thus taking the headache out of worrying about cookies at the cost of a lower cache hit ratio.

    I am building on own local test server dedicated to testing various technologies I plan to play with, so probably then can further look at this. There’s only so much you can test via VPSes and Virtualbox/VMWare heh.

Trackbacks/Pingbacks

  1. Running PHPmyAdmin on Nginx, port 8080 passed to varnish not working well! - Just just easy answers - [...] common it seems with some scripts and Varnish i.e. with vbulletin and 4images script similar issues http://vbtechsupport.com/290/ and http://vbtechsupport.com/303/…

Leave a Comment