系统环境
- php 7.0.0
- nginx 1.9.7
- mysql 5.6.28
[root@iZ2851te7e5Z ~]# php -v
PHP 7.0.0 (cli) (built: Dec 10 2015 10:56:28) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies
[root@iZ2851te7e5Z ~]# nginx -v
nginx version: nginx/1.9.7
mysql Ver 14.14 Distrib 5.6.28, for Linux (x86_64) using EditLine wrapper
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
安装Java环境
在官网 http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
下载文件 jdk-8u121-linux-x64.tar.gz
通过上传工具传到服务器
解压 tar -zxvf jdk-8u121-linux-x64.tar.gz
JDK的文件夹的目前的位置是/usr/java/jdk1.8.0_121
修改文件vi /etc/profile
添加下面的环境变量
export JAVA_HOME=/usr/java/jdk1.8.0_121
export CLASSPATH=.:%JAVA_HOME%/lib/dt.jar:%JAVA_HOME%/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin
生效文件,检查java版本是否存在
source /etc/profile
[root@iZ2851te7e5Z jdk1.8.0_121]# java -version
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
Java安装完成
安装Tomcat
在官网下载安装包wget http://mirrors.hust.edu.cn/apache/tomcat/tomcat-8/v8.5.12/bin/apache-tomcat-8.5.12.zip
unzip apache-tomcat-9.0.0.M18-src.tar.gz
cd apache-tomcat-8.5.12/
cd bin
chmod 755 *.sh
#查看tomcat所在文件路径 /usr/java/apache-tomcat-8.5.12
#添加环境变量
vi /etc/profile
#添加
export CATALINA_HOME=/usr/java/apache-tomcat-8.5.12
export CATALINA_BASE=/usr/java/apache-tomcat-8.5.12
source /etc/profile
./startup.sh
访问当前服务器的8080端口,http://**:8080/
服务器正常启动
Tomcat 安装完成
确认安装版本
[root@iZ2851te7e5Z bin]# ./version.sh
Using CATALINA_BASE: /usr/java/apache-tomcat-8.5.12
Using CATALINA_HOME: /usr/java/apache-tomcat-8.5.12
Using CATALINA_TMPDIR: /usr/java/apache-tomcat-8.5.12/temp
Using JRE_HOME: /usr/java/jdk1.8.0_121
Using CLASSPATH: /usr/java/apache-tomcat-8.5.12/bin/bootstrap.jar:/usr/java/apache-tomcat-8.5.12/bin/tomcat-juli.jar
Server version: Apache Tomcat/8.5.12
Server built: Mar 8 2017 17:41:47 UTC
Server number: 8.5.12.0
OS Name: Linux
OS Version: 3.10.0-229.20.1.el7.x86_64
Architecture: amd64
JVM Version: 1.8.0_121-b13
JVM Vendor: Oracle Corporation
[root@iZ2851te7e5Z bin]# java -version
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)