标签:syntax height stream yum visible imp sof server image
#!/bin/bash
rpm -ivh jdk-8u131-linux-x64_.rpm
[ `grep JAVA_HOME /etc/profile | wc -l` -ne 4 ];then
echo -e ‘export JAVA_HOME=/usr/java/jdk1.8.0_131\n
export JAVA_BIN=/usr/javak1.8.0_131/bin\n
export PATH=$PATH:$JAVA_HOME/bin\n
export CLASSPATH=.:$JAVA_HOMEb/dt.jar:$JAVA_HOMEb/tools.jar\n
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH‘ >> /etc/profile
fi
source /etc/profile
tar xfz apache-tomcat-7.0.47.tar.gz
mv apache-tomcat-7.0.47 /opt/tomcat1
tar xfz apache-tomcat-7.0.47.tar.gz
mv apache-tomcat-7.0.47 /opt/tomcat2
sed -i
‘s/8009/18009/‘
/opt/tomcat2/conf/server.xml
sed -i
‘s/8005/18005/‘
/opt/tomcat2/conf/server.xml
sed -i
‘s/8080/18080/‘
/opt/tomcat2/conf/server.xml
yum -y install supervisor
systemctl start supervisord
touch /etc/supervisord.d/tomcat1.ini
touch /etc/supervisord.d/tomcat2.ini
echo -e ‘[program:tomcat1]
command=/opt/tomcat1/bin/catalina.sh run‘ >> /etc/supervisord.d/tomcat1.ini
echo -e ‘[program:tomcat2]
command=/opt/tomcat2/bin/catalina.sh run‘ >> /etc/supervisord.d/tomcat2.ini
systemctl restart supervisord
yum -y install gcc gcc-c++ pcre-devel zlib-devel
tar xfz nginx-1.12.0.tar.gz
cd nginx-1.12.0 && ./configure && make && make install
sed -i
‘/#gzip on;/aupstream tomcat{‘
/usr/local/nginx/conf/nginx.conf
sed -i
‘/upstream tomcat{/aserver 10.0.0.41:8080;‘
/usr/local/nginx/conf/nginx.conf
sed -i
‘/server 10.0.0.41:8080;/aserver 10.0.0.41:18080;‘
/usr/local/nginx/conf/nginx.conf
sed -i
‘/server 10.0.0.41:18080;/a\}‘
/usr/local/nginx/conf/nginx.conf
sed -i
‘s/index.htm;$/index.jsp;/‘
/usr/local/nginx/conf/nginx.conf
sed -i
‘/404.html;/alocation ~ \.jsp$ {‘
/usr/local/nginx/conf/nginx.conf
sed -i
‘/location ~ \.jsp$ {/aproxy_pass http://tomcat;‘
/usr/local/nginx/conf/nginx.conf
sed -i
‘/proxy_pass http:\/\/tomcat;/a\}‘
/usr/local/nginx/conf/nginx.conf
/usr/local/nginx/sbin/nginx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
#!/bin/bash rpm -ivh jdk-8u131-linux-x64_.rpm if [ `grep JAVA_HOME /etc/profile | wc -l` -ne 4 ];then echo -e ‘export JAVA_HOME=/usr/java/jdk1.8.0_131\n export JAVA_BIN=/usr/javak1.8.0_131/bin\n export PATH=$PATH:$JAVA_HOME/bin\n export CLASSPATH=.:$JAVA_HOMEb/dt.jar:$JAVA_HOMEb/tools.jar\n export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH‘ >> /etc/profile fi source /etc/profile tar xfz apache-tomcat-7.0.47.tar.gz mv apache-tomcat-7.0.47 /opt/tomcat1 tar xfz apache-tomcat-7.0.47.tar.gz mv apache-tomcat-7.0.47 /opt/tomcat2 sed -i ‘s/8009/18009/‘ /opt/tomcat2/conf/server.xml sed -i ‘s/8005/18005/‘ /opt/tomcat2/conf/server.xml sed -i ‘s/8080/18080/‘ /opt/tomcat2/conf/server.xml yum -y install supervisor systemctl start supervisord touch /etc/supervisord.d/tomcat1.ini touch /etc/supervisord.d/tomcat2.ini echo -e ‘[program:tomcat1] command=/opt/tomcat1/bin/catalina.sh run‘ >> /etc/supervisord.d/tomcat1.ini echo -e ‘[program:tomcat2] command=/opt/tomcat2/bin/catalina.sh run‘ >> /etc/supervisord.d/tomcat2.ini systemctl restart supervisord yum -y install gcc gcc-c++ pcre-devel zlib-devel tar xfz nginx-1.12.0.tar.gz cd nginx-1.12.0 && ./configure && make && make install sed -i ‘/#gzip on;/aupstream tomcat{‘ /usr/local/nginx/conf/nginx.conf sed -i ‘/upstream tomcat{/aserver 10.0.0.41:8080;‘ /usr/local/nginx/conf/nginx.conf sed -i ‘/server 10.0.0.41:8080;/aserver 10.0.0.41:18080;‘ /usr/local/nginx/conf/nginx.conf sed -i ‘/server 10.0.0.41:18080;/a\}‘ /usr/local/nginx/conf/nginx.conf sed -i ‘s/index.htm;$/index.jsp;/‘ /usr/local/nginx/conf/nginx.conf sed -i ‘/404.html;/alocation ~ \.jsp$ {‘ /usr/local/nginx/conf/nginx.conf sed -i ‘/location ~ \.jsp$ {/aproxy_pass http://tomcat;‘ /usr/local/nginx/conf/nginx.conf sed -i ‘/proxy_pass http:\/\/tomcat;/a\}‘ /usr/local/nginx/conf/nginx.conf /usr/local/nginx/sbin/nginx |
标签:syntax height stream yum visible imp sof server image
原文地址:https://www.cnblogs.com/wanglinyan/p/12752575.html