//解壓文件 [root@i-vvwtw5ne ~]# tar -xzvf nginx-1.16.1.tar.gz //進入到解壓的文件中 [root@i-vvwtw5ne ~]# cd nginx-1.16.1
//這裏指定nginx的安裝目錄爲/opt/nginx,若是不報錯,說明編譯成功 [root@i-vvwtw5ne nginx-1.16.1]# ./configure --prefix=/opt/nginx // [root@i-vvwtw5ne nginx-1.16.1]# make [root@i-vvwtw5ne nginx-1.16.1]# make install
[root@i-vvwtw5ne nginx-1.16.1]# ll 總用量 780 drwxr-xr-x 6 1001 1001 4096 11月 2 23:40 auto -rw-r--r-- 1 1001 1001 296463 8月 13 20:51 CHANGES -rw-r--r-- 1 1001 1001 452171 8月 13 20:51 CHANGES.ru drwxr-xr-x 2 1001 1001 4096 11月 2 23:40 conf -rwxr-xr-x 1 1001 1001 2502 8月 13 20:51 configure drwxr-xr-x 4 1001 1001 4096 11月 2 23:40 contrib drwxr-xr-x 2 1001 1001 4096 11月 2 23:40 html -rw-r--r-- 1 1001 1001 1397 8月 13 20:51 LICENSE -rw-r--r-- 1 root root 376 11月 2 23:41 Makefile drwxr-xr-x 2 1001 1001 4096 11月 2 23:40 man drwxr-xr-x 3 root root 4096 11月 2 23:45 objs -rw-r--r-- 1 1001 1001 49 8月 13 20:51 README drwxr-xr-x 9 1001 1001 4096 11月 2 23:40 src
#nginx默認安裝在此目錄下 [root@i-vvwtw5ne nginx-1.16.1]# cd /usr/local/nginx/ #若是看到如下內容說明nginx安裝成功了 [root@i-vvwtw5ne nginx]# ll 總用量 36 drwx------ 2 nobody root 4096 7月 16 2018 client_body_temp drwxr-xr-x 2 root root 4096 7月 16 2018 conf drwx------ 2 nobody root 4096 7月 16 2018 fastcgi_temp drwxr-xr-x 2 root root 4096 7月 16 2018 html drwxr-xr-x 2 root root 4096 7月 16 2018 logs drwx------ 2 nobody root 4096 7月 16 2018 proxy_temp drwxr-xr-x 2 root root 4096 11月 2 23:46 sbin drwx------ 2 nobody root 4096 7月 16 2018 scgi_temp drwx------ 2 nobody root 4096 7月 16 2018 uwsgi_temp [root@i-vvwtw5ne objs]# cd /opt/nginx/sbin #啓動nginx [root@i-vvwtw5ne sbin]# ./nginx
打開瀏覽器訪問:http://127.0.0.1就能夠看到nginx的歡迎頁面,到此nginx的安裝就完成了html