[CentOS]----JDK,Resin,mySQL的安装
1 JDK安装步骤
1.1 查询已知的JDK版本: Java –version
1.2 查看JDK的RPM安装包: rpm –qa|grep jdk
1.3 假如已经有JDK的rpm安装包,则卸载它 rpm –e xxx
1.4 运行jdk的二进制rpm包: ./jdk_6u18_linux_i586_rpm.bin
1.5 设置系统环境变量,在/etc/profile最下面加上以下几段
#SetJava
JAVA_HOME=/usr/java/jdk1.6.0_18
PATH=$JAVA_HOME/bin:$PATH
CLASSPATH=.:$JAVA_HOME/lib
JRE_HOME=$JAVA_HOME/jre
export JAVA_HOME PATH CLASSPATH JRE_HOME1.6 设置java和javac的符号链接
cd/usr/bin
ln–sf/usr/java/jdk1.6.0_18/jre/bin/java
ln –sf /usr/java/jdk1.6.0_18/jre/bin/javac
2 Resin安装步骤
2.1 解压resin源码包 tar –zxvf /usr/soft/resin-3.1.9.tar.gz –C /usr/local
2.2 进入文件夹 cd /usr/local/resin-3.1.9
2.3 编译源码
./configure--with-java-home=/usr/java/jdk1.6.0_18
make && make install && make clear2.4 把resin做成服务
2.4.1 cp /usr/local/resin-3.1.9/contrib/init.resin.in /etc/init.d/resin
2.4.2 chmod +x /etc/init.d/resin
2.4.3 如果需要开机启动: chkconfig --add resin
2.4.4 修改 /etc/init.d/resin
JAVA_HOME=/usr/java/jdk1.6.0_18
RESIN_HOME=/usr/local/resin-3.1.9
#log_daemon_msg"Startingresin"
#log_end_msg$?
#log_daemon_msg"Stoppingresin"
#log_end_msg$?
3 安装绿色版mySQL5.1.34
3.1 解压: tar –zxvf mysql-5.1.34-linux-i686-icc-glibc23.tar.gz –C /usr/local
3.2 创建链接:
cd/usr/local
ln –sf mysql-5.1.34-linux-i686-icc-glibc23 mysql3.3 配置安装
cdmysql
sripts/mysql_install_db#安装数据库
su–root
groupaddmysql
useradd–gmysqlmysql#添加mysql用户组与用户
cd/etc/init.d
cp/usr/local/mysql/support-file/mysql.servermysql
chown–Rroot/usr/local/mysql#二进制所有权归root所有
chgrp–Rmysql/usr/local/mysql#二进制所有权归mysql所在的管理组
chown –R mysql /usr/local/mysql/data #数据目录所有权归mysql管理用户3.4 编辑/etc/init.d/mysql将basedir改成mysql的实际路径
3.5 service mysql start
cd/usr/local/mysql/bin
./mysqladmin–urootpassword“123456”#添加root用户
./mysql–uroot–p123456
mysql>GRANTALLPRIVILEGESON*.*TO‘root’@’%’IDENTIFIEDBY‘123456’WITHGRANTOPTION;#外网访问
mysql>usemysql;
mysql>deletefromuserwherepassword=‘’;
mysql>flush privileges;3.6 重启mysql service mysql restart