Mac电脑配置Tomcat

下载Tomcat

tomcat.apache.org/download-90…
apache


解压至Library/apache-tomcat-9.0.8/文件夹下,能够直接拖动压缩包到Library目录,双击解压,删除压缩包便可


配置环境变量

终端输入 vim ~/.bash_profile  若是没有bash_profile则须要先建立vim

添加Tomcat环境变量配置浏览器

#tomcat配置
CATALINA_BASE=/Users/xxx/Library/apache-tomcat-9.0.8
CATALINA_HOME=/Users/xxx/Library/apache-tomcat-9.0.8
export PATH=$PATH:/Users/xxx/Library/apache-tomcat-9.0.8/bin
export CATALINA_BASE CATALINA_HOME
复制代码


运行Tomcat

须要进入Tomcat下的bin目录进行运行,即便配置了环境变量仍然会报一下错误tomcat

xxxxxx@bogon:~|⇒  sh startup.sh
Cannot find ./catalina.sh
The file is absent or does not have execute permission
This file is needed to run this program
xxxxxx@bogon:~|⇒
复制代码

终端进入/Users/xxx/Library/apache-tomcat-9.0.8/bin目录,输入sh startup.sh启动Tomcatbash


此时在浏览器中输入 http://loacalhost:8080ui


关闭Tomcat

终端 xxx/bin 目录下,输入sh shutdown.sh 关闭Tomcatthis

相关文章
相关标签/搜索