<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    隨筆-295  評論-26  文章-1  trackbacks-0
     

    拷貝函數:

    function clone(source:Object):* {
    ?var copier:ByteArray = new ByteArray();
    ?copier.writeObject(source);
    ?copier.position = 0;
    ?return(copier.readObject());
    }

    使用方法:

    newObjectCopy = clone(originalObject);

    posted @ 2008-09-16 20:21 華夢行 閱讀(96) | 評論 (0)編輯 收藏

    #
    # Virtual Hosts
    #
    # If you want to maintain multiple domains/hostnames on your
    # machine you can setup VirtualHost containers for them. Most configurations
    # use only name-based virtual hosts so the server doesn't need to worry about
    # IP addresses. This is indicated by the asterisks in the directives below.
    #
    # Please see the documentation at
    # <URL:http://httpd.apache.org/docs/2.2/vhosts/>
    # for further details before you try to setup virtual hosts.
    #
    # You may use the command line option '-S' to verify your virtual host
    # configuration.

    #
    # Use name-based virtual hosting.
    #
    #
    # VirtualHost example:
    # Almost any Apache directive may go into a VirtualHost container.
    # The first VirtualHost section is used for all requests that do not
    # match a ServerName or ServerAlias in any <VirtualHost> block.
    #
    NameVirtualHost 211.152.56.216:80
    <VirtualHost bbs.justong.cn:80>
    ? #? ServerAdmin webmaster@dummy-host2.bbs.justong.cn
    ??? DocumentRoot "D:/Apache2.2/htdocs"
    ??? ServerName bbs.xx.cn
    ???? ServerAlias bbs.xxx.cn
    ??? ErrorLog "logs/error.log"
    ?#?? CustomLog "logs/dummy-host2.bbs.justong.cn-access.log" common
    </VirtualHost>
    <Directory "E:/217_bakcup_0303/apache-tomcat-5.5.20/webapps/phpcms">
    ??? #
    ??? # Possible values for the Options directive are "None", "All",
    ??? # or any combination of:
    ??? #?? Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    ??? #
    ??? # Note that "MultiViews" must be named *explicitly* --- "Options All"
    ??? # doesn't give it to you.
    ??? #
    ??? # The Options directive is both complicated and important.? Please see
    ??? # http://httpd.apache.org/docs/2.2/mod/core.html#options
    ??? # for more information.
    ??? #
    ??? Options Indexes FollowSymLinks

    ??? #
    ??? # AllowOverride controls what directives may be placed in .htaccess files.
    ??? # It can be "All", "None", or any combination of the keywords:
    ??? #?? Options FileInfo AuthConfig Limit
    ??? #
    ??? AllowOverride None

    ??? #
    ??? # Controls who can get stuff from this server.
    ??? #
    ??? Order allow,deny
    ??? Allow from all

    </Directory>
    <Directory "E:/217_bakcup_0303/apache-tomcat-5.5.20/webapps/bbb">
    ??? #
    ??? # Possible values for the Options directive are "None", "All",
    ??? # or any combination of:
    ??? #?? Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    ??? #
    ??? # Note that "MultiViews" must be named *explicitly* --- "Options All"
    ??? # doesn't give it to you.
    ??? #
    ??? # The Options directive is both complicated and important.? Please see
    ??? # http://httpd.apache.org/docs/2.2/mod/core.html#options
    ??? # for more information.
    ??? #
    ??? Options Indexes FollowSymLinks

    ??? #
    ??? # AllowOverride controls what directives may be placed in .htaccess files.
    ??? # It can be "All", "None", or any combination of the keywords:
    ??? #?? Options FileInfo AuthConfig Limit
    ??? #
    ??? AllowOverride None

    ??? #
    ??? # Controls who can get stuff from this server.
    ??? #
    ??? Order allow,deny
    ??? Allow from all

    </Directory>

    <VirtualHost www.2dgame.cn:80>
    ? #? ServerAdmin webmaster@dummy-host2.bbs.justong.cn
    ??? DocumentRoot "E:/217_bakcup_0303/apache-tomcat-5.5.20/webapps/phpcms"
    ??? ServerName www.ddddd.cn
    ???? ServerAlias 2dgame.cn
    ??? ErrorLog "E:/217_bakcup_0303/apache-tomcat-5.5.20/webapps/error.log"
    ?#?? CustomLog "logs/dummy-host2.bbs.justong.cn-access.log" common
    </VirtualHost>
    <VirtualHost www.yqxiaoshuo.cn:80>?
    ??? DocumentRoot "E:/217_bakcup_0303/apache-tomcat-5.5.20/webapps/bbb"
    ??? ServerName www.yqxiaoshuo.cn
    ???? ServerAlias yqxiaoshuo.cn
    ??? ErrorLog "E:/217_bakcup_0303/apache-tomcat-5.5.20/webapps/error.log"

    </VirtualHost>

    posted @ 2008-09-16 17:16 華夢行 閱讀(486) | 評論 (0)編輯 收藏
         摘要: Phpcms 編碼規范 作者:淡淡風??來源:phpcms?? 1. ???? ...  閱讀全文
    posted @ 2008-08-20 14:05 華夢行 閱讀(220) | 評論 (0)編輯 收藏
    ?Security.loadPolicyFile("xmlsocket://"+SERVER_NAME+":5229");???
    目前來說這個跨域文件還只能加載一次這個是flashplayer的一個bug在flashplayer9中一直存在這個問題目前還沒有解決掉。 ?具體詳情參見 http://bugs.adobe.com/jira/browse/FP-67
    posted @ 2008-08-14 13:19 華夢行 閱讀(1437) | 評論 (0)編輯 收藏

    http://2dgame.cn? 正式上線了歡迎光臨一下。是一個關于 flash小游戲的網站

    posted @ 2008-08-11 08:18 華夢行 閱讀(264) | 評論 (0)編輯 收藏
    www.2dgame.cn?flash 小游戲 flash 小游戲 www.2dgame.cn? 熱門 小游戲
    posted @ 2008-08-07 12:42 華夢行 閱讀(345) | 評論 (2)編輯 收藏
    function iscn($str){
    if (preg_match("/.*[".chr(0xa1)."-".chr(0xff)."]+.*/", $str)) {
    return true;
    } else {
    return false;
    }
    }
    posted @ 2008-07-19 15:02 華夢行 閱讀(123) | 評論 (0)編輯 收藏

    package {
    ??? import flash.display.Sprite;
    ??? import flash.system.Capabilities;

    ??? public class CapabilitiesExample extends Sprite {
    ??????? public function CapabilitiesExample() {
    ??????????? showCapabilities();
    ??????? }
    ???????
    ??????? private function showCapabilities():void {
    ??????????? trace("avHardwareDisable: " + Capabilities.avHardwareDisable);
    ??????????? trace("hasAccessibility: " + Capabilities.hasAccessibility);
    ??????????? trace("hasAudio: " + Capabilities.hasAudio);
    ??????????? trace("hasAudioEncoder: " + Capabilities.hasAudioEncoder);
    ??????????? trace("hasEmbeddedVideo: " + Capabilities.hasEmbeddedVideo);
    ??????????? trace("hasMP3: " + Capabilities.hasMP3);
    ??????????? trace("hasPrinting: " + Capabilities.hasPrinting);
    ??????????? trace("hasScreenBroadcast: " + Capabilities.hasScreenBroadcast);
    ??????????? trace("hasScreenPlayback: " + Capabilities.hasScreenPlayback);
    ??????????? trace("hasStreamingAudio: " + Capabilities.hasStreamingAudio);
    ??????????? trace("hasVideoEncoder: " + Capabilities.hasVideoEncoder);
    ??????????? trace("isDebugger: " + Capabilities.isDebugger);
    ??????????? trace("language: " + Capabilities.language);
    ??????????? trace("localFileReadDisable: " + Capabilities.localFileReadDisable);
    ??????????? trace("manufacturer: " + Capabilities.manufacturer);
    ??????????? trace("os: " + Capabilities.os);
    ??????????? trace("pixelAspectRatio: " + Capabilities.pixelAspectRatio);
    ??????????? trace("playerType: " + Capabilities.playerType);
    ??????????? trace("screenColor: " + Capabilities.screenColor);
    ??????????? trace("screenDPI: " + Capabilities.screenDPI);
    ??????????? trace("screenResolutionX: " + Capabilities.screenResolutionX);
    ??????????? trace("screenResolutionY: " + Capabilities.screenResolutionY);
    ??????????? trace("serverString: " + Capabilities.serverString);
    ??????????? trace("version: " + Capabilities.version);
    ??????? }
    ??? }
    }
    返回結果:
    avHardwareDisable: false
    hasAccessibility: false
    hasAudio: true
    hasAudioEncoder: true
    hasEmbeddedVideo: true
    hasMP3: true
    hasPrinting: true
    hasScreenBroadcast: false
    hasScreenPlayback: true
    hasStreamingAudio: true
    hasVideoEncoder: true
    isDebugger: true
    language: zh-CN
    localFileReadDisable: false
    manufacturer: Adobe Windows
    os: Windows
    pixelAspectRatio: 1
    playerType: External
    screenColor: color
    screenDPI: 72
    screenResolutionX: 1024
    screenResolutionY: 768
    serverString: A=t&SA=t&SV=t&EV=t&MP3=t&AE=t&VE=t&ACC=f&PR=t&SP=t&SB=f&DEB=t&V=WIN%209%2C0%2C45%2C0&M=Adobe%20Windows&R=1024x768&DP=72&COL=color&AR=1.0&OS=Windows&L=zh-CN&IME=t&PT=External&AVD=f&LFD=f&WD=f&TLS=t
    version: WIN 9,0,45,0

    posted @ 2008-03-31 13:21 華夢行 閱讀(183) | 評論 (0)編輯 收藏

    ?
    package org.jivesoftware.xiff.core
    {?
    ?import flash.events.DataEvent;
    ?import flash.events.Event;
    ?import flash.events.EventDispatcher;
    ?import flash.events.IOErrorEvent;
    ?import flash.events.SecurityErrorEvent;
    ?import flash.events.TimerEvent;
    ?import flash.net.XMLSocket;
    ?import flash.utils.Timer;
    ?import flash.xml.XMLDocument;
    ?import flash.xml.XMLNode;
    ?
    ?import org.jivesoftware.xiff.data.IExtension;
    ?import org.jivesoftware.xiff.data.IQ;
    ?import org.jivesoftware.xiff.data.Message;
    ?import org.jivesoftware.xiff.data.Presence;
    ?import org.jivesoftware.xiff.data.XMPPStanza;
    ?import org.jivesoftware.xiff.data.auth.AuthExtension;
    ?import org.jivesoftware.xiff.data.forms.FormExtension;
    ?import org.jivesoftware.xiff.data.register.RegisterExtension;
    ?import org.jivesoftware.xiff.events.*;
    ?import org.jivesoftware.xiff.exception.SerializationException;

    ?/**
    ? * 當密碼修改成功的時候被觸發
    ? *
    ? * @eventType org.jivesoftware.xiff.events.ChangePasswordSuccessEvent.PASSWORD_SUCCESS
    ? */
    ??? [Event(name="changePasswordSuccess", type="org.jivesoftware.xiff.events.ChangePasswordSuccessEvent")]
    ???
    ??? /**
    ???? * 當成功的鏈接到服務器上的時候觸發
    ???? *
    ???? * @eventType org.jivesoftware.xiff.events.ConnectionSuccessEvent.CONNECT_SUCCESS
    ???? */
    ??? [Event(name="connection", type="org.jivesoftware.xiff.events.ConnectionSuccessEvent")]
    ???
    ??? /**
    ???? * 當與服務器斷開的時候將會被觸發
    ???? *
    ???? * @eventType org.jivesoftware.xiff.events.DisconnectionEvent.DISCONNECT
    ???? */
    ??? [Event(name="disconnection", type="org.jivesoftware.xiff.events.DisconnectionEvent")]
    ???
    ??? /**
    ???? * Dispatched when there is some type of XMPP error.
    ???? * 當有xmpp 錯誤的時候將會被觸發
    ???? * @eventType org.jivesoftware.xiff.events.XIFFErrorEvent.XIFF_ERROR
    ???? */
    ??? [Event(name="error", type="org.jivesoftware.xiff.events.XIFFErrorEvent")]
    ???
    ??? /**
    ???? * Dispatched whenever there is incoming XML data.
    ???? * 當有傳入的數據的時候將會被觸發
    ???? * @eventType org.jivesoftware.xiff.events.IncomingDataEvent.INCOMING_DATA
    ???? */
    ??? [Event(name="incomingData", type="org.jivesoftware.xiff.events.IncomingDataEvent")]
    ???
    ??? /**
    ???? * Dispatched on successful authentication (login) with the server.
    ???? * 當有用戶登陸成功的時候將會被觸發
    ???? * @eventType org.jivesoftware.xiff.events.LoginEvent.LOGIN
    ???? */
    ??? [Event(name="login", type="org.jivesoftware.xiff.events.LoginEvent")]
    ???
    ??? /**
    ???? * Dispatched on incoming messages.
    ???? *? 當有進入的消息的時候將會被觸發
    ???? * @eventType org.jivesoftware.xiff.events.MessageEvent.MESSAGE
    ???? */
    ??? [Event(name="message", type="org.jivesoftware.xiff.events.MessageEvent")]
    ???
    ??? /**
    ???? * Dispatched whenever data is sent to the server.
    ???? * 當有數據被傳往服務器端的時候觸發
    ???? * @eventType org.jivesoftware.xiff.events.OutgoingDataEvent.OUTGOING_DATA
    ???? */
    ??? [Event(name="outgoingData", type="org.jivesoftware.xiff.events.OutgoingDataEvent")]
    ???
    ??? /**
    ???? * Dispatched on incoming presence data.
    ???? *? 當進入是否在線相關數據的時候觸發
    ???? * @eventType org.jivesoftware.xiff.events.PresenceEvent.PRESENCE
    ???? */
    ??? [Event(name="presence", type="org.jivesoftware.xiff.events.PresenceEvent")]
    ???
    ??? /**
    ???? * Dispatched on when new user account registration is successful.
    ???? * 當用戶注冊成功的時候觸發
    ???? * @eventType org.jivesoftware.xiff.events.RegistrationSuccessEvent.REGISTRATION_SUCCESS
    ???? */
    ??? [Event(name="registrationSuccess", type="org.jivesoftware.xiff.events.RegistrationSuccessEvent")]
    ???
    ??? /**
    ???? * This class is used to connect to and manage data coming from an XMPP server. Use one instance
    ???? * of this class per connection.
    ???? * XMPPConnection這個類被用做連接和管理從服務器端發來的數據,每一個連接一個實例
    ???? */
    ?public class XMPPConnection extends EventDispatcher
    ?{
    ??/**
    ?? * @private
    ?? * 是否匿名登陸
    ?? */
    ??protected var _useAnonymousLogin:Boolean;
    ??
    ??/**
    ?? * @private
    ?? *xmlsocket
    ?? */
    ??protected var _socket:XMLSocket;
    ??
    ??/**
    ?? * @private
    ?? * 服務器地址或者名稱
    ?? */
    ??protected var myServer:String;
    ??
    ??/**
    ?? * @private
    ?? * 用戶名
    ?? */
    ??protected var myUsername:String;
    ??
    ??/**
    ?? * @private
    ?? * 綁定的資源名稱? 比如smark linkq msn 等
    ?? * */
    ??protected var myResource:String;
    ??
    ??/**
    ?? * @private
    ?? * 用戶密碼
    ?? */
    ??protected var myPassword:String;
    ?
    ??/**
    ?? * @private
    ?? * 登陸端口
    ?? */
    ??protected var myPort:Number;
    ??
    ??/**
    ?? * 是否已經激活
    ?? * @private
    ?? */
    ??protected var _active:Boolean;
    ??
    ??/**
    ?? * 是否已經登陸
    ?? * @private
    ?? */
    ??protected var loggedIn:Boolean;
    ??
    ??/**
    ?? * 是否忽略空白字符
    ?? * @private
    ?? */
    ??protected var ignoreWhitespace:Boolean;
    ??
    ??/**
    ?? * @private
    ?? * 打開流的標簽
    ?? */
    ??protected var openingStreamTag:String;
    ??
    ??/**
    ?? * @private
    ?? * 關閉流的標簽
    ?? */
    ??protected var closingStreamTag:String;

    ??/**
    ?? * @private
    ?? * 會話id
    ?? */
    ??protected var sessionID:String;
    ??
    ??/**
    ?? * @private
    ?? */
    ??protected var pendingIQs:Object;
    ??
    ??/**
    ?? * @private
    ?? */
    ??protected var _expireTagSearch:Boolean;
    ??
    ??protected static var _openConnections:Array = [];
    ??
    ??public function XMPPConnection()
    ??{?
    ???
    ???// Hash to hold callbacks for IQs
    ???pendingIQs = new Object();
    ???
    ???_useAnonymousLogin = false;
    ???active = false;
    ???loggedIn = false;
    ???ignoreWhitespace = true;
    ???//初始化為忽略空白字符
    ???resource = "xiff";
    ???//初始化資源為xiff
    ???port = 5222;
    ???
    ???AuthExtension.enable();
    ???RegisterExtension.enable();
    ???FormExtension.enable();
    ??}
    ??
    ??/**
    ?? * Connects to the server.
    ?? * 鏈接到服務器端
    ?? * @param streamType (Optional) The type of initial stream negotiation, either &lt;flash:stream&gt; or &lt;stream:stream&gt;.
    ?? * Some servers, like Jabber, Inc.'s XCP and Jabberd 1.4 expect &lt;flash:stream&gt; from a Flash client instead of the standard &lt;stream:stream&gt;.
    ?? * The options for this parameter are: "flash", "terminatedFlash", "standard" and "terminatedStandard". The default is "terminatedStandard".
    ?? *返回是否找到服務器
    ?? * @return A boolean indicating whether the server was found.
    ?? */
    ??public function connect( streamType:String = "terminatedStandard" ):Boolean
    ??{
    ???
    ???// Create the socket 創建一個socket連接字
    ???_socket = _createXmlSocket();
    ???
    ???active = false;
    ???loggedIn = false;
    ???
    ???///? 創建流樣式? <stream:flash>
    ???// Stream type lets user set opening/closing tag - some servers (jadc2s) prefer <stream:flash> to the standard
    ???// <stream:stream>
    ???switch( streamType ) {
    ????/////在xiff中用flash
    ????case "flash":
    ?????openingStreamTag = new String( "<?xml version=\"1.0\"?><flash:stream to=\"" + server + "\" xmlns=\"jabber:client\" xmlns:flash=\"?????closingStreamTag = new String( "</flash:stream>" );
    ?????break;
    ?????
    ????case "terminatedFlash":
    ?????openingStreamTag = new String( "<?xml version=\"1.0\"?><flash:stream to=\"" + server + "\" xmlns=\"jabber:client\" xmlns:flash=\"
    ?????closingStreamTag = new String( "</flash:stream>" );
    ?????break;
    ?????
    ????case "standard":
    ?????openingStreamTag = new String( "<?xml version=\"1.0\"?><stream:stream to=\"" + server + "\" xmlns=\"jabber:client\" xmlns:stream=\"
    ?????closingStreamTag = new String( "</stream:stream>" );
    ?????break;
    ???
    ????case "terminatedStandard":
    ????default:
    ?????openingStreamTag = new String( "<?xml version=\"1.0\"?><stream:stream to=\"" + server + "\" xmlns=\"jabber:client\" xmlns:stream=\"
    ?????closingStreamTag = new String( "</stream:stream>" );
    ?????break;
    ???}
    ???//鏈接到服務器如果成功返回true
    ???_socket.connect( server, port );
    ???return true;
    ??}
    ??
    ??/**
    ?? * 關閉與服務器的連接
    ?? * Disconnects from the server if currently connected. After disconnect,
    ?? * a <code>DisconnectionEvent.DISCONNECT</code> event is broadcast.
    ?? */
    ??public function disconnect():void
    ??{
    ???//如果鏈接是活動的,發送一個關閉流? 設置活動狀態為false
    ???if( isActive() ) {
    ????sendXML( closingStreamTag );
    ????_socket.close();
    ????active = false;
    ????loggedIn = false;
    ????var event:DisconnectionEvent = new DisconnectionEvent();
    ????dispatchEvent(event);
    ????//將關閉連接這個事件分發( 廣播)
    ???}
    ??}
    ??
    ??/**
    ?? * Sends data to the server. If the data to send cannot be serialized properly, this method throws a <code>SerializeException</code>.
    ?? *發送數據給服務器,如果數據不能被序列號則不能被發送
    ?? * @param o The data to send. This must be an instance of a class that implements the ISerializable interface.
    ??* 參數必須是已經實現了ISerriable接口的實例
    ?? *? * @see org.jivesoftware.xiff.data.ISerializable
    ?? * @example The following example sends a basic chat message to the user with the JID "
    sideshowbob@springfieldpenitentiary.gov".<br />
    ?? * <pre>var msg:Message = new Message( "sideshowbob@springfieldpenitentiary.gov", null, "Hi Bob.", "<b>Hi Bob.</b>", Message.CHAT_TYPE );
    ?? * myXMPPConnection.send( msg );</pre>
    ?? */
    ??public function send( o:XMPPStanza ):void
    ??{
    ???if( isActive() ) {
    ????///主要是處理? IQ(info 、query)
    ????if( o is IQ ) {
    ???????????????? var iq:IQ = o as IQ;
    ???????????????? if ((iq.callbackName != null && iq.callbackScope != null) || iq.callback != null)
    ???????????????? {
    ???????????????? ?addIQCallbackToPending( iq.id, iq.callbackName, iq.callbackScope, iq.callback );
    ???????????????? }??
    ????}
    ????var root:XMLNode = o.getNode().parentNode;
    ????if (root == null) {
    ?????root = new XMLDocument();
    ????}
    ?
    ????if (o.serialize(root)) {
    ?????sendXML( root.firstChild );
    ????} else {
    ?????throw new SerializationException();
    ????}
    ???}
    ??}
    ??///發送一個空包,保持這個聯結
    ??public function sendKeepAlive():void
    ??{
    ???if( isActive() ) {
    ????sendXML(" ");
    ???}
    ??}
    ??
    ??/**
    ?? * Determines whether the connection with the server is currently active. (Not necessarily logged in.
    ?? * For login status, use the <code>isLoggedIn()</code> method.)
    ?? * 檢測這個連接是否是活動的
    ?? * @return A boolean indicating whether the connection is active.
    ?? * @see org.jivesoftware.xiff.core.XMPPConnection#isLoggedIn
    ?? */
    ??public function isActive():Boolean
    ??{
    ???return active;
    ??}
    ??
    ??/**
    ?? * Determines whether the user is connected and logged into the server.
    ?? * 判斷用戶是否已經登陸
    ?? * @return A boolean indicating whether the user is logged in.
    ?? * @see org.jivesoftware.xiff.core.XMPPConnection#isActive
    ?? */
    ??public function isLoggedIn():Boolean
    ??{
    ???return loggedIn;
    ??}
    ??
    ??/**
    ?? * Issues a request for the information that must be submitted for registration with the server.
    ?? * 發布一個請求去獲取必須提交的信息以用來向服務器注冊,注冊用戶時用到
    ?? * When the data returns, a <code>RegistrationFieldsEvent.REG_FIELDS</code> event is dispatched
    ?? * containing the requested data.
    ?? */
    ??public function getRegistrationFields():void
    ??{
    ???var regIQ:IQ = new IQ( new JID(server), IQ.GET_TYPE, XMPPStanza.generateID("reg_info_"), "getRegistrationFields_result", this, null);
    ???regIQ.addExtension(new RegisterExtension(regIQ.getNode()));
    ?
    ???send( regIQ );
    ??}
    ??
    ??/**
    ?? * Registers a new account with the server, sending the registration data as specified in the fieldMap paramter.
    ?? * 向服務注冊一個新的帳號,發送注冊所需的數據
    ?? * @param fieldMap An object map containing the data to use for registration. The map should be composed of
    ?? * attribute:value pairs for each registration data item.
    ?? * @param key (Optional) If a key was passed in the "data" field of the "registrationFields" event,
    ?? * that key must also be passed here.
    ?? * required field needed for registration.
    ?? */
    ??public function sendRegistrationFields( fieldMap:Object, key:String ):void
    ??{
    ???var regIQ:IQ = new IQ( new JID(server), IQ.SET_TYPE, XMPPStanza.generateID("reg_attempt_"), "sendRegistrationFields_result", this, null );
    ???var ext:RegisterExtension = new RegisterExtension(regIQ.getNode());
    ?
    ???for( var i:String in fieldMap ) {
    ????ext[i] = fieldMap[i];
    ???}
    ???if (key != null) {
    ????ext.key = key;
    ???}
    ?
    ???regIQ.addExtension(ext);
    ???send( regIQ );
    ??}
    ??
    ??/**
    ?? * Changes the user's account password on the server. If the password change is successful,
    ?? * the class will broadcast a <code>ChangePasswordSuccessEvent.PASSWORD_SUCCESS</code> event.
    ?? *變更用戶帳號密碼, 如果成功將會觸發事件:ChangePasswordSuccessEvent.PASSWORD_SUCCESS
    ?? * @param newPassword The new password
    ?? */
    ??public function changePassword( newPassword:String ):void
    ??{
    ???var passwdIQ:IQ = new IQ( new JID(server), IQ.SET_TYPE, XMPPStanza.generateID("pswd_change_"), "changePassword_result", this, null );
    ???var ext:RegisterExtension = new RegisterExtension(passwdIQ.getNode());
    ?
    ???ext.username = jid.toBareJID();
    ???ext.password = newPassword;
    ?
    ???passwdIQ.addExtension(ext);
    ???send( passwdIQ );
    ??}
    ??
    ??/**
    ?? * Gets the fully qualified JID (user@server/resource) of the user. A fully-qualified JID includes
    ?? * the resource. A bare JID does not. To get the bare JID, use the <code>getBareJID()</code> method.
    ?? * 返回一個完整的jid user@server/resource
    ?? * @return The fully qualified JID
    ?? * @see #getBareJID
    ?? */
    ??public function get jid():JID
    ??{
    ???return new JID(myUsername + "@" + myServer + "/" + myResource);
    ??}
    ??
    ??/**
    ?? * @private? 修改密碼的返回情況
    ?? */
    ??protected function changePassword_result( resultIQ:IQ ):void
    ??{
    ???if( resultIQ.type == IQ.RESULT_TYPE ) {
    ????var event:ChangePasswordSuccessEvent = new ChangePasswordSuccessEvent();
    ????dispatchEvent(event);
    ???}
    ???else {
    ????// We weren't expecting this
    ????////400? 修改密碼錯誤
    ????dispatchError( "unexpected-request", "Unexpected Request", "wait", 400 );
    ???}
    ??}
    ??
    ??/**
    ?? * @private 注冊用戶的返回情況
    ?? */
    ??protected function getRegistrationFields_result( resultIQ:IQ ):void
    ??{
    ???try
    ???{
    ????var ext:RegisterExtension = resultIQ.getAllExtensionsByNS(RegisterExtension.NS)[0];
    ????var fields:Array = ext.getRequiredFieldNames(); //TODO, phase this out
    ????
    ????var event:RegistrationFieldsEvent = new RegistrationFieldsEvent();
    ????event.fields = fields;
    ????event.data = ext;
    ???}
    ???catch (e:Error)
    ??? {
    ??? ?trace(e.getStackTrace());
    ??? }
    ??}
    ??
    ??/**
    ?? * @private
    ?? */
    ??protected function sendRegistrationFields_result( resultIQ:IQ ):void
    ??{
    ???if( resultIQ.type == IQ.RESULT_TYPE ) {

    ????var event:RegistrationSuccessEvent = new RegistrationSuccessEvent();
    ????dispatchEvent( event );
    ???}
    ???else {
    ????// We weren't expecting this
    ????dispatchError( "unexpected-request", "Unexpected Request", "wait", 400 );
    ???}
    ??}
    ??
    ??// Listener function from the ListenerXMLSocket
    ??/**
    ?? * @private
    ?? */
    ??protected function socketConnected(ev:Event):void
    ??{
    ???active = true;
    ???sendXML( openingStreamTag );
    ???var event:ConnectionSuccessEvent = new ConnectionSuccessEvent();
    ???dispatchEvent( event );
    ??}
    ??
    ??/**
    ?? * @private
    ?? */
    ??protected function socketReceivedData( ev:DataEvent ):void
    ??{
    ???// parseXML is more strict in AS3 so we must check for the presence of flash:stream
    ???// the unterminated tag should be in the first string of xml data retured from the server
    ???if (!_expireTagSearch)
    ???{
    ????var pattern:RegExp = new RegExp("<flash:stream");
    ????var resultObj:Object = pattern.exec(ev.data);
    ????if (resultObj != null) // stop searching for unterminated node
    ????{
    ?????ev.data = ev.data.concat("</flash:stream>");
    ?????_expireTagSearch = true;
    ????}
    ???}
    ???
    ???if(ev.data == "</flash:stream>")
    ???{
    ????socketClosed(null);
    ????return;?
    ???}?
    ???
    ???var xmlData:XMLDocument = new XMLDocument();
    ???xmlData.ignoreWhite = this.ignoreWhite;
    ???xmlData.parseXML( ev.data );
    ???
    ???var event:IncomingDataEvent = new IncomingDataEvent();
    ???event.data = xmlData;
    ???dispatchEvent( event );
    ???
    ???// Read the data and send it to the appropriate parser
    ???var firstNode:XMLNode = xmlData.firstChild;
    ???var nodeName:String = firstNode.nodeName.toLowerCase();
    ???//trace("RECV: " + firstNode);
    ???switch( nodeName )
    ???{
    ????case "stream:stream":
    ????case "flash:stream":
    ?????_expireTagSearch = false;
    ?????handleStream( firstNode );
    ?????break;
    ?????
    ????case "stream:error":
    ?????handleStreamError( firstNode );
    ?????break;
    ?????
    ????case "iq":
    ?????handleIQ( firstNode );
    ?????break;
    ?????
    ????case "message":
    ?????handleMessage( firstNode );
    ?????break;
    ?????
    ????case "presence":
    ?????handlePresence( firstNode );
    ?????break;
    ?????
    ????case "stream:features":
    ?????break;
    ?????
    ????default:
    ?????// silently ignore lack of or unknown stanzas
    ?????// if the app designer wishes to handle raw data they
    ?????// can on "incomingData".
    ?
    ?????// Use case: received null byte, XMLSocket parses empty document
    ?????// sends empty document
    ?????
    ?????// I am enabling this for debugging
    ?????dispatchError( "undefined-condition", "Unknown Error", "modify", 500 );
    ?????break;
    ???}
    ??}
    ??
    ??/**
    ?? * @private
    ?? */
    ??protected function socketClosed(e:Event):void
    ??{?
    ???var event:DisconnectionEvent = new DisconnectionEvent();
    ???dispatchEvent( event );
    ??}
    ??
    ??/**
    ?? * @private
    ?? */
    ??protected function handleStream( node:XMLNode ):void
    ??{
    ???sessionID = node.attributes.id;
    ???server = node.attributes.from;
    ???
    ???if(_useAnonymousLogin) {
    ????// Begin anonymous login
    ????sendAnonymousLogin();
    ???} else if( username != null && username.length > 0 ) {
    ????// Begin login sequence
    ????beginAuthentication();
    ???} else {
    ????//get registration fields
    ????getRegistrationFields();
    ???}
    ??}
    ??
    ??/**
    ?? * @private
    ?? */
    ??protected function handleStreamError( node:XMLNode ):void
    ??{
    ???dispatchError( "service-unavailable", "Remote Server Error", "cancel", 502 );
    ???
    ???// Cancel everything by closing connection
    ???try {
    ????_socket.close();
    ???}
    ???catch (error:Error){
    ????
    ???}
    ???active = false;
    ???loggedIn = false;
    ???var event:DisconnectionEvent = new DisconnectionEvent();
    ???
    ???dispatchEvent( event );
    ??}
    ??
    ??protected function set active(flag:Boolean):void
    ??{
    ???if(flag)
    ???{
    ????_openConnections.push(this);
    ???}
    ???else
    ???{
    ????_openConnections.splice(_openConnections.indexOf(this), 1);
    ???}
    ???_active = flag;
    ??}
    ??
    ??protected function get active():Boolean
    ??{
    ???return _active;
    ??}
    ??
    ??public static function get openConnections():Array
    ??{
    ???return _openConnections;
    ??}
    ??
    ??/**
    ?? * @private
    ?? */
    ??protected function handleIQ( node:XMLNode ):IQ
    ??{
    ???var iq:IQ = new IQ();
    ???// Populate the IQ with the incoming data
    ???if( !iq.deserialize( node ) ) {
    ????throw new SerializationException();
    ???}
    ???
    ???// If it's an error, handle it
    ???
    ???if( iq.type == IQ.ERROR_TYPE && !pendingIQs[iq.id]) {
    ????dispatchError( iq.errorCondition, iq.errorMessage, iq.errorType, iq.errorCode );
    ???}
    ???else {
    ????
    ????// Start the callback for this IQ if one exists
    ????if( pendingIQs[iq.id] !== undefined ) {
    ?????var callbackInfo:* = pendingIQs[iq.id];
    ?????
    ?????if(callbackInfo.methodScope && callbackInfo.methodName) {
    ??????callbackInfo.methodScope[callbackInfo.methodName].apply( callbackInfo.methodScope, [iq] );
    ?????}???
    ?????if (callbackInfo.func != null) {
    ??????callbackInfo.func( iq );
    ?????}
    ?????pendingIQs[iq.id] = null;
    ?????delete pendingIQs[iq.id];
    ????}
    ????else {
    ?????var exts:Array = iq.getAllExtensions();
    ?????for (var ns:String in exts) {
    ??????// Static type casting
    ??????var ext:IExtension = exts[ns] as IExtension;
    ??????if (ext != null) {
    ???????var event:IQEvent = new IQEvent(ext.getNS());
    ???????event.data = ext;
    ???????event.iq = iq;
    ???????dispatchEvent( event );
    ??????}
    ?????}
    ????}
    ???}
    ???????? return iq;
    ??}
    ??
    ??/**
    ?? * @private
    ?? */
    ??protected function handleMessage( node:XMLNode ):Message
    ??{
    ???var msg:Message = new Message();
    ???//trace(msg);?
    ???// Populate with data
    ???if( !msg.deserialize( node ) ) {
    ????throw new SerializationException();
    ???}
    ???// ADDED in error handling for messages
    ???if( msg.type == Message.ERROR_TYPE ) {
    ????dispatchError( msg.errorCondition, msg.errorMessage, msg.errorType, msg.errorCode );
    ???}
    ???else
    ???{
    ????var event:MessageEvent = new MessageEvent();
    ????event.data = msg;
    ????dispatchEvent( event );??
    ???}
    ???????? return msg;
    ??}
    ??
    ??/**
    ?? * @private
    ?? */
    ??private var presenceQueue:Array = [];
    ??private var presenceQueueTimer:Timer;
    ??protected function handlePresence( node:XMLNode ):Presence
    ??{
    ???if(!presenceQueueTimer)
    ???{
    ????presenceQueueTimer = new Timer(1, 1);
    ????presenceQueueTimer.addEventListener(TimerEvent.TIMER_COMPLETE, flushPresenceQueue);
    ???}
    ???
    ???var pres:Presence = new Presence();
    ???
    ???// Populate
    ???if( !pres.deserialize( node ) ) {
    ????throw new SerializationException();
    ???}
    ???
    ???presenceQueue.push(pres);
    ???
    ???presenceQueueTimer.reset();
    ???presenceQueueTimer.start();

    ???????? return pres;
    ??}
    ??
    ??protected function flushPresenceQueue(evt:TimerEvent):void
    ??{
    ???var event:PresenceEvent = new PresenceEvent();
    ???event.data = presenceQueue;
    ???dispatchEvent( event );
    ???presenceQueue = [];
    ??}
    ??
    ??/**
    ?? * @private
    ?? */
    ??protected function onIOError(event:IOErrorEvent):void{
    ???/*
    ???this fires the standard dispatchError method. need to add
    ???the appropriate error code
    ???*/
    ???dispatchError( "service-unavailable", "Service Unavailable", "cancel", 503 );
    ??}
    ??
    ??/**
    ?? * @private
    ?? */
    ??protected function securityError(event:SecurityErrorEvent):void{
    ???trace("there was a security error of type: " + event.type + "\nError: " + event.text);
    ???dispatchError( "not-authorized", "Not Authorized", "auth", 401 );
    ??}
    ??
    ??/**
    ?? * @private
    ?? */
    ??protected function dispatchError( condition:String, message:String, type:String, code:Number ):void
    ??{
    ???var event:XIFFErrorEvent = new XIFFErrorEvent();
    ???event.errorCondition = condition;
    ???event.errorMessage = message;
    ???event.errorType = type;
    ???event.errorCode = code;
    ???dispatchEvent( event );
    ??}
    ??
    ??/**
    ?? * @private
    ?? */
    ??protected function sendXML( someData:* ):void
    ??{
    ???//trace("SEND: " + someData);
    ???// Data is untyped because it could be a string or XML
    ???_socket.send( someData );
    ???var event:OutgoingDataEvent = new OutgoingDataEvent();
    ???event.data = someData;
    ???dispatchEvent( event );
    ??}
    ??
    ??// anonymous login
    ??/**
    ?? * @private
    ?? */
    ??protected function sendAnonymousLogin():void
    ??{
    ???var anonIQ:IQ = new IQ(null, IQ.SET_TYPE, XMPPStanza.generateID("log_anom_"), "sendAnonymousLogin_result", this, null );
    ???var authExt:AuthExtension = new AuthExtension(anonIQ.getNode());
    ???anonIQ.addExtension(authExt);
    ???send(anonIQ);
    ??}
    ??
    ??/**
    ?? * @private
    ?? */
    ??protected function sendAnonymousLogin_result(resultIQ:IQ):void
    ??{resultIQ
    ???if( resultIQ.type == IQ.RESULT_TYPE ) {
    ????// update resource
    ????var jid:JID = resultIQ.to;
    ????resource = jid.resource;
    ????username = jid.node;
    ????// dispatch login event
    ????loggedIn = true;
    ????var event:LoginEvent = new LoginEvent();
    ????dispatchEvent( event );
    ???}
    ??}
    ??
    ??/**
    ?? * @private
    ?? */
    ??protected function beginAuthentication():void
    ??{
    ???var authIQ:IQ = new IQ( null, IQ.GET_TYPE, XMPPStanza.generateID("log_user_"), "beginAuthentication_result", this, null );
    ???var authExt:AuthExtension = new AuthExtension(authIQ.getNode());
    ???authExt.username = username
    ???
    ???authIQ.addExtension(authExt);
    ???send( authIQ );
    ??}
    ??
    ??/**
    ?? * @private
    ?? */
    ??protected function beginAuthentication_result( resultIQ:IQ ):void
    ??{
    ???var connectionType:String = "none";
    ?
    ???// Begin authentication procedure
    ???if( resultIQ.type == IQ.RESULT_TYPE ) {
    ????var authIQ:IQ = new IQ( null, IQ.SET_TYPE, XMPPStanza.generateID("log_user2_"), "sendAuthentication_result", this, null );
    ????try
    ????{
    ?????var resultAuth:* = resultIQ.getAllExtensionsByNS(AuthExtension.NS)[0];
    ?????var responseAuth:AuthExtension = new AuthExtension(authIQ.getNode());
    ?????responseAuth.password = password;
    ?????responseAuth.username = username;
    ?????responseAuth.resource = resource;
    ?????authIQ.addExtension(responseAuth);
    ?????send( authIQ );
    ????}
    ????catch (e:Error)
    ????{
    ?????trace("Error : null trapped. Resuming.");
    ????}
    ???}
    ???else {
    ????// We weren't expecting this
    ????dispatchError( "unexpected-request", "Unexpected Request", "wait", 400 );
    ???}
    ??}
    ??
    ??/**
    ?? * @private
    ?? */
    ??protected function sendAuthentication_result( resultIQ:IQ ):void
    ??{
    ???if( resultIQ.type == IQ.RESULT_TYPE ) {
    ????loggedIn = true;
    ????var event:LoginEvent = new LoginEvent();
    ????dispatchEvent( event );
    ???}
    ???else {
    ????// We weren't expecting this
    ????dispatchError( "unexpected-request", "Unexpected Request", "wait", 400 );
    ???}
    ??}
    ??
    ??/**
    ?? * @private
    ?? */
    ??protected function addIQCallbackToPending( id:String, callbackName:String, callbackScope:Object, callbackFunc:Function ):void
    ??{
    ???pendingIQs[id] = {methodName:callbackName, methodScope:callbackScope, func:callbackFunc};
    ??}
    ??
    ??/**
    ?? * The XMPP server to use for connection.
    ?? */
    ??public function get server():String
    ??{
    ???return myServer;
    ??}
    ??
    ??/**
    ?? * @private
    ?? */
    ??public function set server( theServer:String ):void
    ??{
    ???myServer = theServer;
    ??}
    ??
    ??/**
    ?? * The username to use for connection. If this property is null when <code>connect()</code> is called,
    ?? * the class will fetch registration field data rather than attempt to login.
    ?? */
    ??public function get username():String
    ??{
    ???return myUsername;
    ??}
    ??
    ??/**
    ?? * @private
    ?? */
    ??public function set username( theUsername:String ):void
    ??{
    ???myUsername = theUsername;
    ??}
    ??
    ??/**
    ?? * The password to use when logging in.
    ?? */
    ??public function get password():String
    ??{
    ???return myPassword;
    ??}
    ??
    ??public function set password( thePassword:String ):void
    ??{
    ???myPassword = thePassword;
    ??}
    ??
    ??/**
    ?? * The resource to use when logging in. A resource is required (defaults to "XIFF") and
    ?? * allows a user to login using the same account simultaneously (most likely from multiple machines).
    ?? * Typical examples of the resource include "Home" or "Office" to indicate the user's current location.
    ?? */
    ??public function get resource():String
    ??{
    ???return myResource;
    ??}
    ??
    ??/**
    ?? * @private
    ?? */
    ??public function set resource( theResource:String ):void
    ??{
    ???if( theResource.length > 0 )
    ???{
    ????myResource = theResource;
    ???}
    ??}
    ??
    ??/**
    ?? * Whether to use anonymous login or not.
    ?? */
    ??public function get useAnonymousLogin():Boolean
    ??{
    ???return _useAnonymousLogin;
    ??}
    ??
    ??/**
    ?? * @private
    ?? */
    ??public function set useAnonymousLogin(value:Boolean):void
    ??{
    ???// set only if not connected
    ???if(!isActive()) _useAnonymousLogin = value;
    ??}
    ??
    ??/**
    ?? * The port to use when connecting. The default XMPP port is 5222.
    ?? */
    ??public function get port():Number
    ??{
    ???return myPort;
    ??}
    ??
    ??public function set port( portNum:Number ):void
    ??{
    ???myPort = portNum;
    ??}
    ?
    ??/**
    ?? * Determines whether whitespace will be ignored on incoming XML data.
    ?? * Behaves the same as <code>XML.ignoreWhite</code>
    ?? */
    ??public function get ignoreWhite():Boolean
    ??{
    ???return ignoreWhitespace;
    ??}
    ?
    ??public function set ignoreWhite( val:Boolean ):void
    ??{
    ???ignoreWhitespace = val;
    ??}
    ??
    ??private function _createXmlSocket():XMLSocket {
    ???var socket:XMLSocket = new XMLSocket(server, port);
    ???socket.addEventListener(Event.CONNECT,socketConnected);
    ???socket.addEventListener(IOErrorEvent.IO_ERROR,onIOError);
    ???socket.addEventListener(Event.CLOSE,socketClosed);
    ???socket.addEventListener(DataEvent.DATA,socketReceivedData);
    ???socket.addEventListener(SecurityErrorEvent.SECURITY_ERROR,securityError);
    ???return socket;
    ??}
    ?}
    }

    posted @ 2008-03-26 14:59 華夢行 閱讀(3269) | 評論 (0)編輯 收藏
    http://is.qq.com/webpresence/code.shtml
    <a target=blank href=tencent://message/?uin=331998039&Site=bbs.justong.cn&Menu=yes><img border="0" SRC=http://wpa.qq.com/pa?p=1:331998039:10 alt="有事就Q我"></a>
    posted @ 2008-03-22 10:24 華夢行 閱讀(327) | 評論 (1)編輯 收藏
    [client]
    default-character-set = utf8
    [mysqld]
    init-connect='SET NAMES utf8'
    default-storage-engine = INNODB
    character-set-server = utf8
    collation-server = utf8_general_ci
    default-character-set = utf8
    max_connections=150
    [mysql]
    default-character-set = utf8
    posted @ 2008-03-21 09:39 華夢行 閱讀(207) | 評論 (0)編輯 收藏

    mysql 遠程訪問的設置

    登陸以后運行以下命令,給予遠程訪問客戶端權限..?

    grant all on *.* to 'remote'@'172.16.21.39' identified by 'password';

    remote表示用戶名.

    '172.16.21.39' 遠程ip地址

    password表示遠程登陸密碼.

    posted @ 2008-03-05 21:02 華夢行 閱讀(251) | 評論 (0)編輯 收藏

    VNC,全稱為Virtual Network Computing,它是一個桌面共享系統。它的功能,類似于Windows中的遠程桌面功能。VNC使用了RFB(Remote FrameBuffer,遠程幀緩沖)協議來實現遠程控制另外一臺計算機。它把鍵盤鼠標動作發送到遠程計算機,并把遠程計算機的屏幕發回到本地。

    VNC技術與平臺無關,VNC VIEwer可以和VNC Server在不同的操作系統上。VNC幾乎支持所有的操作系統,也支持Java,甚至可以通過支持Java的瀏覽器來訪問VNC Server。多個VNC客戶端可以同時連接到一個VNC Server上。

    VNC最初由AT&T開發的,它的源代碼是開源的。

    在CentOs 4.3上配置VNC服務很簡單(這里假定你的計算機上已經安裝了VNC軟件)

    首先需要配置VNC密碼,密碼在使用客戶端連接服務器時使用。

    注意:VNC密碼保存在用戶的主目錄中,每個用戶都可以設置自己的密碼。因此,請使用你的用戶名(盡量不要使用root)運行下列命令:

    vncpasswd

    然后輸入密碼。

    接下來就可以啟動VNC server了。在啟動VNC server時,需要為你的server指定一個display參數。你可以把display理解為一個桌面,每個用戶都可以有自己的桌面。VNC客戶端在連接時,可以指定連接到哪個桌面上。在系統中,display號不能重復,也就是說,如果有用戶已經建立了名為“:1”的display,另外一個用戶就不能再使用“:1”了,他可以使用“:2”。

    啟動VNC server的命令是:

    vncserver <display>

    例如,

    vncserver :1

    最后,需要配置一下防火墻,允許VNC客戶端連接VNC server。VNC server監聽的端口從5900開始,display :1的監聽5901,display :2監聽5902,以此類推。CentOs的防火墻缺省是不允許連接這些端口的,所以需要使用下面的步驟打開防火墻(需要root權限):

    vi /etc/sysconfig/iptables

    找到下面的語句:

    -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited

    在此行之前,加上下面的內容:

    -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5900:5903 -j ACCEPT

    這句話的含義是,允許其它機器訪問本機的5900到5903端口,這樣,display:1, display:2, display:3的用戶就可以連接到本機。

    然后使用root身份重新啟動防火墻:

    /sbin/service iptables restart

    好了,現在就可以運行客戶端軟件,連接到VNC server上了。

    VNC客戶端軟件很多,在Linux下有vncviewer,KDE還提供了一個krdc(它的菜單項就是”Remote Desktop Connection",遠程桌面連接)。

    在window也有不少vnc客戶端,你可以到http://www.realvnc.com/去下載一個,安裝就可以用了。

    假設VNC server的IP地址是192.168.1.1,display是:1。在VNC viewer的server欄中輸入:“192.168.1.1:1”,然后連接。OK,你可以看到自己的桌面了。以后不管你什么時候關閉自己的本地PC機都不怕了,只要server不關機,你只要連接到VNC server,你就可以看到你前一天關閉本地PC機時的桌面還保持著原樣。

    不過...這個桌面怎么這么丑?!

    原來vncserver默認使用的窗口管理器是twm,這是一個很簡陋的窗口管理器,你可以把你的桌面改成GNOME或KDE。

    方法是,進入你自己的home目錄,然后編輯這個文件:.vnc/xstartup,下面是這個文件的內容:

    #!/bin/sh

    # Uncomment the following two lines for normal desktop:

    #unset SESSION_MANAGER

    #exec /etc/X11/xinit/xinitrc

    [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup

    [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources

    xsetroot -solid grey

    vncconfig -iconic &

    xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &

    #twm &

    gnome-session &

    你可以把像上面這樣把"twm &"這一行注釋掉,然后在下面加入一行"gnome-session &",或者是"startkde &",分別啟動GNOME桌面和KDE桌面。

    如果server重啟了,那你就需要重新運行一次vncserver命令來啟動VNC server,這很麻煩。有沒有更好的方法呢?

    有!我們可以把VNC server啟動成后臺服務。執行如下步驟:

    首先要允許VNC server在系統啟動過程中被啟動。這可以通過“系統設置-->服務器設置-->服務”菜單來配置,把vncserver一項選上就可以了。

    如果使用命令行的話,以root身份運行以下兩條命令:

    cd /etc/rc5.d

    mv K35vncserver S35vncserver

    然后編輯/etc/sysconfig/vncservers,以下是文件內容:

    																# The VNCSERVERS variable is a list of display:user pairs.
    #
    # Uncomment the line below to start a VNC server on display :1
    # as my 'myusername' (adjust this to your own).  You will also
    # need to set a VNC passWord; run 'man vncpasswd' to see how
    # to do that.
    #
    # DO NOT RUN THIS SERVICE if your local area network is
    # untrusted!  For a secure way of using VNC, see
    # <URL:http://www.uk.research.att.com/vnc/sshvnc.HTML>.
    VNCSERVERS="1:user1 2:user2 3:user3"
    VNCSERVERARGS[1]="-geometry 1024x768"
    VNCSERVERARGS[2]="-geometry 1024x768"
    VNCSERVERARGS[3]="-geometry 800x600"
    														

    解釋一下這個文件:

    VNCSERVERS這一行是配置在系統啟動時啟動幾個VNC server,上面的例子里運行了三個VNC server,其中user1在display :1,user2在display :2,user3在display :3。

    VNCSERVERARGS這三行,分別為VNC server 1, 2, 3配置啟動參數,上面的例子里對user1和user2使用屏幕分辨率1024x768,對user3使用800x600。

    其它支持的參數請使用“man vncserver”命令查詢。

    編輯好這個文件后,保存,然后以root身份運行:

    /sbin/service vncserver start

    這樣user1, user2, user3的vncserver就啟動了。

    以后每次系統重啟時,都會自動啟動這三個用戶的vncserver。

    注意:上面三個用戶必須已經使用vncpasswd命令設置過vnc密碼,不然他的vncserver啟動會失敗

    posted @ 2008-03-04 19:21 華夢行 閱讀(368) | 評論 (0)編輯 收藏
    /etc/my.conf下添加配置

    [client]
    default-character-set = utf8
    [mysqld]
    init-connect='SET NAMES utf8'
    default-storage-engine = INNODB
    character-set-server = utf8
    collation-server = utf8_general_ci
    default-character-set = utf8
    [mysql]
    default-character-set = utf8
    posted @ 2008-03-04 19:18 華夢行 閱讀(146) | 評論 (0)編輯 收藏

    允許Flash跨域加載數據

    Flash 文檔可通過使用以下某種數據加載調用方法從外部源加載數據:XML.load()XML.sendAndLoad()LoadVars.load()LoadVars.sendAndLoad()loadVariables()loadVariablesNum()、MovieClip.loadVariables()XMLSocket.connect() 和 Macromedia Flash Remoting (NetServices.createGatewayConnection)。另外,SWF 文件可以在運行時導入運行時共享庫 (RSL) 或另一個 SWF 文件中定義的資源。默認情況下,數據或 RSL 必須與加載該外部數據或媒體的 SWF 文件駐留在同一個域中。

    若要使運行時共享庫中的數據和資源可用于其它域中的 SWF 文件,應使用跨域策略文件。跨域策略文件是一個 XML 文件,該文件提供的方法可以使服務器指示其數據和文檔可用于從某些域或所有域提供的 SWF 文件。服務器的策略文件指定的域所提供的所有 SWF 文件都將被允許訪問該服務器中的數據、資源或 RSL。

    如果您加載外部數據,即使不想將任何文件移植到 Flash Player 7 中,也應創建策略文件。如果您使用 RSL,并且調用或被調用文件是以 Flash Player 7 為目標播放器發布的,則應創建策略文件。

    允許跨域數據加載

    當 Flash 文檔試圖訪問另一個域中的數據時,Flash Player 將自動試圖從該域加載策略文件。如果試圖訪問數據的 Flash 文檔所在的域包括在該策略文件中,則數據將自動成為可訪問數據。

    策略文件必須命名為 crossdomain.xml,并且可以駐留在服務器的根目錄和其它目錄之中,該服務器提供具有其它 ActionScript 的數據。只有在通過 HTTP、HTTPS 或 FTP 進行通信的服務器上,策略文件才起作用。策略文件特定于它所駐留的服務器的端口和協議。

    例如,位于 https://www.macromedia.com:8080/crossdomain.xml 的策略文件只適用于在端口 8080 通過 HTTPS 對 www.macromedia.com 進行的數據加載調用。

    此規則的例外情況是,使用 XMLSocket 對象連接到另一個域中的套接字服務器。如果是這種情況,運行于與套接字服務器所在的同一個域中端口 80 上的 HTTP 服務器必須提供該方法調用的策略文件。

    XML 策略文件包含單個 <cross-domain-policy> 標簽,該標簽又包含零個或多個 <allow-access-from> 標簽。每個 <allow-access-from> 標簽包含一個屬性 domain,該屬性指定一個確切的 IP 地址、一個確切的域或一個通配符域(任何域)。通配符域由單個星號 (*)(匹配所有域和所有 IP 地址)或后接后綴的星號(只匹配那些以指定后綴結尾的域)表示。后綴必須以點開頭。但是,帶有后綴的通配符域可以匹配那些只包含后綴但不包含前導點的域。例如,cenfun.com 可以看作是 *.cenfun.com 的一部分。IP 域規范中不允許使用通配符。

    如果您指定了一個 IP 地址,則將只向使用 IP 語法從該 IP 地址(例如 http://65.57.83.12/flashmovie.swf)加載的 SWF 文件授予訪問權限,而不向使用域名語法加載的 SWF 文件授予訪問權限。Flash Player 不執行 DNS 解析。

    下面的示例顯示一個策略文件,該策略文件允許從 cenfun.com 上的 Flash 文檔訪問來自 cenfun.com、www.friendOfcenfun.com、*.cenfun.com 和 105.216.0.40 的 Flash 文檔:

    <?xml version="1.0"?>
    <!-- http://www.cenfun.com/crossdomain.xml -->
    <cross-domain-policy>
    <allow-access-from domain="www.friendOfcenfun.com" />
    <allow-access-from domain="*.cenfun.com" />
    <allow-access-from domain="105.216.0.40" />
    </cross-domain-policy>
    

    您也可以允許訪問來自任何域的文檔,如下面的示例所示:(http://www.cenfun.com/crossdomain.xml )

    								<?xml version="1.0"?>
    <!-- http://www.cenfun.com/crossdomain.xml -->
    <cross-domain-policy>
    <allow-access-from domain="*" />
    </cross-domain-policy>
    						

    每個 <allow-access-from> 標簽還具有可選的 secure 屬性。secure 屬性默認為 true。如果您的策略文件在 HTTPS 服務器上,并且要允許 HTTP 服務器上的 SWF 文件從 HTTPS 服務器加載數據,則可以將此屬性設置為 false

    secure 屬性設置為 false 可能會危及 HTTPS 提供的安全性。

    如果您正在下載來自 HTTPS 服務器的 SWF 文件,而加載它的 SWF 文件在 HTTP 服務器上,則您需要為 <allow-access-from> 標簽添加 secure="false" 屬性,如下面的代碼所示:

    <allow-access-from domain="www.cenfun.com" secure="false" />
    

    不包含任何 <allow-access-from> 標簽的策略文件相當于服務器上沒有策略。

    posted @ 2008-02-28 14:50 華夢行 閱讀(2397) | 評論 (0)編輯 收藏

    ?

    public class Escape {
    ??????? private final static String[] hex = { "00", "01", "02", "03", "04", "05",
    ??????? "06", "07", "08", "09", "0A", "0B", "0C", "0D", "0E", "0F", "10",
    ??????? "11", "12", "13", "14", "15", "16", "17", "18", "19", "1A", "1B",
    ??????? "1C", "1D", "1E", "1F", "20", "21", "22", "23", "24", "25", "26",
    ??????? "27", "28", "29", "2A", "2B", "2C", "2D", "2E", "2F", "30", "31",
    ??????? "32", "33", "34", "35", "36", "37", "38", "39", "3A", "3B", "3C",
    ??????? "3D", "3E", "3F", "40", "41", "42", "43", "44", "45", "46", "47",
    ??????? "48", "49", "4A", "4B", "4C", "4D", "4E", "4F", "50", "51", "52",
    ??????? "53", "54", "55", "56", "57", "58", "59", "5A", "5B", "5C", "5D",
    ??????? "5E", "5F", "60", "61", "62", "63", "64", "65", "66", "67", "68",
    ??????? "69", "6A", "6B", "6C", "6D", "6E", "6F", "70", "71", "72", "73",
    ??????? "74", "75", "76", "77", "78", "79", "7A", "7B", "7C", "7D", "7E",
    ??????? "7F", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89",
    ??????? "8A", "8B", "8C", "8D", "8E", "8F", "90", "91", "92", "93", "94",
    ??????? "95", "96", "97", "98", "99", "9A", "9B", "9C", "9D", "9E", "9F",
    ??????? "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9", "AA",
    ??????? "AB", "AC", "AD", "AE", "AF", "B0", "B1", "B2", "B3", "B4", "B5",
    ??????? "B6", "B7", "B8", "B9", "BA", "BB", "BC", "BD", "BE", "BF", "C0",
    ??????? "C1", "C2", "C3", "C4", "C5", "C6", "C7", "C8", "C9", "CA", "CB",
    ??????? "CC", "CD", "CE", "CF", "D0", "D1", "D2", "D3", "D4", "D5", "D6",
    ??????? "D7", "D8", "D9", "DA", "DB", "DC", "DD", "DE", "DF", "E0", "E1",
    ??????? "E2", "E3", "E4", "E5", "E6", "E7", "E8", "E9", "EA", "EB", "EC",
    ??????? "ED", "EE", "EF", "F0", "F1", "F2", "F3", "F4", "F5", "F6", "F7",
    ??????? "F8", "F9", "FA", "FB", "FC", "FD", "FE", "FF" };

    ??????? private final static byte[] val = { 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
    ??????? 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
    ??????? 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
    ??????? 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
    ??????? 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x00, 0x01,
    ??????? 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x3F, 0x3F, 0x3F,
    ??????? 0x3F, 0x3F, 0x3F, 0x3F, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x3F,
    ??????? 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
    ??????? 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
    ??????? 0x3F, 0x3F, 0x3F, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x3F, 0x3F,
    ??????? 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
    ??????? 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
    ??????? 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
    ??????? 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
    ??????? 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
    ??????? 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
    ??????? 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
    ??????? 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
    ??????? 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
    ??????? 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
    ??????? 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
    ??????? 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
    ??????? 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
    ??????? 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F };

    ??????? /**
    ??????? * 編碼
    ??????? *
    ??????? * @param s
    ??????? * @return
    ??????? */
    ??????? public static String escape(String s) {
    ??????? StringBuffer sbuf = new StringBuffer();
    ??????? int len = s.length();
    ??????? for (int i = 0; i < len; i++) {
    ??????? int ch = s.charAt(i);
    ??????? if ('A' <= ch && ch <= 'Z') { // 'A'..'Z' : as it was
    ??????? sbuf.append((char) ch);
    ??????? } else if ('a' <= ch && ch <= 'z') { // 'a'..'z' : as it was
    ??????? sbuf.append((char) ch);
    ??????? } else if ('0' <= ch && ch <= '9') { // '0'..'9' : as it was
    ??????? sbuf.append((char) ch);
    ??????? } else if (ch == '-' || ch == '_' // unreserved : as it was
    ??????? || ch == '.' || ch == '!' || ch == '~' || ch == '*'
    ??????? || ch == '\'' || ch == '(' || ch == ')') {
    ??????? sbuf.append((char) ch);
    ??????? } else if (ch <= 0x007F) { // other ASCII : map to %XX
    ??????? sbuf.append('%');
    ??????? sbuf.append(hex[ch]);
    ??????? } else { // unicode : map to %uXXXX
    ??????? sbuf.append('%');
    ??????? sbuf.append('u');
    ??????? sbuf.append(hex[(ch >>> 8)]);
    ??????? sbuf.append(hex[(0x00FF & ch)]);
    ??????? }
    ??????? }
    ??????? return sbuf.toString();
    ??????? }

    ??????? /**
    ??????? * 解碼 說明:本方法保證 不論參數s是否經過escape()編碼,均能得到正確的“解碼”結果
    ??????? *
    ??????? * @param s
    ??????? * @return
    ??????? */
    ??????? public static String unescape(String s) {
    ??????? StringBuffer sbuf = new StringBuffer();
    ??????? int i = 0;
    ??????? int len = s.length();
    ??????? while (i < len) {
    ??????? int ch = s.charAt(i);
    ??????? if ('A' <= ch && ch <= 'Z') { // 'A'..'Z' : as it was
    ??????? sbuf.append((char) ch);
    ??????? } else if ('a' <= ch && ch <= 'z') { // 'a'..'z' : as it was
    ??????? sbuf.append((char) ch);
    ??????? } else if ('0' <= ch && ch <= '9') { // '0'..'9' : as it was
    ??????? sbuf.append((char) ch);
    ??????? } else if (ch == '-' || ch == '_' // unreserved : as it was
    ??????? || ch == '.' || ch == '!' || ch == '~' || ch == '*'
    ??????? || ch == '\'' || ch == '(' || ch == ')') {
    ??????? sbuf.append((char) ch);
    ??????? } else if (ch == '%') {
    ??????? int cint = 0;
    ??????? if ('u' != s.charAt(i + 1)) { // %XX : map to ascii(XX)
    ??????? cint = (cint << 4) | val[s.charAt(i + 1)];
    ??????? cint = (cint << 4) | val[s.charAt(i + 2)];
    ??????? i += 2;
    ??????? } else { // %uXXXX : map to unicode(XXXX)
    ??????? cint = (cint << 4) | val[s.charAt(i + 2)];
    ??????? cint = (cint << 4) | val[s.charAt(i + 3)];
    ??????? cint = (cint << 4) | val[s.charAt(i + 4)];
    ??????? cint = (cint << 4) | val[s.charAt(i + 5)];
    ??????? i += 5;
    ??????? }
    ??????? sbuf.append((char) cint);
    ??????? } else { // 對應的字符未經過編碼
    ??????? sbuf.append((char) ch);
    ??????? }
    ??????? i++;
    ??????? }
    ??????? return sbuf.toString();
    ??????? }

    ??????? public static void main(String[] args) {
    ??????? String stest = "中文1234 abcd[]()<+>,.~\\";
    ??????? System.out.println(stest);
    ??????? System.out.println(escape(stest));
    ??????? System.out.println(unescape(escape(stest)));
    ??????? }

    ??????? }

    ?

    posted @ 2008-02-27 21:18 華夢行 閱讀(484) | 評論 (0)編輯 收藏
         摘要: 附錄B:錯誤代碼和消息 目錄 B.1. 服務器錯誤代碼和消息 B.2. 客戶端錯誤代碼和消息 ...  閱讀全文
    posted @ 2008-02-26 21:28 華夢行 閱讀(1746) | 評論 (0)編輯 收藏
    <marquee scrollAmount=2 onMouseOver=this.stop() onMouseOut=this.start()>??? 調節速度:scrollAmount
    ln -s /data/oracle9/product/9.2.0/oracle.swd.jre/bin/i386/native_threads/java

    /data/oracle9/product/9.2.0/oracle.swd.jre/bin/i386/native_threads/jre

    posted @ 2008-02-21 20:33 華夢行 閱讀(123) | 評論 (0)編輯 收藏
    ?1 在web。xml中添加
    ? <init-param>
    ????? <param-name>config</param-name>
    ????? <param-value>/WEB-INF/struts-config.xml</param-value>
    ??? </init-param>
    ??? <init-param>
    ????? <param-name>debug</param-name>
    ????? <param-value>3</param-value>
    ??? </init-param>
    ??? <init-param>
    ????? <param-name>detail</param-name>
    ????? <param-value>3</param-value>
    ??? </init-param>

    在客戶端文件中添加
    OutService._path = 'http://192.168.1.120:8080/justchat/dwr';
    DWREngine.setMethod(DWREngine.ScriptTag);
    posted @ 2008-02-21 19:37 華夢行 閱讀(632) | 評論 (0)編輯 收藏

    ??????????????????????????
    Linux 9 安裝過程。
    首先在bios中的啟動順序改為從cd-rom 啟動,同時修改相關的io-device。設置為auto
    格式化選擇自動分區。
    安裝過程中版本選擇選擇服務器版本。
    4.root的用戶密碼默認為:123456
    完成安裝。

    二..jdk安裝
    1.到java官方網站去下載linux版本的jdk 1.5(prm)
    2.運行相應的jdk rpm 安裝文件,自動安裝到/usr/java/jdk1.5.0_14?? 目錄下面
    3設置類路徑:
    export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC
    export JAVA_HOME=/usr/java/jdk1.5.0_14
    export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
    export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH:$HOMR/bin
    在 /etc/profile? 添加上面的代碼即可
    重起計算機運行javac即可完成測試: 如果出現javac相關的信息則說明安裝成功。
    二。openfire的安裝以及部署
    到openfire官方網站上去下載最新的openfire
    關于openfire? 的部署以及啟動.自動安裝到opt/openfire目錄下面 相應的啟動文件為
    /opt/openfire/bin/openfire.sh
    ?將oracle9驅動classses12.jar復制到 /opt/openfire/lib目錄下面,同時還需要修改配置文件/opt/openfire/conf/openfire.xml??

    ?如果是oracle則需要將classses12.jar復制到 /opt/openfire/lib目錄下面,同時還需要修改配置文

    件/opt/openfire/conf/openfire.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!--
    ?? This file stores bootstrap properties needed by Openfire.
    ?? Property names must be in the format: "prop.name.is.blah=value"
    ?? That will be stored as:
    ?????? <prop>
    ?????????? <name>
    ?????????????? <is>
    ?????????????????? <blah>value</blah>
    ?????????????? </is>
    ?????????? </name>
    ?????? </prop>
    ?? Most properties are stored in the Openfire database. A
    ?property viewer and editor is included in the admin console.
    -->
    <!-- root element, all properties must be under this element -->
    <jive>
    ?<adminConsole>
    ?? <!-- Disable either port by setting the value to -1 -->
    ?? <port>9090</port>
    ?? <securePort>9091</securePort>
    ?</adminConsole>
    ?<admin>
    ?? <!-- Use this section to define users that will have admin privileges. Below,
    ???????? you will find two ways to specify which users are admins. Admins will
    ???????? have access to the admin console (only local users) and may have also access
    ???????? to other functionalities like ad-hoc commands. -->
    ?? <!-- By default, only the user with the username "admin" can login
    ??????? to the admin console. Alternatively, you can specify a comma-delimitted
    ??????? list usernames that should be authorized to login to the admin console
    ??????? by setting the <authorizedUsernames> field below. -->
    ?? <!-- <authorizedUsernames></authorizedUsernames> -->
    ?? <!-- Comma-delimitted list of bare JIDs. The JIDs may belong to local
    ??????? or remote users. -->
    ?? <!-- <authorizedJIDs></authorizedJIDs> -->
    ?</admin>
    ?<locale>zh_CN</locale>
    ?<!-- Network settings. By default, Openfire will bind to all network interfaces.
    ???? Alternatively, you can specify a specific network interfaces that the server
    ???? will listen on. For example, 127.0.0.1. This setting is generally only useful
    ????? on multi-homed servers. -->
    ?<!--
    ?? <network>
    ?????? <interface></interface>
    ?? </network>
    ?? -->
    ?<connectionProvider>
    ?? <className>org.jivesoftware.database.DefaultConnectionProvider</className>
    ?</connectionProvider>
    ?<database>
    ?? <defaultProvider>
    ???? <driver>oracle.jdbc.driver.OracleDriver</driver>
    ???? <serverURL>jdbc:oracle:thin:@192.168.1.2:1521:tlink</serverURL>
    ???? <username>openfire</username>
    ???? <password>openfire</password>
    ???? <minConnections>5</minConnections>
    ???? <maxConnections>15</maxConnections>
    ???? <connectionTimeout>1.0</connectionTimeout>
    ?? </defaultProvider>
    ?</database>
    ?<setup>true</setup>
    </jive>


    ??? Oracle9i 在Linux9上的安裝過程


    添加安裝過程中需要用到的用戶和組,這當中會用到二個用戶一個是root,一個是oracle
    #groupadd oinstall
    #groupadd dba
    #useradd –g oinstall –G dba oracle
    #passwd oracle
    ?(二)新建安裝目錄
    #mkdir –p /data/oracle9/product/9.2.0
    #chown –R oracle.oinstall /data/oracle9
    #mkdir /var/opt/oracle
    #chown oracle.dba /var/opt/oracle
    #chmod 755 /var/opt/oracle
    (三)為了一開機系統就能自動幫你設好這些參數,
    也可改動 /etc/sysctl.conf 這個文件,加入以下的語句:
    kernel.shmmax = 8589934590
    kernel.shmmni = 4096
    kernel.shmall = 2097152
    kernel.sem = 250 32000 100 128
    fs.file-max = 65536
    net.ipv4.ip_local_port_range = 1024 65000

    注意:如果你的共享內存不夠大的話,在安裝的過程中會提示ORA-27123錯誤,到時候你只要把/proc/sys/kernel/shmmax的值調大就

    可以了到于多大就看你的了

    (六) oracle對文件的要求:編輯文件:
    /etc/security/limits.conf 加入以下語句:
    oracle    soft    nofile    65536
    oracle    hard    nofile   65536
    oracle    soft    nproc    16384
    oracle    hard    nproc    16384

    設置oracle的環境
    vi ~/.bash_profile
    export LD_ASSUME_KERNEL=2.4.10
    export ORACLE_BASE=/data/oracle9
    export ORACLE_HOME=/data/oracle9/product/9.2.0
    export ORACLE_SID=ora9i
    export ORACLE_TERM=xterm
    #export NLS_LANG=AMERICAN
    export ORACLE_OWNER=oracle
    export THREADS_FLAG=native
    #export LANG=en_US
    export ORA_NLS33=$OROCLE_HOME/ocommon/nls/admin/data
    export LD_LIBRARY_PAHT=/data/oracle9/product/9.2.0/lib:/lib:/usr /lib:/usr/local/lib
    export PAHT=/data/oracle9/product/9.2.0/bin:$PATH
    export PATH=$PATH:$ORACLE_HOME/bin


    #su – oracle
    $ vi ~/.bash_profile export LD_ASSUME_KERNEL=2.4.1
    #export DISPLAY=”192.168.9.205:0.0” (127.0.0.1:0.0)
    export ORACLE_BASE=/data/oracle9 export ORACLE_HOME=/data/oracle9/product/9.2.0
    export ORACLE_SID=ora9i (數據庫全局變量名)
    export ORACLE_TERM=xterm (xterm窗口模式 vt100 終端調試模式)
    export NLS_LANG=AMERICAN (設置語言AMERICAN英文)
    export ORACLE_OWNER=oracle
    export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
    export THREADS_FLAG=native
    export LD_LIBRARY_PATH=/data/oracle9/product/9.2.0/lib:/lib:/usr /lib:/usr/local/lib export

    PATH=/data/oracle9/product/9.2/bin:$PATH export PATH=$PATH:$ORACLE_HOME/bin

    然后注銷再重新登錄就可以,oracle 的環境就應該生效了 (要用英文環境)
    安裝oracle :
    ship_9204_linux_disk1.cpio.gz
    ship_9204_linux_disk2.cpio.gz
    ship_9204_linux_disk3.cpio.gz
    用zcat ship_9204_linux_disk1.cpio.gz|cpio -idmv
    zcat ship_9204_linux_disk2.cpio.gz|cpio -idmv
    zcat ship_9204_linux_disk3.cpio.gz|cpio -idmv
    生成三個文件夾Disk1,Disk2,Disk3;
    你也可以用(我用的是這個)
    cpio -idmv < ship_9204_linux_disk1.cpio
    cpio -idmv < ship_9204_linux_disk2.cpio
    cpio -idmv < ship_9204_linux_disk3.cpio
    在當前目錄上會產生三個目錄:
    Disk1,Disk2,Disk3
    #cd Disk1
    #./runInstaller 出現圖形安裝界面。
    按照提示完成安裝即可。
    安裝過程中可能遇到的問題
    1.遇到亂碼時首先運行 export LANG=en_US
    2.創見一個指向的鏈接:
    ln -s /data/oracle9/product/9.2.0/oracle.swd.jre/bin/i386/native_threads/java

    /data/oracle9/product/9.2.0/oracle.swd.jre/bin/i386/native_threads/jre
    配置監聽器服務命名還有目錄服務 net config assistent
    ?/data/oracle9/product/9.2.0/bin/netca
    啟動oracle監聽器.
    /data/oracle9/product/9.2.0/bin/lsnrctl start TLINK
    配置啟動oracle服務器
    ?/data/oracle9/product/9.2.0/bin/dbca
    在gui模式下啟動oracle

    linux 常見命令:
    neat? =====redhat-config-network 配置網絡
    redhat-config-users 配置用戶
    ?rpm -Uvv openfire.rpm --force?? 強制更新軟件
    rpm -ql package 列出該軟件的所有文件所在的目錄???? | less? 分頁顯示結果
    rpm -qa 列出所有已安裝的包
    rpm -qi package 列出包信息
    ?/etc/rc.d/init.d/httpd start
    啟動 apache:
    /etc/rc.d/init.d/httpd stop
    關閉apache
    ? 關于ssh 因為在linux下是內置的服務,所以只要啟動服務即可。讓在window下用ssh的客戶端即可進行操作

    ?
    ?

    posted @ 2008-02-18 11:48 華夢行 閱讀(574) | 評論 (0)編輯 收藏
    僅列出標題
    共15頁: First 上一頁 3 4 5 6 7 8 9 10 11 下一頁 Last 
    主站蜘蛛池模板: 亚洲字幕AV一区二区三区四区| 亚洲一级毛片免费观看| 国产精品免费观看调教网| 亚洲美女激情视频| 在线a毛片免费视频观看| 人成午夜免费大片在线观看| 久久久久亚洲AV成人片| 日本不卡视频免费| 日本黄色动图免费在线观看| 亚洲www77777| 亚洲人成人77777网站| 美女视频黄的全免费视频| 一级黄色免费毛片| 亚洲午夜电影一区二区三区| 亚洲国产专区一区| 久久久久久精品免费看SSS| 一级做a爰片久久免费| 亚洲三级在线视频| 国产亚洲精品国看不卡| 91免费精品国自产拍在线不卡| 日本激情猛烈在线看免费观看 | 永久黄色免费网站| 国产亚洲精彩视频| 久久精品国产亚洲AV高清热| 国产成人免费高清在线观看| 久久国产乱子免费精品| 国产亚洲高清在线精品不卡| 亚洲电影免费观看| 亚洲精品无码乱码成人| 国产一区二区三区无码免费| 成人免费激情视频| 成人无码a级毛片免费| 免费在线人人电影网| 亚洲宅男精品一区在线观看| 久久青草亚洲AV无码麻豆| www.亚洲精品.com| 毛片在线免费视频| 亚洲毛片免费观看| 免费国产成人18在线观看| 99视频在线免费观看| 特级毛片在线大全免费播放|