brew install tomcat@8
Configuration files: /opt/homebrew/etc/tomcat@8
tomcat@8 is keg-only, which means it was not symlinked into /opt/homebrew,
because this is an alternate version of another formula.
If you need to have tomcat@8 first in your PATH, run:
echo 'export PATH="/opt/homebrew/opt/tomcat@8/bin:$PATH"' >> ~/.zshrc
To restart tomcat@8 after an upgrade:
brew services restart tomcat@8
Or, if you don't want/need a background service you can just run:
/opt/homebrew/opt/tomcat@8/bin/catalina run
chmod +x /opt/homebrew/opt/tomcat@8/bin/*.sh
./catalina [명령]
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
./catalina start
catalina start
export PATH=/opt/homebrew/opt/tomcat@8/bin:$PATH
http://localhost:8080/
로 접속하면, 톰캣 기본화면이 뜰 것!이클립스 기반 강의라... 조금 헤메며 찾아가는 중
/opt/homebrew/opt/tomcat@8/libexec/conf
ref- [Intellij] Servlet 프로젝트 생성하기(JSP, Web Dynamic Project 생성)
[http://localhost:8080/firstweb/HelloServlet](http://localhost:8080/firstweb/HelloServlet)
을 브라우저에 요청하면, Hello Servlet 으로 응답해주는 서블릿 파일 만들기![image](https://user-images.githubusercontent.com/75327385/154581264-fcd59075-c33e-43dd-b227-e6b5f0e1faab.png)
http://localhost:8080/{프로젝트이름}/{URL_MAPPING값}
http
: 프로토콜localhost
: IP나 서버 도메인8080
: 포트 번호public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
response.setContentType("text/html;charset=UTF=8");
PrintWriter out = response.getWriter();
out.println("<html><body>");
out.println("<h1>" + message + "</h1>");
out.println("</body></html>");
}
response.setContentType("text/html;charset=UTF=8");