您好,登錄后才能下訂單哦!
1、到 apache官方主頁 http://tomcat.apache.org 下載 Mac 版本的完整 tar.gz文件包。解壓拷貝到 /Library 目錄下,并命名為Tomcat,其他目錄也可以,我這就以/Library做講解。
2.打開終端,直接輸入 sudo chmod 755 /Library/Tomcat/bin/*.sh ,按回車鍵之后可能會提示輸入密碼,請輸入管理員密碼,這是修改bin目錄下的*.sh文件的權(quán)限
cd 到/LibraryTomcat/bin目錄下,輸入:sudo sh startup.sh,如果不cd進(jìn)去可以直接在外面/Library/Tomcat/bin/startup.sh啟動tomcat
若出現(xiàn)如下提示則表示運行成功:
Using CATALINA_BASE: /Library/Tomcat Using CATALINA_HOME: /Library/Tomcat Using CATALINA_TMPDIR: /Library/Tomcat/temp Using JRE_HOME: /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
3.打開瀏覽器,輸入 http://localhost:8080,回車之后如果看到Apache Tomcat網(wǎng)址,表示已經(jīng)成功運行Tomcat
4. 在終端中輸入命令 sudo sh /Library/Tomcat/bin/shutdown.sh,或者直接在外面 /Library/Tomcat/bin/shutdown.sh 回車之后可以關(guān)閉Tomcat。
接下來要在Eclipse里配置tomcat
題外話:sudo通常為系統(tǒng)超級管理員755 代表用戶對該文件擁有讀,寫,執(zhí)行的權(quán)限,同組其他人員擁有執(zhí)行和讀的權(quán)限,沒有寫的權(quán)限,其他用戶的權(quán)限和同組人員權(quán)限一樣。777代表,user,group ,others ,都有讀寫和可執(zhí)行權(quán)限。
1.先去下載個插件,Tomcat Eclipse Plugin, 下載地址:http://www.eclipsetotale.com/tomcatPlugin.html
Last login: Wed Jul 19 08:59:29 on console zhouqiandeMacBook-Air:~ zhouqian$ sudo chmod 755 /Library/Tomcat/bin/*.sh Password: chmod: /Library/Tomcat/bin/*.sh: No such file or directory zhouqiandeMacBook-Air:~ zhouqian$ sudo chmod 755 /library/tomcat/apache-tomcat-7.0.79/bin/*.sh zhouqiandeMacBook-Air:~ zhouqian$ cd /library/tomcat/apache-tomcat-7.0.79/bin zhouqiandeMacBook-Air:bin zhouqian$ sudo sh startup.sh Using CATALINA_BASE: /Library/tomcat/apache-tomcat-7.0.79 Using CATALINA_HOME: /Library/tomcat/apache-tomcat-7.0.79 Using CATALINA_TMPDIR: /Library/tomcat/apache-tomcat-7.0.79/temp Using JRE_HOME: /Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home Using CLASSPATH: /Library/tomcat/apache-tomcat-7.0.79/bin/bootstrap.jar:/Library/tomcat/apache-tomcat-7.0.79/bin/tomcat-juli.jar Tomcat started. zhouqiandeMacBook-Air:bin zhouqian$ sudo sh /library/tomcat/apache-tomcat-7.0.79/bin/shutdown.sh Using CATALINA_BASE: /library/tomcat/apache-tomcat-7.0.79 Using CATALINA_HOME: /library/tomcat/apache-tomcat-7.0.79 Using CATALINA_TMPDIR: /library/tomcat/apache-tomcat-7.0.79/temp Using JRE_HOME: /Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home Using CLASSPATH: /library/tomcat/apache-tomcat-7.0.79/bin/bootstrap.jar:/library/tomcat/apache-tomcat-7.0.79/bin/tomcat-juli.jar zhouqiandeMacBook-Air:bin zhouqian$
總結(jié)
以上所述是小編給大家介紹的Mac下安裝tomcat的教程詳解,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復(fù)大家的。在此也非常感謝大家對億速云網(wǎng)站的支持!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。