linux環境下安裝nginx步驟

2021-09-23 13:20:59 字數 2238 閱讀 9893

參考

yum install gcc gcc-c++
yum -y install gcc automake autoconf libtool make
cd /usr/local/src

wget

tar -zxvf pcre-8.37.tar.gz

cd pcre-8.34

./configure

make

make install

cd /usr/local/src

wget

tar -zxvf zlib-1.2.11.tar.gz

cd zlib-1.2.11

./configure

make

make install

cd /usr/local/src

wget

tar -zxvf openssl-1.0.1t.tar.gz

cd openssl-1.0.1t

./config

make

make install

cd /usr/local/src

wget

tar -zxvf nginx-1.1.10.tar.gz

cd nginx-1.1.10

./configure

make

make install

nginx解壓路徑下的conf檔案,/usr/local/nginx/conf/nginx.conf

(1)修改網域名稱為 hello.yanan.com

(2)配置tomcatip埠 10.10.10.10:8080

(3)配置訪問路徑為 網域名稱加字尾 /index.jsp

在hosts檔案(c:\windows\system32\drivers\etc\hostsni)中配置ip、網域名稱

10.10.10.10 hello.yanan.com
nginx啟動服務

[root@test ~]# cd /usr/local/nginx/sbin

[root@test sbin]# /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

nginx服務啟動報錯解決方法

[root@test ~]# ps -axu | grep nginx

warning: bad syntax, perhaps a bogus '-'? see /usr/share/doc/procps-3.2.8/faq

root 4675 0.0 0.0 103308 828 pts/0 r+ 13:20 0:00 grep nginx

root 25476 0.0 0.0 19732 612 ? ss aug04 0:00 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

nobody 24784 0.0 0.0 20148 1676 ? s aug04 0:05 nginx: worker process

[root@test ~]# kill -term 25476

[root@test  ~]# kill -9 25476
[root@test ~]# cd /usr/local/nginx/sbin

[root@test sbin]#./nginx -s reload

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來解析...