关闭防火墙
service iptables stop
chkconfig iptables off
安装jdk
上传jdk到centos
执行命令
cd ~
cp jdk-8u201-linux-i586.tar.gz /usr/local
cd /usr/local
tar -zxvf jdk-8u201-linux-i586.tar.gz
mv jdk1.8.0_201 jdk1.8
vim /etc/profile
JAVA_HOME=/usr/local/jdk1.8
JRE_HOME=/usr/local/jdk1.8/jre
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
export JAVA_HOME JRE_HOME PATH CLASSPATH
:wq
source /etc/profile
java -version
安装tomcat
上传tomcat到centos
执行命令
cd ~
cp apache-tomcat-8.5.38.tar.gz /usr/local
cd /usr/local
tar -zxvf apache-tomcat-8.5.38.tar.gz
mkdir tomcat1
mkdir tomcat2
cp -r apache-tomcat-8.5.38/* tomcat1
cp -r apache-tomcat-8.5.38/* tomcat2
修改端口号 (8005 , 8080 , 8009)
vim tomcat1/conf/server.xml
vim tomcat2/conf/server.xml
tomcat1/bin/startup.sh
tomcat2/bin/startup.sh
安装nginx
cd /usr/local
wget http://nginx.org/download/nginx-1.10.0.tar.gz
tar -zxvf nginx-1.10.0.tar.gz
yum -y install gcc pcre pcre-devel zlib zlib-devel openssl openssl-devel
cd nginx-1.10.0
./configure --prefix=/usr/local/nginx --sbin-path=/usr/bin/nginx
make && make install
vim /usr/local/nginx/conf/nginx.conf
http添加
upstream server{
server localhost:8180;
server localhost:8280;
}
server添加
location / {
proxy_pass http://server;
}
启动
nginx