본문 바로가기

운영체제

[centOS7] Nginx 설치

728x90

# wget http://nginx.org/download/nginx-1.6.2.tar.gz

# tar zvxf nginx-1.6.2.tar.gz

# cd nginx-1.6.2

 

configure : 현재 OS의 종류나 컴파일러 위치, 종류 등을 파악하고, 사용자가 컴파일이 완료된 프로그램의 위치를 지정하거나, 기타 등등 환경을 맞춰서 자신이 원하는 makefile을 만들어내는 과정

make : configure에 의해서 만들어진 makefile로 프로그램을 컴파일 하는 과정

make install : 컴파일된 프로그램, 환경화일, 데이터 화일을 지정된 위치에 복사하는 과정

 

# ./configure

./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.

 

# yum -y install pcre*

# ./configure

./configure: error: the HTTP gzip module requires the zlib library.
You can either disable the module by using --without-http_gzip_module
option, or install the zlib library into the system, or build the zlib library
statically from the source with nginx by using --with-zlib=<path> option.

 

# yum -y install zlib*

# ./configure  //오류 안뜸 

# make

# make install

 

configure의 결과 : 기본값으로 설정된 여러 파일들의 경로 

 

# /usr/local/nginx/sbin/nginx

# ps -ef | grep nginx
root       7944      1  0 01:31 ?        00:00:00 nginx: master process /usr/local/nginx/sbin/nginx
nobody     7946   7944  0 01:31 ?        00:00:00 nginx: worker process
root       7953   2273  0 01:32 pts/0    00:00:00 grep --color=auto nginx

 

 

ifconfig로 IP 주소 확인 

 

호스트에서 접속

 

 

# vi /usr/local/nginx/conf/nginx.conf

80번 포트를 8080번 포트로 변경

 

 

# /usr/local/nginx/sbin/nginx  //파일 실행 

 

 

8080번 포트로 접속

 

 

 

728x90

'운영체제' 카테고리의 다른 글

리눅스 tftp 서버 구축  (0) 2021.07.11
ssl  (0) 2021.07.09
vyos로 Router 구축하기  (0) 2021.07.08
Linux 명령어 su와 sudo  (0) 2021.07.08
SAMBA server 설정과 network drive  (0) 2021.07.08