cd /opt
mkdir tomcat
rpm -ivh jdk-8u201-linux-x64.rpm
tar zxvf apache-tomcat-9.0.16.tar.gz -C /usr/local
cd /usr/java/jdk1.8.0_201-amd64/
pwd
/usr/java/jdk1.8.0_201-amd64/
vim /etc/profile
export JAVA_HOME=/usr/java/jdk1.8.0_201-amd64
export CLASSPATH=$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar
export PATH=$JAVA_HOME/bin:$PATH
source /etc/profile
java -version
java version "1.8.0_201"
Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)
ln -s /usr/local/apache-tomcat-9.0.16/bin/shutdown.sh /usr/bin/
ln -s /usr/local/apache-tomcat-9.0.16/bin/startup.sh /usr/bin/
/usr/bin/startup.sh
netstat -natp |grep 8080
vim /usr/java/jdk1.8.0_201-amd64/jre/lib/security/java.security
# In addition, if "file:/dev/random" or "file:/dev/urandom" is
# specified, the "NativePRNG" implementation will be more preferred than
# SHA1PRNG in the Sun provider.
securerandom.source=file:/dev/urandom
cd /usr/local//apache-tomcat-9.0.16/webapps/
mkdir kgc benet
vim kgc/index.jsp
<h1>this is kgc page</h1>
vim benet/index.jsp
<h1>this is benet page</h1>
vim /usr/local/apache-tomcat-9.0.16/conf/server.xml
<Host name="www.kgc.com" appBase="/usr/local/apache-tomcat-9.0.16/webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<Context docBase="/usr/local/apache-tomcat-9.0.16/webapps/kgc"
path="" reloadable="true" />
</Host>
<Host name="www.benet.com" appBase="/usr/local/apache-tomcat-9.0.16/webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<Context docBase="/usr/local/apache-tomcat-9.0.16/webapps/benet"
path="" reloadable="true" />
</Host>
yum install -y bind
vim /etc/named.conf
listen-on port 53 { any; };
allow-query { any; };
vim /etc/named.rfc1912.zones
zone "kgc.com" IN {
type master;
file "kgc.com.zone";
allow-update { none; };
};
zone "benet.com" IN {
type master;
file "benet.com.zone";
allow-update { none; };
};
cp -p /var/named/named.localhost /var/named/kgc.com.zone
vim /var/named/kgc.com.zone
www IN A 192.168.60.10
cp -p /var/named/kgc.com.zone /var/named/benet.com.zone
systemctl start named
/usr/local/apache-tomcat-9.0.16/bin/shutdown.sh
/usr/local/apache-tomcat-9.0.16/bin/startup.sh
www.kgc.com:8080
www.benet.com:8080
vim /usr/local/apache-tomcat-9.0.16/conf/server.xml
<Connector port="8080"
protocol="HTTP/1.1
connectionTimeout="20000"
redirectPort="8443"
minSpareThreads="50" ##############最小空閒執行緒數
enableLookups="false" #########是否反查域名
disableUploadTimeout="true" ###########上傳時候是否使用超時機制 機製
acceptCount="300" #########可傳入最大連線請求的佇列長度,預設100
maxThreads="500" ############最大執行緒數
processorCache="500" #########
URIEncoding="UTF-8" #########tomcat容器編碼格式
compression="on" ############是否對響應的數據進行壓縮
compressionMinSize="2048" #########表示壓縮響應的最小值
compressableMimeType="text/html,text/xml,text/javascript,text/css,
text/plain,image/gif,image/jpg,image/png"
/> ########指定對那些檔案進行壓縮
/usr/local/apache-tomcat-9.0.16/bin/shutdown.sh
/usr/local/apache-tomcat-9.0.16/bin/startup.sh