阿里云乌班图安装JDK\MYSQL\REDIS
一、JDK的安装和配置
1、下载
http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase7-521261.html
wget http://download.oracle.com/otn/java/jdk/7u80-b15/jdk-7u80-linux-x64.tar.gz?AuthParam=1464664563_6bb0f92085fc16c6d02a0e2281e06844
2、解压
mv jdk-7u80-linux-x64.tar.gz\?AuthParam\=1464664563_6bb0f92085fc16c6d02a0e2281e06844 jdk-7u80-linux-x64.tar.gz
sudo tar zxvf jdk-7u80-linux-x64.tar.gz -C /usr/lib/jvm
3、设置环境
sudo nano /etc/profile
#set java environment
export JAVA_HOME=/usr/lib/jvm/jdk1.7.0_67
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
4、切换
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.7.0_80/bin/java 300
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.7.0_80/bin/javac 300
5、查看结果
java -version
二、MYSQL的安装和配置
1、下载
sudo apt-get install mysql-server
sudo apt-get install mysql-client
注意在安装mysql-server的时候要设置一下root的初始密码,并且二次确认。
三、安装redis
sudo apt-get install redis-server
查看进程端口
ps -aux | grep mysql
netstat -nlt | grep 3306