环境搭建必须jdk、tomcat、mysql(基础)
额外的软件包项目中可能用到
jdk:它包含jre和开发所需完整类库。
tomcat:它是一个web容器,项目通常往webapps下扔,便于外界访问。
mysql数据库: web项目数据的存取的来源。
nginx:它主要用于做负载均衡和反向代理。
maven:将web项目打成一个war包最大程度上节省资源空间。
ftp服务器:它主要用于让大量的图片或文件等资源和web项目分离,以减轻服务器压力和最大程度提高访问效率。
redis主要用于做缓存,当然它还有很多用途
(1)jdk安装参照该网址:https://www.cnblogs.com/xuehx/p/6143251.html
(2)tomcat安装直接解压(官网下载一步解压即可)
(3)mysql安装参照该网址:https://www.cnblogs.com/xiaotao726/p/6562265.html(中间会报一个错
libaio.so.1: cannot open shared object file
解决办法:yum install libaio* 执行该命令即可解决,通常是初始化Mysql报错
)
(4)maven安装和下载
wget http://mirrors.hust.edu.cn/apache/maven/maven-3/3.5.2/binaries/apache-maven-3.5.2-bin.tar.gz
tar -xzvf apache-maven-3.5.2-bin.tar.gz
vim /etc/profile
配置如下:
export MAVEN_HOME=/usr/local/maven
export PATH=${MAVEN_HOME}/bin:${PATH}
配置完后 source /etc/profile让配置生效
执行该命令:mvn -v 出现如下信息说明成功
Apache Maven 3.5.2 (138edd61fd100ec658bfa2d307c43b76940a5d7d; 2017-10-18T07:58:13Z)
Maven home: /usr/local/maven
Java version: 1.7.0_151, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.151.x86_64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-042stab112.15", arch: "amd64", family: "unix"
Apache Maven 3.5.2 (138edd61fd100ec658bfa2d307c43b76940a5d7d; 2017-10-18T07:58:13Z)
Maven home: /usr/local/maven
Java version: 1.7.0_151, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.151.x86_64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-042stab112.15", arch: "amd64", family: "unix"
再执行mvn -version 命令
会出现如下信息就表示ok
Apache Maven 3.5.2 (138edd61fd100ec658bfa2d307c43b76940a5d7d; 2017-10-18T07:58:13Z)
Maven home: /usr/local/maven
Java version: 1.7.0_151, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.151.x86_64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-042stab112.15", arch: "amd64", family: "unix"
Maven home: /usr/local/maven
Java version: 1.7.0_151, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.151.x86_64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-042stab112.15", arch: "amd64", family: "unix"
(5)nginx安装
进入该linux菜鸟教程:http://www.runoob.com/linux/nginx-install-setup.html
上面步骤十分详细即可安装成功
(6)ftp服务器安装
参照我的博客或者该网址http://www.linuxidc.com/Linux/2016-06/132125.htm
(7)redis下载安装
参照该网址https://www.cnblogs.com/wiseroll/p/7061673.html