2019-07-26 mac下brew安装tomcat服务器 配置到intelliJ IDEA

使用brew 软件管理包 安装tomcat 是件很舒服的事,但是有好多同学不知道 brew 安装完软件后 ,软件安装到哪里去啦。
实际上 brew 在安装完软件后 会自动将软件的配置文件和运行文件分开放,方便在各种ide中配置时,程序员更容易凭借习惯填写:

brew安装软件后:

1,配置文件在/usr/local/etc中

2,安装文件在/usr/local/Cellar中

3,二进制可执行程序的软连接在/usr/local/bin中

而且在brew 安装完任何一个软件后 只需要在终端中 输入 brew info 软件名,就可以查看到相关信息:
liyongdong@bogon  ~  brew info tomcat
tomcat: stable 9.0.22
Implementation of Java Servlet and JavaServer Pages
https://tomcat.apache.org/
/usr/local/Cellar/tomcat/9.0.21 (680 files, 44.1MB) *
Built from source on 2019-06-23 at 20:09:47
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/tomcat.rb
==> Requirements
Required: java >= 1.8 ✔
==> Caveats
To have launchd start tomcat now and restart at login:
brew services start tomcat
Or, if you don't want/need a background service you can just run:
catalina run

这里很详细的指出 软件包的来源 于github,以及启动 或者重启tomcat的时候需要输入
brew service start tomcat 等讯息。
我们也可以凭借习惯就可以简单得想到 重启tomcat的命令:
brew services restart tomcat
以及所有关于 tomcat的所有配置的命令:
catalina -h

得到想要的讯息如下:

Using CATALINA_BASE: /usr/local/Cellar/tomcat/9.0.21/libexec
Using CATALINA_HOME: /usr/local/Cellar/tomcat/9.0.21/libexec
Using CATALINA_TMPDIR: /usr/local/Cellar/tomcat/9.0.21/libexec/temp
Using JRE_HOME: /Library/Java/JavaVirtualMachines/openjdk-12.0.1.jdk/Contents/Home
Using CLASSPATH: /usr/local/Cellar/tomcat/9.0.21/libexec/bin/bootstrap.jar:/usr/local/Cellar/tomcat/9.0.21/libexec/bin/tomcat-juli.jar
Usage: catalina.sh ( commands ... )
commands:
debug Start Catalina in a debugger
debug -security Debug Catalina with a security manager
jpda start Start Catalina under JPDA debugger
run Start Catalina in the current window
run -security Start in the current window with security manager
start Start Catalina in a separate window
start -security Start in a separate window with security manager
stop Stop Catalina, waiting up to 5 seconds for the process to end
stop n Stop Catalina, waiting up to n seconds for the process to end
stop -force Stop Catalina, wait up to 5 seconds and then use kill -KILL if still running
stop n -force Stop Catalina, wait up to n seconds and then use kill -KILL if still running
configtest Run a basic syntax check on server.xml - check exit code for result
version What version of tomcat are you running?
Note: Waiting for the process to end and use of the -force option require that $CATALINA_PID is defined

这其中 HOME 就是环境变量 ,跟windows下的系统变量(home)一样方便记忆。

你可能感兴趣的:(2019-07-26 mac下brew安装tomcat服务器 配置到intelliJ IDEA)