본문 바로가기

WEB/NGINX4

4. tomcat 연동 1. /sw/web/nginx/nginx-1.24.0/conf/nginx.conf에 다음과 같이 설정 upstream tomcat (upstream 이름은 임의로 설정 가능) nginx에 내장된 모듈로 부하분산, 속도 개선의 역할 수행 연동할 톰캣 서버 ip:port(http) 작성 또는 도메인네임으로 작성해도 됨 server listen : nginx 기본 http 포트 location : / 패턴으로 호출했을 때 proxy_pass를 통해서 어느 upstream 서버 그룹으로 보낼지 선택 2. nginx 재기동 3. nginx ip:port로 톰캣 서버 페이지 호출 확인 2023. 5. 22.
3. 기동/중지 cd ${nginx_home}/sbin # 기동 ./nginx # 중지 ./nginx -s stop (fast shutdown) ./nginx -s quit (graceful shutdown) ./nginx -s reload (reloading the configuration file) ./nginx -s reopen (reopening the log files) # nginx.conf 문법 검사 ./nginx -t # 버전 확인 ./nginx -V # 프로세스 확인 ps -ef|grep nginx 기본 포트 : 80 2023. 5. 22.
2. 1024 이하 포트 사용 설정 root 계정으로 진행 ${nginx_home}/sbin chown root nginx chmod 6750 nginx 2023. 5. 22.
1. 설치 설치파일 다운로드 : http://nginx.org/en/download.html nginx: download nginx.org 1. 필수 패키지 설치 yum update yum install yum-utils yum groupinstall “Development Tools” yum install pcre pcre-devel yum install zlib zlib-devel yum install openssl openssl-dev yum install gcc 2. nginx 패키지 압축 해제 및 경로 이동 3. compile 실행 ./configure --prefix=/sw/web/nginx/nginx-1.22.1 --user=app --group=app --with-http_ssl_module --wi.. 2023. 5. 22.
728x90