无明居

  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 无明 阅读(241) | 评论 (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 无明 阅读(200) | 评论 (0)编辑 收藏

设置好session的File Transfer中的download和upload路径,然后登陆后就可以用sz filename下载文件回客户端,从客户端上传文件则是用 rz 命令就好。 

posted @ 2006-12-03 00:45 无明 阅读(284) | 评论 (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 无明 阅读(562) | 评论 (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 无明 阅读(245) | 评论 (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 无明 阅读(2576) | 评论 (0)编辑 收藏