Wednesday, July 15, 2009

Perlbal Configure Example.

--------------------------------------------------------------------
LOAD vhosts
LOAD vpaths
LOAD AccessControl
Load palimg
Load AccessControl

#SERVER aio_mode = ioaio

CREATE POOL poolserver1
POOL poolserver1 ADD 0.0.0.0:7200
POOL poolserver1 ADD 0.0.0.0:7201
POOL poolserver1 ADD 0.0.0.0:7202
POOL poolserver1 ADD 0.0.0.0:7203

CREATE SERVICE site
# NOTE: SSL mode only works for reverse_proxy, not for webserver.
# http://lists.danga.com/pipermail/perlbal/2008-April/000916.html
SET role = reverse_proxy
SET pool = poolserver1
SET listen = 0.0.0.0:443
SET persist_client = on
SET max_backend_uses = 10
SET backend_persist_cache = 2
SET persist_backend = on
SET verify_backend = on
SET balance_method = random
SET enable_ssl = on
SET ssl_key_file = /etc/perlbal/certs/server-key.pem
SET ssl_cert_file = /etc/perlbal/certs/server-cert.pem

# optionally set the cipher list. the default is "ALL:!LOW:!EXP"
SET ssl_cipher_list = ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL

ENABLE site

CREATE SERVICE web_stat
SET role = web_server
SET docroot = /mnt/app/current/public
SET dirindexing = on
ENABLE web_stat


CREATE SERVICE pub1
SET listen = 0.0.0.0:80
SET role = selector
SET plugins = vhosts
SET persist_client = on
VHOST example.com = server1
VHOST *.example.com = site
ENABLE pub1
#------------------------------
#CREATE POOL my_apache
#POOL my_apache ADD 127.0.0.1:

#CREATE SERVICE apps
# SET role = web_server
# SET docroot = /var/www/html/apps
# SET dirindexing = on
#ENABLE apps
--------------------------------------------------------------------------

Monday, February 9, 2009

How to Perlbal as Webserver with RAILS+MONGREL ..?

Hey Guys,

First Resolve All dependency with modules.
---------------------------------------------
Perl Module for Webserver and Balancer and Cpan Library.
Cpan : cpan script version 1.03, CPAN.pm version 1.7602
Danga-Socket-1.61
IO-AIO-3.17
Perlbal-XS-HTTPHeaders-0.19
libwww-perl-5.823
Sys-Syscall-0.22
FleetConf-0.01_016
Log-Dispatch-2.22
-----------------------------------------------
SSL need:
Net-SSLeay-1.35
Module-Install-0.79
IO-Socket-SSL-1.22
Net-IDN-Encode-0.02
IDNA-Punycode-0.03
IO-Compress-Zlib
-------------------------------------------------
For Gzip:
Compress::Raw::Zlib 2.015
IO::Compress::Base 2.015
IO::Uncompress::Base 2.015
IO::Compress::Zlib
-----------------------------------------------

Sunday, May 18, 2008

Apache Rewrite Rules

The Apache module mod_rewrite provides a powerful mechanism for hiding, redirecting, and reformatting request URLs. I just finished implementing a mod_rewrite scheme for timfanelli.com to accomplish 3 things:

1. Redirect old URLs with a 301 redirect code
2. Hide certain parts of the URL from my readers.
3. Optimize my Google pagerank.

Using a two simple rewrite rule
RewriteEngine on
RewriteRule ^/index.cgi(.*) /old.html [R=301]

To hide the /cgi-bin/blog.cgi portion of my URL.
RewriteRule ^/blog/(.*)$ /cgi-bin/blog.cgi/ [PT]
RewriteRule ^/$ /blog/ [R=301]
RewriteRule ^/blog$ /blog/ [R=301]

To redirect to domain name to www.domain.name
RewriteCond %{HTTP_HOST} ^yourdomain.com$
RewriteRule .* http://www.yourdomain.com [QSA]