Linux环境下配置Tomat
生活随笔
收集整理的這篇文章主要介紹了
Linux环境下配置Tomat
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
軟件版本
1.Linux:CentOS Linux release 7.6.1810 (Core)
2.Tomcat:apache-tomcat-9.0.17
安裝步驟
1.從官網(wǎng)將壓縮包下載下來(lái)
2.利用FTP工具壓縮包上傳至服務(wù)器
3.解壓壓縮包
4.到此就差不多了,其實(shí)壓縮包不需要安裝,接下來(lái)就是配置了。
5.你們也可以將tomcat移到自己喜歡的目錄,我的是/usr/local/tomcat/
配置文件
配置文件:主要是bin目錄下的server.xml文件
<?xml version="1.0" encoding="UTF-8"?><Server port="8005" shutdown="SHUTDOWN"><Listener className="org.apache.catalina.startup.VersionLoggerListener"/><Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on"/><Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener"/><Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/><Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener"/><GlobalNamingResources><Resource name="UserDatabase" auth="Container"type="org.apache.catalina.UserDatabase"description="User database that can be updated and saved"factory="org.apache.catalina.users.MemoryUserDatabaseFactory"pathname="conf/tomcat-users.xml"/></GlobalNamingResources><Service name="Catalina"><!--端口要改為80端口--><Connector port="80" protocol="HTTP/1.1" connectionTimeout="2000" redirectPort="8443"/><Connector port="8009" protocol="AJP/1.3" redirectPort="8443"/><Engine name="Catalina" defaultHost="localhost"><Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/><Realm className="org.apache.catalina.realm.LockOutRealm"><Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/></Realm><Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true"><Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"prefix="localhost_access_log" suffix=".txt" pattern="%h %l %u %t "%r" %s %b"/></Host><!--這里xxx請(qǐng)改為自己實(shí)際的域名和項(xiàng)目名地址--><Host name="www.xxx.com" appBase="webapps" unpackWARs="true" autoDeploy="true"><Context path="" docBase="xxx" debug="0" reloadable="true"/><Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"prefix="localhost_access_log" suffix=".txt" pattern="%h %l %u %t "%r" %s %b"/></Host><!--例如:www.starlemon.top--><Host name="www.starlemon.top" appBase="webapps" unpackWARs="true" autoDeploy="true"><Context path="" docBase="/usr/local/tomcat/apache-tomcat-9.0.17/webapps/beian/" debug="0" reloadable="true"/><Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"prefix="localhost_access_log" suffix=".txt" pattern="%h %l %u %t "%r" %s %b"/></Host></Engine></Service> </Server>啟動(dòng)項(xiàng)目
運(yùn)行bin目錄下的startup.sh文件,啟動(dòng)項(xiàng)目
[root@localhost ~]# cd /usr/local/tomcat/bin/ [root@localhost ~]# ./startup.sh測(cè)試
打開(kāi)瀏覽器,輸入localhost,如果出現(xiàn)tomcat的歡迎頁(yè)面,就說(shuō)明配置成功了
與50位技術(shù)專家面對(duì)面20年技術(shù)見(jiàn)證,附贈(zèng)技術(shù)全景圖總結(jié)
以上是生活随笔為你收集整理的Linux环境下配置Tomat的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 雌二酮正常值是多少
- 下一篇: Wondows环境下配置Tomat