1. 安装 openssl:
下载 openssl version 0.9.6 (www.openssl.org)
shell> zcat 0.96l.tar.gz tar xvf -
shell> ./config
shell> make
shell> make install
2. 安装 mysql:
下载 mysql version 4.0.14 source (mysql-4.0.14.tar.gz)
shell> groupadd mysql
shell> useradd -g mysql mysql
shell> gunzip < mysql-version.tar.gz tar -xvf -
shell> cd mysql-version
shell> ./configure --prefix=/usr/local/mysql --with –openssl --with -vio
shell> make
shell> make install
shell> cp support-files/my-medium.cnf /etc/my.cnf
shell> cd /usr/local/mysql
shell> bin/mysql_install_db --user=mysql
shell> chown -r root .
shell> chown -r mysql var
shell> chgrp -r mysql .
shell> bin/mysqld_safe --user=mysql &
3. 修改mysql密码及访问权限 (根据需要。可能造成安全问题)
shell> cd /usr/local/mysql/bin/
shell> ./mysql -u root –p
mysql> insert into mysql.user values ('%','root', password('1qw23e'),'y','y','y','y','y','y','y','y','y','y','y','y','y','y','y','y','y','y','y','y','y','y','y','y','y','y','','','','',0,0,0,0);
4. 生成ssl证书
dir=`pwd`/openssl
priv=$dir/private
mkdir $dir $priv $dir/newcerts
cp /usr/share/ssl/openssl.cnf $dir
replace ./democa $dir -- $dir/openssl.cnf
# create necessary files: $database, $serial and $new_certs_dir
# directory (optional)
touch $dir/index.txt
echo "01" > $dir/serial
# generation of certificate authority(ca)
openssl req -new -x509 -keyout $priv/cakey.pem -out $dir/cacert.pem \
-config $dir/openssl.cnf
note : if you were requested to enter "pem pass", please enter different "pem pass" in the following steps.
# create server request and key
openssl req -new -keyout $dir/server-key.pem -out \
$dir/server-req.pem -days 3600 -config $dir/openssl.cnf
# remove the passphrase from the key (optional)
openssl rsa -in $dir/server-key.pem -out $dir/server-key.pem
# sign server cert
openssl ca -policy policy_anything -out $dir/server-cert.pem \
-config $dir/openssl.cnf -infiles $dir/server-req.pem
# create client request and key
openssl req -new -keyout $dir/client-key.pem -out \
Java Asp PHP .Net XML C/C++ CGI VB Jsp J2ee J2se J2me EJB Servlet Tomcat Resin Struts Weblogic Eclipse ANT GUI JMS Web servise IDEA Webphere Hibernate Spring Jboss Applet Swing Socket Javamail Perl Ajax P2P 安全 模式 框架 测试 开源 游戏
Windows XP Windows 2000 Windows 2003 Windows Me Windows 9.x Linux UNIX 注册表 操作系统 服务器 应用服务器