LuisManson
10 Jul 2010, 17:36
Since vbulletin uses a LOT of images plus CSS and JS i decided to separate all of them into cookie less domains
First of all on admincp set cookies only for your forum MAIN domain (ie www.mysite.com) not .mysite.com
DNS:
First of all i created some subdomains
static.mysite.com
static2.mysite.com
staticcss.mysite.com
staticjs.mysite.com
all of them pointing to the same server
Web server:
i created a new vhost:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Filesystem:
My vb site is in: /usr/local/www/web_mysite_com
and the static content is in: /usr/local/www/estaticos_mysite_com
inside this new vhost directory i also made two aliases (because of my permissions)
clientscript -> ../web_mysite_com/clientscript
images -> ../web_mysite_com/images
* given my permission direct access to this shite would give you a forbidden, maybe you could create an empty index file
htaccess:
i have a redirect for my domain so now i had to make a few changes to:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
plugin:
go to your admincp and create a new plugin in global_complete hook
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
*original code from here: http://www.vbulletin.org/forum/showpost.php?p=1910781&postcount=13
images:
Go yo "templates and styles"
choose your style and then in Style Vars filter by imgdir
replace those PATHs with new-hostname/ + original path
IE: images/buttons -> http://static2.mysite.com/images/buttons
NOTE: because a bug in vb code here you can make a real mess, check this report first:
http://tracker.vbulletin.com/browse/VBIV-7479
* Long story short:
a solution that worked for me was from David Grove:
The "fixes" described in the above comments are incorrect. To patch this issue, until v4.0.5 comes out, please edit line 489 of /admincp/stylevar.php, and change TYPE_ARRAY_ARRAY to TYPE_ARRAY.
So lines 485 through 491 should be changed from this:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
To this:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
This is of course, not the complete fix, but it will allow editing stylevars to work until v4.0.5 is released.
and you are done, now your site should be a bit faster
First of all on admincp set cookies only for your forum MAIN domain (ie www.mysite.com) not .mysite.com
DNS:
First of all i created some subdomains
static.mysite.com
static2.mysite.com
staticcss.mysite.com
staticjs.mysite.com
all of them pointing to the same server
Web server:
i created a new vhost:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Filesystem:
My vb site is in: /usr/local/www/web_mysite_com
and the static content is in: /usr/local/www/estaticos_mysite_com
inside this new vhost directory i also made two aliases (because of my permissions)
clientscript -> ../web_mysite_com/clientscript
images -> ../web_mysite_com/images
* given my permission direct access to this shite would give you a forbidden, maybe you could create an empty index file
htaccess:
i have a redirect for my domain so now i had to make a few changes to:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
plugin:
go to your admincp and create a new plugin in global_complete hook
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
*original code from here: http://www.vbulletin.org/forum/showpost.php?p=1910781&postcount=13
images:
Go yo "templates and styles"
choose your style and then in Style Vars filter by imgdir
replace those PATHs with new-hostname/ + original path
IE: images/buttons -> http://static2.mysite.com/images/buttons
NOTE: because a bug in vb code here you can make a real mess, check this report first:
http://tracker.vbulletin.com/browse/VBIV-7479
* Long story short:
a solution that worked for me was from David Grove:
The "fixes" described in the above comments are incorrect. To patch this issue, until v4.0.5 comes out, please edit line 489 of /admincp/stylevar.php, and change TYPE_ARRAY_ARRAY to TYPE_ARRAY.
So lines 485 through 491 should be changed from this:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
To this:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
This is of course, not the complete fix, but it will allow editing stylevars to work until v4.0.5 is released.
and you are done, now your site should be a bit faster