Mac下安装tomcat的教程详解
1、到 apache官方主页 下载 mac 版本的完整 tar.gz文件包。解压拷贝到 /library 目录下,并命名为tomcat,其他目录也可以,我这就以/library做讲解。
2.打开终端,直接输入 sudo chmod 755 /library/tomcat/bin/*.sh ,按回车键之后可能会提示输入密码,请输入管理员密码,这是修改bin目录下的*.sh文件的权限
cd 到/librarytomcat/bin目录下,输入:sudo sh startup.sh,如果不cd进去可以直接在外面/library/tomcat/bin/startup.sh启动tomcat
若出现如下提示则表示运行成功:
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.打开浏览器,输入 ,回车之后如果看到apache tomcat网址,表示已经成功运行tomcat
4. 在终端中输入命令 sudo sh /library/tomcat/bin/shutdown.sh,或者直接在外面 /library/tomcat/bin/shutdown.sh 回车之后可以关闭tomcat。
接下来要在eclipse里配置tomcat
题外话:sudo通常为系统超级管理员755 代表用户对该文件拥有读,写,执行的权限,同组其他人员拥有执行和读的权限,没有写的权限,其他用户的权限和同组人员权限一样。777代表,user,group ,others ,都有读写和可执行权限。
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$
总结
以上所述是小编给大家介绍的mac下安装tomcat的教程详解,希望对大家有所帮助
上一篇: 刘作虎:手机内卷化可能会是新常态
推荐阅读