목록nginx (4)
코딩마을방범대

우분투에서 Nginx 구축 웹서버 Nginx & Apache (이전 포스트) 1. Nginx 설치 apt 업데이트 후 Nginx 설치 Nginx 설치 시 자동으로 실행됨 $ sudo apt update $ sudo apt-get install nginx Nginx 실행 $ sudo service nginx start # or $ sudo systemctl start nginx sweet-rain-kim.tistory.com 서버에 Nginx 하나를 구축하는 것은 위 링크를 참고하면 된다. 하지만 이번 포스팅에선 사용자 별로 각각의 홈디렉토리에 Nginx를 구축해볼 것이다. 물론 포트 번호는 전부 달라야하고, 메인 Nginx 하나를 구축하는 것보다 훨씬 번거롭다. 모든 명령어는 root 권한을 기반으로 실..

Nginx의 현재 연결 수, 처리된 요청 수 정보를 확인하는 방법은 상태 모듈을 사용하면 된다. 아래와 같이 설정 후 nginx 재부팅 시 Nginx의 상태를 확인할 수 있으며, 이를 통해 과부하 등을 체크할 수 있다. 1. Nginx 설정 파일 수정 $ sudo vi /etc/nginx/sites-available/default server { location /nginx_status { stub_status on; access_log off; allow 127.0.0.1; deny all; } } 옵션명 설명 stub_status on; 상태 모듈을 활성화 하는 명령어 access_log off; 로그를 출력하지 않음 allow 127.0.0.1; 로컬 호스트에서만 접근할 수 있음 deny all; ..

우분투에서 Nginx 구축 웹서버 Nginx & Apache (이전 포스트) 1. Nginx 설치 apt 업데이트 후 Nginx 설치 Nginx 설치 시 자동으로 실행됨 $ sudo apt update $ sudo apt-get install nginx Nginx 실행 $ sudo service nginx start # or $ sudo systemctl start nginx sweet-rain-kim.tistory.com 위 포스트를 통해 nginx를 구축하였다면, 캐시 설정을 통해 서비스를 향상 시킬 수 있다. Proxy Cache Nginx 웹 서버에서 사용되는 모듈 중 하나로, 원격 서버로부터 받은 응답을 캐시하여 이후의 클라이언트 요청에 대한 성능 및 응답 시간을 개선하는 역할을 한다. 대규모 ..

웹서버 Nginx & Apache (이전 포스트) 1. Nginx 설치 apt 업데이트 후 Nginx 설치 Nginx 설치 시 자동으로 실행됨 $ sudo apt update $ sudo apt-get install nginx Nginx 실행 $ sudo service nginx start # or $ sudo systemctl start nginx 서버 시작 시 자동으로 Nginx 를 실행하고 싶은 경우 $ sudo systemctl enable nginx 서버 시작 시 Nginx가 자동으로 실행되지 않게 하고싶은 경우 $ sudo systemctl disable nginx 설치된 Nginx 버전 확인 $ sudo dpkg -l nginx 2. 방화벽 설정 방화벽 상태 체크 $ sudo ufw stat..