[Linux] 웹서버 설치; nginx

슬터디·2023년 11월 29일
0

[YOU] 기술분석

목록 보기
7/24

Nginx 서비스 구동

nginx 패키지 설치

  • dnf install nginx -y

설정파일 확인

  • cd /etc/nginx

    • 설정파일 위치; nginx.conf
  • tree

    • 디렉토리와 파일을 트리 형식으로 확인 가능

nginx 서비스 구동

  • systemctl start nginx; systemctl enable nginx
  • systemctl status nginx

  • ss -pltn
    • ss(socket statistics)
    • 네트워크 상태 확인
    • 옵션
      • p: 프로세스명
      • l: LISTEN 상태 포트 확인
      • t: TCP 포트 확인
      • n(numeric): 호스트 / 포트/ 사용자 이름을 숫자로 표시


-> HTTP 기본 포트인 80으로 웹 서비스를 LISTEN 중인 것 확인
-'http://[ip]' 접속 시 화면 보임

index.html

시작 default 페이지 파일 위치

  • /usr/share/nginx/html/index.html

  • mv index.html index.html.backup: remove

  • vim /usr/share/nginx/html/index.html

profile
기억력이 맹구라 늘 기록해야해

0개의 댓글