Friday, December 17, 2010

Software loadbalancer with Subdomain

NameVirtualHost Public IP Address:80


ServerName www.websitename.com
ServerAlias websitename.com
DocumentRoot /var/www/

Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/" env=BALANCER_ROUTE_CHANGED

Options +FollowSymlinks
RewriteEngine on
Order deny,allow
Allow from all



BalancerMember http://Local IP Address route=node1
BalancerMember http://Local IP Address route=node2
ProxySet stickysession=ROUTEID
ProxySet lbmethod=byrequests


ProxyPass /balancer-manager !
ProxyPass / balancer://mycluster/
ProxyPassReverse / http://Local IP Address/
ProxyPassReverse / http://Local IP Address/

SetHandler balancer-manager
Options FollowSymLinks
Order deny,allow
Allow from all


ErrorLog logs/sitename_error
CustomLog logs/sitename_custom "%t Time=%D %h LocalIP=%A FileName=%f FirstLineOfReq=%r RequestedURLWOQueryString=%U CanonicalServerName=%v Referrer=\"%{Referer}i\" Node=%{ROUTEID}C Worker=\"%{BALANCER_WORKER_NAME}e\""




ServerName www.Subdomain.websitename.com
ServerAlias subdomain.websitename.com
DocumentRoot /var/www/

Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/" env=BALANCER_ROUTE_CHANGED

Options +FollowSymlinks
RewriteEngine on
Order deny,allow
Allow from all



BalancerMember http://Local IP Address/advertiser route=node1
BalancerMember http://Local IP Address/advertiser route=node2
ProxySet stickysession=ROUTEID
ProxySet lbmethod=byrequests


ProxyPass /balancer-manager !
ProxyPass / balancer://mycluster/
ProxyPassReverse / http://Local IP Address/advertiser/
ProxyPassReverse / http://Local IP Address/advertiser/

SetHandler balancer-manager
Options FollowSymLinks
Order deny,allow
Allow from all


ErrorLog logs/sitename_error
#CustomLog logs/sitename_custom "%t %T %h %A %r %f %U %{ROUTEID}C %v %V %>s %b \"%{Referer}i\" \"%{BALANCER_WORKER_NAME}e\""
CustomLog logs/sitename_custom "%t Time=%D %h LocalIP=%A FileName=%f FirstLineOfReq=%r RequestedURLWOQueryString=%U CanonicalServerName=%v Referrer=\"%{Referer}i\" Node=%{ROUTEID}C Worker=\"%{BALANCER_WORKER_NAME}e\""




ServerName www.subdomain.websitename.com
ServerAlias subdomain.websitename.com
DocumentRoot /var/www/

Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/" env=BALANCER_ROUTE_CHANGED


Order deny,allow
Allow from all



BalancerMember http://Local IP Address/corporate route=node1
BalancerMember http://Local IP Address/corporate route=node2
ProxySet stickysession=ROUTEID
ProxySet lbmethod=byrequests


ProxyPass /balancer-manager !
ProxyPass / balancer://mycluster/
ProxyPassReverse / http://Local IP Address/corporate/
ProxyPassReverse / http://Local IP Address/corporate/

SetHandler balancer-manager
Order deny,allow
Allow from all


ErrorLog logs/sitename_error
#CustomLog logs/sitename_custom "%t %T %h %A %r %f %U %{ROUTEID}C %v %V %>s %b \"%{Referer}i\" \"%{BALANCER_WORKER_NAME}e\""
CustomLog logs/sitename_custom "%t Time=%D %h LocalIP=%A FileName=%f FirstLineOfReq=%r RequestedURLWOQueryString=%U CanonicalServerName=%v Referrer=\"%{Referer}i\" Node=%{ROUTEID}C Worker=\"%{BALANCER_WORKER_NAME}e\""
Thursday, December 16, 2010

Upgarde PHP via Pleask

http://www.swiftcore.com/en/software/upgrade-php-52x-plesk-default-php-51x.html


Upgrade PHP to 5.2.x from Plesk default PHP 5.1.x
July 31, 2009 - 5:09pm — Yuan Quan

By default Plesk installation, the PHP version is 5.1.x, if you want to upgrade it to 5.2 or even 5.3, please follow these steps:

Login via SSH as root user first.

Upgrading PHP:

wget -q -O - http://www.atomicorp.com/installers/atomic.sh | sh
yum update php