lizongbo 的 编程学习

http://618119.com

BlogJava 首页 新随笔 联系 聚合 管理
  23 Posts :: 1 Stories :: 78 Comments :: 0 Trackbacks

2007年10月13日 #

     摘要: 新注册了个独立域名,使用独立的blog了。

http://618119.com

新的blog rss订阅地址: http://feed.feedsky.com/lizongbo

从最早的 http://blog.csdn.net/lizongbo,

到 http://blog.donews.com/lizongbo

再到http://www.blogjava.net/lizongbo

现在终于拥有自己的域名和独立的blog了。  阅读全文
posted @ 2007-10-16 09:46 lizongbo 的编程学习| 编辑 收藏

mysql 双机热备配置

1.下载mysql-noinstall-5.0.45-win32.zip
2.解压到E:\mysql,然后将文件夹E:\mysql\mysql-noinstall-5.0.45-win32改为E:\mysql\master
3.再解压到E:\mysql,然后将文件夹E:\mysql\mysql-noinstall-5.0.45-win32改为E:\mysql\slave
4.复制E:\mysql\master\my-small.ini为E:\mysql\master\my.ini
编辑内容:,增加log-bin和binlog-do-db参数
示例如下:
#skip-networking
server-id = 1

# Uncomment the following if you want to log updates
#log-bin=mysql-bin

log-bin=mysql-bin
binlog-do-db = testdb1 #需同步数据库  testdb1
binlog-do-db = testdb2 #需同步数据库  testdb2

5.复制E:\mysql\slave\my-small.ini为E:\mysql\slave\my.ini
编辑内容:,修改端口,
port  = 3310

示例如下:

[client]
#password = your_password
port  = 3310
socket  = /tmp/mysql.sock

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
port  = 3310
socket  = /tmp/mysql.sock
skip-locking
key_buffer = 16K
max_allowed_packet = 1M
table_cache = 4
sort_buffer_size = 64K
read_buffer_size = 256K
read_rnd_buffer_size = 256K
net_buffer_length = 2K
thread_stack = 64K


#skip-networking
server-id = 2

# Uncomment the following if you want to log updates
#log-bin=mysql-bin

master-host=127.0.0.1
master-user=root
master-password=
master-port=3306
replicate-do-db=testdb1
replicate-do-db=testdb2

6.保存 E:\mysql\master\my.ini.和E:\mysql\slave\my.ini

7.在命令行下运行E:\mysql\master\bin\mysqld.exe,

Microsoft Windows XP [版本 5.1.2600]
(C) 版权所有 1985-2001 Microsoft Corp.

E:\mysql\master\bin>mysqld

8.再新开命令行,运行E:\mysql\slave\bin\mysqld.exe

Microsoft Windows XP [版本 5.1.2600]
(C) 版权所有 1985-2001 Microsoft Corp.

E:\mysql\slave\bin>mysqld
071013 21:41:06 [Warning] The syntax for replication startup options is deprecat
ed and will be removed in MySQL 5.2. Please use 'CHANGE MASTER' instead.

9.用mysql 客户端 HeidiSQL连接到 127.0.0.1的3306,创建数据库testdb1和testdb2,
并在数据库中新建表,然后插入一些数据.

10.客户端连接 到 127.0.0.1的3310,可以看见数据库testdb1和testdb2,且数据库中的数据与master的数据库数据一致.

11.t查看 E:\mysql\master\data\mysql-bin.000001 和E:\mysql\master\data\mysql-bin.index,可以看到被记录的sql操作,

 




posted @ 2007-10-13 21:53 lizongbo 的编程学习| 编辑 收藏


4.4.6  Tomcat HTTPS配置
在server.xml里配置:
tomcat普通的https配置
    <Connector port="8443"
               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
               enableLookups="false" disableUploadTimeout="true"
               acceptCount="100" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLS"
           keystoreFile="conf/.keystore"
           keystorePass="lizongbo">
    </Connector>


Tomcat使用apr之后的ssl双向认证配置如下:

   <Connector port="8443" maxHttpHeaderSize="8192" protocol="HTTP/1.1"
              maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
              enableLookups="false" disableUploadTimeout="true"
              acceptCount="100" scheme="https" secure="true"
              clientAuth="true" <!--双向验证-->
              SSLEngine="on" bufferSize="8192"
              SSLEnabled="true"
              SSLProtocol="all"
              SSLCipherSuite="ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL"
              SSLCertificateFile="..\conf\ca\www.crt"
              SSLCertificateKeyFile="..\conf\ca\www.key"
              SSLCACertificateFile="..\conf\ca\ca.crt"
              SSLCACertificatePath="..\conf\ca"
              SSLVerifyDepth="15"
              SSLVerifyClient="require"
               />

 

4.6.6  Squid HTTPS
squid.conf中加上:
https_port 3443 cert=D:/ca/www.crt key=D:/ca/www.key


4.7.6  LightTPD HTTPS
首先使用copy命令把 key和crt合并为一个文件,
D:\ca>copy /b www.key+www.crt www.pem

然后配置如下:
$SERVER["socket"] == ":443" {
ssl.engine = "enable"
ssl.pemfile = "D:/ca/www.pem"
ssl.ca-file = "D:/ca/ca.crt"
server.name = "www"
server.document-root = "D:/httpsdosc"
server.errorlog = "httpserror.log"
accesslog.filename = "httpsaccess.log"
}
(下面的双向验证没有测试是否可用)
如需启用双向验证,则还需下面的配置参数:
ssl.verify-peer = "enable"
ssl.verify-depth  = 1
参考:http://trac.lighttpd.net/trac/ticket/921


 

posted @ 2007-10-13 13:50 lizongbo 的编程学习| 编辑 收藏