Mac下安装tomcat的教程详解
1、到apache官方主页http://tomcat.apache.org下载Mac版本的完整tar.gz文件包。解压拷贝到/Library目录下,并命名为Tomcat,其他目录也可以,我这就以/Library做讲解。
2.打开终端,直接输入sudochmod755/Library/Tomcat/bin/*.sh,按回车键之后可能会提示输入密码,请输入管理员密码,这是修改bin目录下的*.sh文件的权限
cd到/LibraryTomcat/bin目录下,输入:sudoshstartup.sh,如果不cd进去可以直接在外面/Library/Tomcat/bin/startup.sh启动tomcat
若出现如下提示则表示运行成功:
UsingCATALINA_BASE:/Library/Tomcat UsingCATALINA_HOME:/Library/Tomcat UsingCATALINA_TMPDIR:/Library/Tomcat/temp UsingJRE_HOME:/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
3.打开浏览器,输入http://localhost:8080,回车之后如果看到ApacheTomcat网址,表示已经成功运行Tomcat
4.在终端中输入命令sudosh/Library/Tomcat/bin/shutdown.sh,或者直接在外面/Library/Tomcat/bin/shutdown.sh回车之后可以关闭Tomcat。
接下来要在Eclipse里配置tomcat
题外话:sudo通常为系统超级管理员755代表用户对该文件拥有读,写,执行的权限,同组其他人员拥有执行和读的权限,没有写的权限,其他用户的权限和同组人员权限一样。777代表,user,group,others,都有读写和可执行权限。
1.先去下载个插件,TomcatEclipsePlugin,下载地址:http://www.eclipsetotale.com/tomcatPlugin.html
Lastlogin:WedJul1908:59:29onconsole zhouqiandeMacBook-Air:~zhouqian$sudochmod755/Library/Tomcat/bin/*.sh Password: chmod:/Library/Tomcat/bin/*.sh:Nosuchfileordirectory zhouqiandeMacBook-Air:~zhouqian$sudochmod755/library/tomcat/apache-tomcat-7.0.79/bin/*.sh zhouqiandeMacBook-Air:~zhouqian$cd/library/tomcat/apache-tomcat-7.0.79/bin zhouqiandeMacBook-Air:binzhouqian$sudoshstartup.sh UsingCATALINA_BASE:/Library/tomcat/apache-tomcat-7.0.79 UsingCATALINA_HOME:/Library/tomcat/apache-tomcat-7.0.79 UsingCATALINA_TMPDIR:/Library/tomcat/apache-tomcat-7.0.79/temp UsingJRE_HOME:/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home UsingCLASSPATH:/Library/tomcat/apache-tomcat-7.0.79/bin/bootstrap.jar:/Library/tomcat/apache-tomcat-7.0.79/bin/tomcat-juli.jar Tomcatstarted. zhouqiandeMacBook-Air:binzhouqian$sudosh/library/tomcat/apache-tomcat-7.0.79/bin/shutdown.sh UsingCATALINA_BASE:/library/tomcat/apache-tomcat-7.0.79 UsingCATALINA_HOME:/library/tomcat/apache-tomcat-7.0.79 UsingCATALINA_TMPDIR:/library/tomcat/apache-tomcat-7.0.79/temp UsingJRE_HOME:/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home UsingCLASSPATH:/library/tomcat/apache-tomcat-7.0.79/bin/bootstrap.jar:/library/tomcat/apache-tomcat-7.0.79/bin/tomcat-juli.jar zhouqiandeMacBook-Air:binzhouqian$
总结
以上所述是小编给大家介绍的Mac下安装tomcat的教程详解,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对毛票票网站的支持!