Centos 7 설치 nginx (소스 코드)
                                            
 11382 단어  python 전체 스 택
                    
첫걸음
wget http://nginx.org/download/nginx-1.16.0.tar.gz
tar -zxvf nginx-1.16.0.tar.gz 
설치 하 다.
./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.
  pcre-devel
yum -y install pcre-devel
  zlib-devel
yum install -y zlib-devel
conf:  nginx       ,  nginx.conf nginx               ,   .conf      nginx      ,  fastcgi      fastcgi.conf fastcgi_params    ,               ,    .default  ,            default    。
html      nginx    web  ,             web  ,      50x web              。
logs:    nginx               ,logs          ,  /var/logs/nginx  。
sbin:  nginx       ,                 。
역할.
nginx
시작 서비스
nginx -s reload
서 비 스 를 멈 추 지 않 고 프로필 을 다시 읽 습 니 다.
nginx -s stop
서비스 정지
시동 을 걸다
- 아래 명령 으로 nginx 가 설치 한 경 로 를 봅 니 다.
whereis ngnix
[root@iZ2ze5lq5zpd6lctghc8x3Z /]# cd /usr/local/nginx/
[root@iZ2ze5lq5zpd6lctghc8x3Z nginx]# ll
total 36
drwx------ 2 nobody root 4096 Jul 11 17:01 client_body_temp
drwxr-xr-x 2 root   root 4096 Jul 11 16:59 conf
drwx------ 2 nobody root 4096 Jul 11 17:01 fastcgi_temp
drwxr-xr-x 2 root   root 4096 Jul 11 16:59 html
drwxr-xr-x 2 root   root 4096 Jul 11 17:01 logs
drwx------ 2 nobody root 4096 Jul 11 17:01 proxy_temp
drwxr-xr-x 2 root   root 4096 Jul 11 16:59 sbin
drwx------ 2 nobody root 4096 Jul 11 17:01 scgi_temp
drwx------ 2 nobody root 4096 Jul 11 17:01 uwsgi_temp
[root@iZ2ze5lq5zpd6lctghc8x3Z nginx]# cd sbin/
[root@iZ2ze5lq5zpd6lctghc8x3Z sbin]# ll
total 3736
-rwxr-xr-x 1 root root 3825176 Jul 11 16:59 nginx
[root@iZ2ze5lq5zpd6lctghc8x3Z sbin]# ./nginx 
[root@iZ2ze5lq5zpd6lctghc8x3Z sbin]# ps -ef | grep nginx
root      4233  4187  0 15:31 ?        00:00:00 nginx: master process /usr/sbin/nginx -g daemon off; error_log /dev/stderr info;
100       4234  4233  0 15:31 ?        00:00:00 nginx: worker process
root      7476     1  0 17:01 ?        00:00:00 nginx: master process ./nginx
nobody    7477  7476  0 17:01 ?        00:00:00 nginx: worker process
root      7485  3252  0 17:01 pts/1    00:00:00 grep --color=auto nginx
성공 여부 검증
127.0.0.1   localhost   IP