依个人的习惯,喜欢将源码安装在/usr/local这个目录下面:
第一步:下载源码
wget http://archive.apache.org/dist/tomcat/tomcat-8/v8.0.24/bin/apache-tomcat-8.0.24.tar.gz
第二步:解压源码:
tar -zxvf apache-tomcat-8.0.24.tar.gz mv apache-tomcat-8.0.24 /usr/local/tomcat
第三步:启动tomcat
cd /usr/local/tomcatbin/startup.sh
第四步:修改tomcat的访问端口:
... <Connector port="8000" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> <!-- A "Connector" using the shared thread pool--> ...
第五步:验证tomcat是否正常启动:
[[email protected] conf]# curl -vo /dev/null "http://ip:8000" .... > GET / HTTP/1.1 > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.27.1 zlib/1.2.3 libidn/1.18 libssh2/1.4.2 > Host: ip:8000 > Accept: */* > % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0< HTTP/1.1 200 OK < Server: Apache-Coyote/1.1 < Content-Type: text/html;charset=UTF-8 < Transfer-Encoding: chunked < Date: Sun, 04 Feb 2018 05:09:16 GMT < { [data not shown] 100 11230 0 11230 0 0 517k 0 --:--:-- --:--:-- --:--:-- 996k* Connection #0 to host 103.210.238.251 left intact * Closing connection #0
原文地址:https://www.cnblogs.com/1111zhiping-tian/p/8412977.html
时间: 2024-10-05 10:16:42