1、安装: 在Mac环境下配置tomcat 安装后的默认路径是~/Library/Tomcat. 2、进入到Tomcat/bin目录下, ./startup.sh 1 3、进入到Tomcat/bin目录下, ./shutdown.sh 1 4、权限问题: ① $ ~/Library/Tomcat/bin $ ./startup.sh zsh: permission denied: ./startup.sh 1 2 解决: sudo chmod 777 startup.sh 1 ② $ ~/Library/Tomcat/bin $ ./startup.sh Cannot find ./catalina.sh The file is absent or does not have execute permission This file is needed to run this program 1 2 3 4 解决: chmod +x catalina.sh 1 https://askubuntu.com/questions/790186/catalina-sh-not-found-the-file-is-absent-or-does-not-have-execute-permission 5、给zsh配置alias,方便启动和关闭:zsh 配置文件: # 针对安装的Tomcat环境,快捷启动和关闭 # tomcat startup alias tomcatstartup='~/Library/Tomcat/bin/startup.sh' # tomcat shutdown alias tomcatshutdown='~/Library/Tomcat/bin/shutdown.sh' 1 2 3 4 5 接着我们就可以很方便的调用我们的服务了。 启动服务: tomcatstartup 1 停止服务: tomcatshutdown 1 启动服务后,在浏览器访问http://localhost:8080/,就会出现Tomcat的经典页面了。 6、修改默认端口: 默认端口是8080,我们可以修改为我们期望的端口,具体是tomcat根目录/conf/server.xml文件,具体参考tomcat更改默认端口号即可。 接着重启服务即可。 |
GMT+8, 2024-11-21 18:27 , Processed in 0.207496 second(s), 19 queries , Gzip On.
Powered by Discuz! X3.5
© 2001-2024 Discuz! Team.