代码改变世界

Linux下安装tomcat+jdk+mysql记录

2013-04-21 16:32  轩脉刃  阅读(2839)  评论(0编辑  收藏  举报

先安装JDK

 
下载jdk:
 
mv jdk-7u21-linux-x64.tar.gz\?AuthParam\=1366529379_f7fe2af81268eee41771542b3191968c jdk-7u21-linux-x64.tar.gz
tar -xf jdk-7u21-linux-x64.tar.gz
设置PATH,比如我的~/.bash_profile:
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

JAVA_HOME=$HOME/software/jdk1.7.0_21
CLASSPATH=.:$JAVA_HOME/lib/tools.jar
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin

export JAVA_HOME CLASSPATH PATH
 
测试是否安装成功:
echo $JAVA_HOME
echo $PATH
 
安装jdk完成
 
---------------
 
安装mysql
 
安装mysql-server
偷个懒,直接使用yum安装
 
sudo yum install mysql-server
sudo yum install mysql
sudo service mysqld start
 
设置mysql root帐号的密码:
sudo mysql
set password for 'root'@'localhost' = PASSWORD('XXXXX');
 
设置开机自启动
sudo chkconfig --levels 345 mysqld on
 
安装mysql完成
 
-------------
 
安装tomcat
 
偷个懒,使用yum安装
 
sudo yum install tomcat6
sudo yum install tomcat6-webapps
sudo yum install tomcat6-admin-webapps
 
sudo service tomcat6 start
 
 
安装tomcat完成