無明居

            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
            10 隨筆 :: 0 文章 :: 1 評論 :: 0 Trackbacks

          2006年7月4日 #

          (1)下載jdk
          jdk-1_5_0_09-linux-i586.bin

          (2)安裝jdk
          shell> ./jdk-1_5_0_09-linux-i586.bin
          shell> ln -s jdk-1_5_0_09 ?java

          (3)設置環境變量shell> vi /etc/profile

          添加以下內容:
          JAVA_HOME=/usr/local/java
          JRE
          =$JAVA_HOME/jre?
          PATH
          =$JAVA_HOME/bin:$JRE/bin:$PATH?
          CLASSPATH
          =.:$JAVA_HOME/bin/tools.jar:$JAVA_HOME/lib/dt.jar?
          export?JAVA_HOME?JRE?CLASSPATH?PATH?
          posted @ 2006-12-03 22:48 無明 閱讀(253) | 評論 (0)編輯 收藏

          (1)下載mysql二進制分發包到工作目錄

          (2)創建mysql 用戶
          shell> groupadd mysql
          shell> useradd -g mysql mysql

          (3)解壓縮
          shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz

          (4)將工作目錄鏈接到/usr/local/mysql
          shell> cd /usr/localshell> ln -s full-path-to-mysql-VERSION-OS mysql

          (5)安裝數據庫
          shell> cd mysql
          shell> scripts/mysql_install_db --user=mysql
          shell> chown -R root? .
          shell> chown -R mysql data
          shell> chgrp -R mysql .

          *此時可以手動啟動數據庫:
          shell> bin/mysqld_safe --user=mysql &

          (6)設置mysql自動啟動
          將/usr/local/mysql/support-files/mysql.server 復制到/etc/init.d/mysql
          shell> cp mysql.server /etc/init.d/mysql
          shell> chmod +x /etc/init.d/mysql


          在ubuntu server中添加為系統服務:
          sudo update-rc.d mysql defaults
          如需刪除服務:
          sudo update-rc.d mysql remove?

          在RHEL4中:
          shell> chkconfig --add?mysql

          (7)配置mysql
          添加my.cnf到/etc

          啟動數據庫更改root密碼:
          cd /usr/local/mysql/bin./mysql -u root -p
          mysql>GRANT ALL PRIVILEGES ON *.* TO? root@ localhost IDENTIFIED BY "password";

          或者啟動遠程訪問:
          mysql>GRANT ALL PRIVILEGES ON *.* TO? root@ "%" IDENTIFIED BY "password";
          posted @ 2006-12-03 22:22 無明 閱讀(211) | 評論 (0)編輯 收藏

          設置好session的File Transfer中的download和upload路徑,然后登陸后就可以用sz filename下載文件回客戶端,從客戶端上傳文件則是用 rz 命令就好。?

          posted @ 2006-12-03 00:45 無明 閱讀(302) | 評論 (0)編輯 收藏

          1、以簡體中文模式安裝

          2、修改locale
          sudo vi /etc/environment
          LANGUAGE="en_US:en"
          LC_ALL="C"
          LC_CTYPE
          ="zh_CN.UTF-8"
          LANG="en_US.UTF-8"

          修改網絡設置
          sudo vi /etc/network/interfaces

          auto lo
          iface lo inet loopback

          # The primary network interface
          auto eth0
          #iface eth0 inet dhcp


          iface eth0 inet static
          address 192.168.11.5
          netmask 255.255.255.0
          network 192.168.11.0
          broadcast 192.168.11.255
          gateway 192.168.11.2
          dns-nameservers 202.96.134.133




          3、更新源列表

          sudo?vi ?/etc/apt/sources.list
          deb http://ubuntu.cn99.com/ubuntu/ dapper main restricted universe multiverse
          deb http://ubuntu.cn99.com/ubuntu/ dapper-updates main restricted universe multiverse
          deb http://ubuntu.cn99.com/ubuntu/ dapper-security main restricted universe multiverse
          #deb http://ubuntu.cn99.com/ubuntu/ dapper-backports main restricted universe multiverse
          deb http://ubuntu.cn99.com/ubuntu-cn/ dapper main restricted universe multiverse
          #deb http://ubuntu.cn99.com/backports/ dapper-extras main restricted universe multiverse
          deb-src http://ubuntu.cn99.com/ubuntu/ dapper main restricted universe multiverse
          deb-src http://ubuntu.cn99.com/ubuntu/ dapper-updates main restricted universe multiverse
          deb-src http://ubuntu.cn99.com/ubuntu/ dapper-security main restricted universe multiverse
          #deb-src http://ubuntu.cn99.com/ubuntu/ dapper-backports main restricted universe multiverse

          sudo apt-get update
          sudo apt-get dist-upgrade



          4、安裝ssh
          sudo apt-get install openssh-server

          5、安裝build-essential、java
          sudo apt-get install build-essential

          sudo apt-get install sun-java5-jdk
          sudo update-alternatives --config java

          6、vsftpd
          sudo apt-get install vsftpd
          sudo vi /etc/vsftpd.conf

          listen=YES

          local_enable
          =YES

          write_enable
          =YES

          local_umask
          =022

          connect_from_port_20
          =YES

          chroot_local_user
          =NO

          chroot_list_file
          =/etc/vsftpd.chroot_list

          user_config_dir
          =/etc/vsftpd_user_conf

          secure_chroot_dir
          =/var/run/vsftpd

          pam_service_name
          =/etc/pam.d/vsftpd

          rsa_cert_file
          =/etc/ssl/certs/ssl-cert-snakeoil.pem

          rsa_private_key_file
          =/etc/ssl/private/ssl-cert-snakeoil.key


          *簡單配置,只用于本地賬戶上傳一些在ubuntu server下下載不方便的軟件

          7、安裝mysql server

          (1)下載mysql二進制分發包到工作目錄

          (2)創建mysql 用戶
          shell> groupadd mysql
          shell> useradd -g mysql mysql

          (3)解壓縮
          shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz

          (4)將工作目錄鏈接到/usr/local/mysql
          shell> cd /usr/local
          shell> ln -s full-path-to-mysql-VERSION-OS mysql

          (5)安裝數據庫
          shell> cd mysql
          shell> scripts/mysql_install_db --user=mysql

          shell> chown -R root? .
          shell> chown -R mysql data
          shell> chgrp -R mysql .
          *此時可以手動啟動數據庫:shell>
          bin/mysqld_safe --user=mysql &

          (6)設置mysql自動啟動
          將/usr/local/mysql/support-files/mysql.server 復制到/etc/init.d/mysql

          添加為服務:
          sudo update-rc.d mysql defaults
          如需刪除服務:
          sudo update-rc.d mysql remove

          或者

          在MySQL安裝目錄下或MySQL 源碼樹的support-files目錄中找到腳本。

          要想手動安裝mysql.server,用名稱mysql將它復制到/etc/init.d目錄,然后將它變為可執行文件。只需要將位置更改為mysql.serveris所在并執行這些命令的相應目錄:

          shell> cp mysql.server /etc/init.d/mysql
          shell> chmod +x /etc/init.d/mysql

          安裝腳本后,用來激活它以便在系統啟動時運行所需要的命令取決于你的操作系統。在Linux中,你可以使用chkconfig:

          shell> chkconfig --addMySQL


          (7)配置mysql
          添加my.cnf到/etc
          啟動數據庫,更改root密碼:
          cd /usr/local/mysql/bin
          ./mysql -u roo
          mysql>GRANT ALL PRIVILEGES ON *.* TO??root@?localhost IDENTIFIED BY "password";
          或者啟動遠程訪問:
          mysql>GRANT ALL PRIVILEGES ON *.* TO??root@?"%" IDENTIFIED BY "password";

          posted @ 2006-08-07 19:13 無明 閱讀(596) | 評論 (0)編輯 收藏

          ??1 // ?utility?function?to?retrieve?an?expiration?date?in?proper
          ??2
          ??3 // ?format;?pass?three?integer?parameters?for?the?number?of?days,?hours,
          ??4
          ??5 // ?and?minutes?from?now?you?want?the?cookie?to?expire?(or?negative
          ??6
          ??7 // ?values?for?a?past?date);?all?three?parameters?are?required,
          ??8
          ??9 // ?so?use?zeros?where?appropriate
          ?10
          ?11 function ?getExpDate(days,?hours,?minutes)? {
          ?12
          ?13 ???? var ?expDate? = ? new ?Date(?);
          ?14
          ?15 ???? if ?( typeof ?days? == ? " number " ? && ? typeof ?hours? == ? " number " ? && ?
          ?16
          ?17 ???????? typeof ?hours? == ? " number " )? {
          ?18
          ?19 ????????expDate.setDate(expDate.getDate(?)? + ?parseInt(days));
          ?20
          ?21 ????????expDate.setHours(expDate.getHours(?)? + ?parseInt(hours));
          ?22
          ?23 ????????expDate.setMinutes(expDate.getMinutes(?)? + ?parseInt(minutes));
          ?24
          ?25 ???????? return ?expDate.toGMTString(?);
          ?26
          ?27 ????}

          ?28
          ?29 }

          ?30
          ?31 ???
          ?32
          ?33 // ?utility?function?called?by?getCookie(?)
          ?34
          ?35 function ?getCookieVal(offset)? {
          ?36
          ?37 ???? var ?endstr? = ?document.cookie.indexOf?( " ; " ,?offset);
          ?38
          ?39 ???? if ?(endstr? == ? - 1 )? {
          ?40
          ?41 ????????endstr? = ?document.cookie.length;
          ?42
          ?43 ????}

          ?44
          ?45 ???? return ?unescape(document.cookie.substring(offset,?endstr));
          ?46
          ?47 }

          ?48
          ?49 ???
          ?50
          ?51 // ?primary?function?to?retrieve?cookie?by?name
          ?52
          ?53 function ?getCookie(name)? {
          ?54
          ?55 ???? var ?arg? = ?name? + ? " = " ;
          ?56
          ?57 ???? var ?alen? = ?arg.length;
          ?58
          ?59 ???? var ?clen? = ?document.cookie.length;
          ?60
          ?61 ???? var ?i? = ? 0 ;
          ?62
          ?63 ???? while ?(i? < ?clen)? {
          ?64
          ?65 ???????? var ?j? = ?i? + ?alen;
          ?66
          ?67 ???????? if ?(document.cookie.substring(i,?j)? == ?arg)? {
          ?68
          ?69 ???????????? return ?getCookieVal(j);
          ?70
          ?71 ????????}

          ?72
          ?73 ????????i? = ?document.cookie.indexOf( " ? " ,?i)? + ? 1 ;
          ?74
          ?75 ???????? if ?(i? == ? 0 )? break ;?
          ?76
          ?77 ????}

          ?78
          ?79 ???? return ? "" ;
          ?80
          ?81 }

          ?82
          ?83 ???
          ?84
          ?85 // ?store?cookie?value?with?optional?details?as?needed
          ?86
          ?87 function ?setCookie(name,?value,?expires,?path,?domain,?secure)? {
          ?88
          ?89 ????document.cookie? = ?name? + ? " = " ? + ?escape?(value)? +
          ?90
          ?91 ????????((expires)? ? ? " ;?expires= " ? + ?expires?:? "" )? +
          ?92
          ?93 ????????((path)? ? ? " ;?path= " ? + ?path?:? "" )? +
          ?94
          ?95 ????????((domain)? ? ? " ;?domain= " ? + ?domain?:? "" )? +
          ?96
          ?97 ????????((secure)? ? ? " ;?secure " ?:? "" );
          ?98
          ?99 }

          100
          101 ???
          102
          103 // ?remove?the?cookie?by?setting?ancient?expiration?date
          104
          105 function ?deleteCookie(name,path,domain)? {
          106
          107 ???? if ?(getCookie(name))? {
          108
          109 ????????document.cookie? = ?name? + ? " = " ? +
          110
          111 ????????????((path)? ? ? " ;?path= " ? + ?path?:? "" )? +
          112
          113 ????????????((domain)? ? ? " ;?domain= " ? + ?domain?:? "" )? +
          114
          115 ???????????? " ;?expires=Thu,?01-Jan-70?00:00:01?GMT " ;
          116
          117 ????}

          118
          119 }

          120
          121
          posted @ 2006-07-04 22:52 無明 閱讀(256) | 評論 (0)編輯 收藏

          ?1 public ? static ?String?dumpBytes( byte []?bytes)? {?
          ?2 ???????? int ?i;?
          ?3 ????????StringBuffer?sb? = ? new ?StringBuffer();?
          ?4 ???????? for ?(i? = ? 0 ;?i? < ?bytes.length;?i ++ )? {?
          ?5 ?????????? if ?(i? % ? 32 ? == ? 0 ? && ?i? != ? 0 )? {?
          ?6 ????????????sb.append( " \n " );?
          ?7 ??????????}
          ?
          ?8 ??????????String?s? = ?Integer.toHexString(bytes[i]);?
          ?9 ?????????? if ?(s.length()? < ? 2 )? {?
          10 ????????????s? = ? " 0 " ? + ?s;?
          11 ??????????}
          ?
          12 ?????????? if ?(s.length()? > ? 2 )? {?
          13 ????????????s? = ?s.substring(s.length()? - ? 2 );?
          14 ??????????}
          ?
          15 ??????????sb.append(s);?
          16 ????????}
          ?
          17 ???????? return ?sb.toString();?
          18 ??????}
          ?
          posted @ 2006-07-04 22:47 無明 閱讀(2594) | 評論 (0)編輯 收藏

          主站蜘蛛池模板: 松阳县| 双牌县| 南漳县| 砀山县| 都江堰市| 龙州县| 荥阳市| 江城| 宜春市| 长白| 祁门县| 进贤县| 夹江县| 桑日县| 城固县| 合山市| 米泉市| 宿迁市| 三明市| 泉州市| 阿城市| 扎赉特旗| 郯城县| 新丰县| 扶沟县| 普陀区| 会理县| 松阳县| 噶尔县| 封开县| 上犹县| 安宁市| 蒙阴县| 韩城市| 衡水市| 通河县| 芜湖市| 章丘市| 湛江市| 玛纳斯县| 安吉县|