Re阿里云Linux服务器如何配置数据库、jre、tomcat、部署javaweb
1、VPSMate安装
1
2
# wget http://www.vpsmate.org/tools/install.py
# python install.py<br>
2、安装好了VPSMate后,还要安装IUS源,执行以下命令(注意版本):
1
2
3
4
yum -y install gcc
yum -y install gcc-c++
rpm -ivh http://dl.iuscommunity.org/pub/ius/stable/Redhat/6/i386/ius-release-1.0-11.ius.el6.noarch.rpm (32位)
rpm -ivh http://dl.iuscommunity.org/pub/ius/stable/CentOS/6/x86_64/ius-release-1.0-11.ius.centos6.noarch.rpm (64位)
3、安装Mysql
3.1手动
wget –c http://dev.mysql.com/get/Downloads/MySQL-5.6/MySQL-server-5.6.10-1.rhel5.x86_64.rpm/from/http://cdn.mysql.com
wget –c http://dev.mysql.com/get/Downloads/MySQL-5.6/MySQL-client-5.6.10-1.rhel5.x86_64.rpm/from/http://cdn.mysql.com
wget –c http://dev.mysql.com/get/Downloads/MySQL-5.6/MySQL-devel-5.6.10-1.rhel5.x86_64.rpm/from/http://cdn.mysql.co
rpm -ivh MySQL-server-5.6.10-1.rhel5.x86_64.rpm
rpm -ivh MySQL-client-5.6.10-1.rhel5.x86_64.rpm
rpm -ivh MySQL-devel-5.6.10-1.rhel5.x86_64.rpm
如果有安装过程有文件冲突,先卸载原有文件
yum -y remove mysql-libs-5*
启动服务
service mysql start
3.2、使用VPSMate的“服务管理”安装“数据库服务”
如果有安装过程有文件冲突,先卸载原有文件
yum -y remove mysql-libs-5*
进入“数据库管理”,将主机位%的项赋予所有权限,并且设置密码
4、安装jre
下载:wget http://download.oracle.com/otn-pub/java/jdk/8u5-b13/jre-8u5-linux-x64.rpm?AuthParam=1404923334_f3f295697f694911cb4d0848524df4df
安装:rpm -ivh jre-8u5-linux-x64.rpm
环境配置:
vi /etc/profile
! (进入插入模式)
插入以下类容:
PATH:/usr/java/jre1.8.0_05 /bin
export JAVA_HOME =/usr/java/jre1.8.0_05
export CLASSPATH = $JAVA_HOME/lib:.
保存并退出esc+:wq
(不保存直接退出是:q!)
验证:java -version
5、安装tomcat
wget http://mirrors.hust.edu.cn/apache/tomcat/tomcat-8/v8.0.9/bin/apache-tomcat-8.0.9.tar.gz
tar -zxvf apache-tomcat-8.0.9.tar.gz
cp -R apache-tomcat-8.0.9 /usr/local/tomcat
/usr/local/tomcat/bin/startup.sh
测试:http://[IP地址]:8080/
手动启动tomcat:
cd /usr/local/tomcat/bin
./startup.sh
Done!