linux環境下nginx安裝

2021-09-27 10:01:45 字數 2486 閱讀 5617

[root@localhost ~]

# wget

2.nginx會有幾個依賴包,我們首先安裝依賴,不要安裝過程中會報錯

[root@localhost ~]

# yum -y install zlib-devel pcre-devel openssl-devel

3.解壓壓縮包

[root@localhost ~]

# ls

anaconda-ks.cfg mysql-5.7.21-linux-glibc2.12-x86_64 mysql-5.7.21-linux-glibc2.12-x86_64.tar.gz nginx nginx-1.14.2.tar.gz yl_wechat_dev_0917.sql

[root@localhost ~]

# tar -zxvf nginx-1.14.2.tar.gz

4.進入安裝包目錄

檢查安裝

[root@localhost nginx-1.14.2]

# ./configure --prefix=/usr/local/nginx --with-openssl=/usr/include/openssl --with-pcre --with-http_ssl_module --with-http_gzip_static_module

或者

[root@localhost nginx-1.14.2]

# ./configure --prefix=/usr/local/nginx --with-pcre --with-http_ssl_module --with-http_gzip_static_module

5.如果檢查條件中依賴包沒有安裝,安裝依賴包之後則需要執行

[root@localhost nginx-1.14.2]

# rm -rf makefile

6.檢查安裝條件正常之後執行

[root@localhost nginx-1.14.2]

# make

[root@localhost nginx-1.14.2]

# make install

7.安裝成功之後啟動

[root@localhost nginx-1.14.2]

# /usr/local/nginx/sbin/nginx

8.檢視是否啟動成功

[root@localhost nginx-1.14.2]

# ps -ef|grep nginx

root 3264 3249 0 sep24 ? 00:00:00 nginx: master process nginx -g daemon off;

101 3292 3264 0 sep24 ? 00:00:00 nginx: worker process

root 3346 3332 0 sep24 ? 00:00:00 nginx: master process nginx -g daemon off;

101 3373 3346 0 sep24 ? 00:00:00 nginx: worker process

root 57440 57424 0 00:03 ? 00:00:00 nginx: master process nginx -g daemon off;

101 57468 57440 0 00:03 ? 00:00:00 nginx: worker process

root 57700 57686 0 00:04 ? 00:00:00 nginx: master process nginx -g daemon off;

101 57724 57700 0 00:04 ? 00:00:00 nginx: worker process

root 73218 1 0 04:27 ? 00:00:00 nginx: master process

/usr/local/nginx/sbin/nginx

nobody 73219 73218 0 04:27 ? 00:00:00 nginx: worker process

root 73251 1982 0 04:28 pts/0 00:00:00 grep --color=auto nginx

linux環境下安裝nginx

目的 安裝nginx 環境 ubuntu server 14.03 效果 安裝 g apt get install g 我把檔案放在我自己的目錄裡 usr share myserver tools 進入該目錄 cd usr share myserver tools解壓 tar xzvf pcre 8...

Linux環境下安裝Nginx

nginx的安裝 1.安裝環境的準備 nginx是c語言開發,建議在linux上執行,這裡使用centos6.4作為安裝環境。gccpcre pcre perlcompatible regular expressions 是乙個perl庫,包括 perl 相容的正規表示式庫。nginx的http模組...

linux環境下安裝nginx

本教程安裝環境 vmware12 cent os 6.5 nginx執行需要依賴一些庫,所以要先安裝庫。gcc pcre pcre perl compatible regular expressions 是乙個perl庫,包括 perl 相容的正規表示式庫。nginx的http模組使用pcre來解析...