残酷の青春

journey continues

Overcoming MySQL’s 4GB Limit

(After having explained this for the 35th time, I decided it’s time to simply put something on-line.)
When a MyISAM table grows large enough, you’ll encounter the dreaded “The table is full” error. Now I could simply point at that page and leave this subject alone, but there’s more to this story.
When this happens, the first [...]

mysql jdbc在mysql下中文乱码解决

configure./configure –prefix=/usr/local/mysql –with-charset=gb2312 –with-extra-charsets=gbk,utf8
my.cnf增加这两行[mysqld]default-character-set=gbk
[client]default-character-set=gbk
jdbc url:jdbc:mysql://192.168.0.247:3306/bench?useUnicode=true&characterEncoding=GBK

squid反向代理

只说明几个关键的配置:
打开squid.conf
#squid服务器用80端口作为访问端口http_port 80#要代理的http服务器ip/域名httpd_accel_host localhost#如果是虚拟主机httpd_accel_host virtual test.mydomain.com#代理http服务器端口httpd_accel_port 80
squid.conf sample:http_port 80icp_port 0acl ALL_QUERY urlpath_regex [.]*http_access allow ALL_QUERYcache_mem 16 MBcache_dir ufs /tmp 256 16 256log_icp_queries offbuffered_logs onemulate_httpd_log onredirect_rewrites_host_header offhalf_closed_clients offacl all src 0.0.0.0/0.0.0.0http_access allow allcache_mgr adminhttpd_accel_host www.cruelyouth.comhttpd_accel_port 80visible_hostname cache1cache_effective_user squid_user

squid基本安装运行

1、下载一个可编译的稳定版本,目前版本应为2.5ftp://www.squid-cache.org/pub/squid-2/STABLE/
2、安装squid-2.5.STABLE5.tar.gz        % tar xzf squid-2.5.STABLE5.tar.gz        % cd squid-2.5.STABLE5        % ./configure –prefix=/usr/local/squid        % make        % make install
附configure options
  –prefix=PREFIX         install architecture-independent files in PREFIX                          [/usr/local/squid]  –enable-dlmalloc[=LIB] Compile & use the malloc package by Doug Lea  –enable-gnuregex       Compile GNUregex  –enable-splaytree      Use SPLAY trees to store ACL lists  –enable-xmalloc-debug  Do some simple malloc debugging  –enable-xmalloc-debug-trace                          Detailed trace of [...]

squid: part of Access Control configuration

ACL elements
Note: The information here is current for version 2.5.
Squid knows about the following types of ACL elements:

src: source (client) IP addresses
dst: destination (server) IP addresses
myip: the local IP address of a client’s connection
srcdomain: source (client) domain name
dstdomain: destination (server) domain name
srcdom_regex: source (client) regular expression pattern matching
dstdom_regex: destination (server) regular expression pattern matching
time: time [...]