Mac OS上裝置Tomcat辦事器的簡略步調。本站提示廣大學習愛好者:(Mac OS上裝置Tomcat辦事器的簡略步調)文章只能為提供參考,不一定能成為您想要的結果。以下是Mac OS上裝置Tomcat辦事器的簡略步調正文
一. 下載tomcat
起首要到tomcat官網去下載裝置包,官網下載地址以下:http://tomcat.apache.org/download-70.cgi , 留意請下載飛windows版本。和windows操作體系紛歧樣,這個外面沒有使人膩煩的注冊表。
將緊縮包解壓就任意一個目次,我這裡是寄存到/ProgramFile/tomcat 目次上面
二. 修正受權
tomcat中的幾個運轉辦事法式都是以*.sh開頭的,在運轉之前須要受權。翻開終端輸出以下敕令:
輸出以下敕令:
sudo chmod 755 /ProgramFile/tomcat/bin/*.sh
回車湧現要輸出暗碼:請輸出本機賬戶暗碼
三. 啟動tomcat辦事
先應用 cd 敕令進入tomcat的bin目次,敕令以下:
cd /ProgramFile/tomcat/bin/
啟動辦事敕令:
sudo sh startup.sh
啟動勝利,會湧現以下成果:
Using CATALINA_BASE: /ProgramFile/tomcat Using CATALINA_HOME: /ProgramFile/tomcat Using CATALINA_TMPDIR: /ProgramFile/tomcat/temp Using JRE_HOME: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home Using CLASSPATH: /ProgramFile/tomcat/bin/bootstrap.jar:/ProgramFile/tomcat/bin/tomcat-juli.jar Tomcat started.
假如湧現如上成果,解釋tomcat啟動勝利
四. tomcat 相干設置裝備擺設的修正
翻開tomcat中的 /tomcat/conf/tomcat-users.xml 文件。
<tomcat-users> <!-- NOTE: By default, no user is included in the "manager-gui" role required to operate the "/manager/html" web application. If you wish to use this app, you must define such a user - the username and password are arbitrary. --> <!-- NOTE: The sample user and role entries below are wrapped in a comment and thus are ignored when reading this file. Do not forget to remove <!.. ..> that surrounds them. --> <!-- <role rolename="tomcat"/> <role rolename="role1"/> <user username="tomcat" password="tomcat" roles="tomcat"/> <user username="both" password="tomcat" roles="tomcat,role1"/> <user username="role1" password="tomcat" roles="role1"/> --> <role rolename="manager"/> <user username="tomcat" password="root" roles="manager"/> </tomcat-users>
默許<role> 都是被正文的,這裡添加以下:
<role rolename="manager"/> <user username="tomcat" password="root" roles="manager"/>
更多設置裝備擺設修正,可以檢查tomcat的相干材料
這個時刻輸出 http://localhost:8080/ 應當便可以拜訪了,做java web開辟的應當很熟習,這裡不再評論辯論