1. 폴더 소유권의 변경 :chown
| sudo chown koreast:koreast . | . 폴더 소유권만 변경 가능 |
| sudo chown koreast:koreast * | 현재 폴더에 있는 것만 변경 가능 |
| sudo chown koreast:koreast -R . | 하위 디렉토리까지 모두 포함하여 소유권 변경 |
2. 설정파일 위치
* 현재 80 => / usr/share/nginx/html
1) sudo locate nginx.conf
2) sudo vim 상기경로
- 해당 열어보면, include ~~/*.conf 파일 경로 확인
3) cd etc/nginx/conf.d/ 로 이동
- ls를 통하여 default.conf 확인
4) sudo vim default.conf
- locate 경로를 : web/site0/public; 으로 수정
5) sudo systemctl restart nginx
6) cd /로 돌아와서 해당 파일 생성
7) sudo mkdir -p /web/site0/public
8) cd /web
ls -alh 로 해당 소유권이 root계정에 있는 것을 확인
9) sudo chown koreast:koreast -R .로 koreast로 소유권 변경
10) cd site0 (ls -alh)
cd public
11) vim a.html로 aaa 끼워넣기
- 여기서 sudo를 안쓰는 이유는, 9)에 소유권을 koreast로 변경했기 때문임.
12) 파일명 변경 (mv)
mv a.html index.html
=> 127.0.0.1:8011.index.html으로 접속 가능 확인
'리눅스' 카테고리의 다른 글
| [리눅스] virtual hosting 24.02.25 (1) | 2024.02.25 |
|---|---|
| [리눅스] nginx 파일 수정 (0) | 2024.02.24 |
| [리눅스] nginx index.html 파일 찾고 수정하기 (1) | 2024.02.24 |
| [리눅스] nginx 외부접속_24.02.24 (1) | 2024.02.24 |
| [리눅스] nginx 최신 버전 설치 24.02.18 (2) | 2024.02.24 |