锘??xml version="1.0" encoding="utf-8" standalone="yes"?>
http://618119.com
鏂扮殑blog rss璁㈤槄鍦板潃錛?http://feed.feedsky.com/lizongbo
浠庢渶鏃╃殑 http://blog.csdn.net/lizongbo,
鍒?http://blog.donews.com/lizongbo
鍐嶅埌http://www.tkk7.com/lizongbo
鐜板湪緇堜簬鎷ユ湁鑷繁鐨勫煙鍚嶅拰鐙珛鐨刡log浜嗐?nbsp; 闃呰鍏ㄦ枃
]]>
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涓篍:\mysql\master\my.ini
緙栬緫鍐呭:,澧炲姞log-bin鍜宐inlog-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 #闇鍚屾鏁版嵁搴?nbsp; testdb1
binlog-do-db = testdb2 #闇鍚屾鏁版嵁搴?nbsp; testdb2
5.澶嶅埗E:\mysql\slave\my-small.ini涓篍:\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.鍜孍:\mysql\slave\my.ini
7.鍦ㄥ懡浠よ涓嬭繍琛孍:\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.鐢╩ysql 瀹㈡埛绔?HeidiSQL榪炴帴鍒?127.0.0.1鐨?306,鍒涘緩鏁版嵁搴搕estdb1鍜宼estdb2,
騫跺湪鏁版嵁搴撲腑鏂板緩琛?鐒跺悗鎻掑叆涓浜涙暟鎹?
10.瀹㈡埛绔繛鎺?鍒?127.0.0.1鐨?310,鍙互鐪嬭鏁版嵁搴搕estdb1鍜宼estdb2,涓旀暟鎹簱涓殑鏁版嵁涓巑aster鐨勬暟鎹簱鏁版嵁涓鑷?
11.t鏌ョ湅 E:\mysql\master\data\mysql-bin.000001 鍜孍:\mysql\master\data\mysql-bin.index,鍙互鐪嬪埌琚褰曠殑sql鎿嶄綔,
Tomcat浣跨敤apr涔嬪悗鐨剆sl鍙屽悜璁よ瘉閰嶇疆濡備笅:
<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鍜宑rt鍚堝茍涓轟竴涓枃浠訛紝
D:\ca>copy /b www.key+www.crt www.pem
鐒跺悗閰嶇疆濡備笅錛?br />
$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
import org.jivesoftware.smack.packet.IQ;
/**
聽* @author John Wilson
聽*
聽*/
public class JabberRPC extends IQ {
聽 聽 聽 聽 private final String xml;
聽 聽 聽 聽 public JabberRPC(final String xml) {
聽 聽 聽 聽 聽 聽 聽 聽 this.xml = "<query xmlns='jabber:iq:rpc'>\n" + xml + "\n</query>";
聽 聽 聽 聽 }
聽 聽 聽 聽 public String getChildElementXML() {
聽 聽 聽 聽 聽 聽 聽 聽 return this.xml;
聽 聽 聽 聽 }
/**
聽* @author John Wilson
聽*
聽*/
public class JabberRPCProvider implements IQProvider {
聽 聽 聽 聽 public IQ parseIQ(final XmlPullParser parser) throws Exception {
聽 聽 聽 聽 聽 聽 聽 聽 final StringBuffer buffer = new StringBuffer();
聽 聽 聽 聽 聽 聽 聽 聽 // skip the <query> tag by calling parser.next()
聽 聽 聽 聽 聽 聽 聽 聽 while (true) {
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 switch (parser.next()) {
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 case XmlPullParser.TEXT:
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 // We need to escape characters like & and <
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 buffer.append(StringUtils.escapeForXML(parser.getText()));
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 break;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 case XmlPullParser.START_TAG:
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 buffer.append('<' + parser.getName() + '>');
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 break;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 case XmlPullParser.END_TAG:
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 if ("query".equals(parser.getName())) {
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 // don't save the </query> end tag
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 return new JabberRPC(buffer.toString().trim());
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 } else {
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 buffer.append("</" + parser.getName() + '>');
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 break;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 }
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 default:
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 }
聽 聽 聽 聽 聽 聽 聽 聽 }
聽 聽 聽 聽 }
4.smack瀹㈡埛绔緥瀛?
try {
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 XMPPConnection con = new XMPPConnection("127.0.0.1", 5222);
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 con.login("username", "password");
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 //娉ㄥ唽IQProvider
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 org.jivesoftware.smack.provider.ProviderManager.addIQProvider(
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 "query", "jabber:iq:rpc", new JabberRPCProvider());
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 // 鐩戝惉鎵鏈夌殑鍖?
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 con.addPacketListener(new PacketListener() {
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 public void processPacket(Packet packet) {
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 if (packet instanceof org.jivesoftware.smack.packet.IQ) {
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 org.jivesoftware.smack.packet.IQ iq =
(org.jivesoftware.smack.packet.IQ) packet;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 System.out.println("rpc鍐呭涓?" + iq.getChildElementXML());
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 }
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 }
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 }, new org.jivesoftware.smack.filter.PacketFilter() {
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 public boolean accept(Packet arg0) {
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 return true;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 }
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 });
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 con.createChat("xmlrpc.lizongbo.im").sendMessage("嫻嬭瘯鍙戦?");
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 JabberRPC jp = new JabberRPC("xmlrpc");
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 jp.setType(org.jivesoftware.smack.packet.IQ.Type.SET);
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 jp.setTo("xmlrpc.lizongbo.im");
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 con.sendPacket(jp);
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 Thread.sleep(25000);
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 con.close();
聽 聽 聽 聽 聽 聽 聽 聽 } catch (Exception e) {
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 e.printStackTrace();
聽 聽 聽 聽 聽 聽 聽 聽 }
5.鏈嶅姟绔洖搴斾竴涓獂mlrpc鍖?
wildfire涓氳繃鎻掍歡榪涜鍝嶅簲:
public void processPacket(Packet p) {
聽 聽 聽 聽 聽 聽 聽 聽 if (p instanceof IQ) {
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 IQ iq =(IQ)p;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 IQ niq=IQ.createResultIQ(iq);
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 Element responseElement=niq.setChildElement("query",
"jabber:iq:rpc");
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 try {
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 java.util.Vector v=new 聽java.util.Vector();
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 v.add("lizongbo 聽xmpp");
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 v.add("jabber-rpc lizongbo");
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 v.add("xep-0009 lizongbo");
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 XmlRpcResponseProcessor xrrp=new XmlRpcResponseProcessor();
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 String rs= new String( xrrp.encodeResponse(v, "UTF-8"));
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 org.dom4j.Document re=org.dom4j.DocumentHelper.parseText(rs);
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 responseElement.add(re.getRootElement());
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 componentManager.sendPacket(this, niq);
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 } catch (Exception e) {
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 e.printStackTrace();
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 }
聽 聽 聽 聽 聽 聽 聽 聽 }
聽 聽 聽 聽 }
6.瀹㈡埛绔緭鍑虹粨鏋滀負: