linux下常用軟體安裝 nginx

2021-09-29 12:09:20 字數 1851 閱讀 4333

解壓編譯

安裝啟動

異常處理

再次啟動

驗證驗證埠是否開啟

開啟80埠

配置nginx開機自啟動

參考

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

yum -y intall wget

wget

tar -zxvf nginx-1.9.9.tar.gz
cd nginx-1.9.9

./configure --prefix=/usr/local/nginx

備註:不指定prefix,則可執行檔案預設放在/usr/local/bin,庫檔案預設放在/usr/local/lib,配置檔案預設放在/usr/local/etc。其他的資源檔案放在/usr/local/share。
make

make

install

cd /usr/loca/nginx/

./sbin/nginx -t

nginx: [alert] could not open error log file: open() "/usr/local/nginx/logs/error.log" failed (2: no such file or directory)

2016/09/13 19:08:56 [emerg] 6996#0: open() "/usr/local/nginx/logs/access.log" failed (2: no such file or directory)

原因分析:nginx/目錄下沒有logs資料夾

解決方法:

mkdir logs

chmod 700 logs

正常情況的資訊輸出:

nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok

nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful

cd /usr/local/nginx/sbin

./nginx

啟動nginx 在瀏覽器中輸入伺服器的ip位址,如:192.168.1.12

很不幸,打不開鏈結。下面進行原因排查:

備註:伺服器的80埠是打不開的。
firewall-cmd --query-port=80/tcp

顯然80埠沒有開啟。

firewall-cmd --add-port=80/tcp --permanent

#重啟防火牆

systemctl restart firewalld

備註: --permanent   #永久生效,沒有此引數重啟後失效
vim /etc/rc.d/rc.local

/usr/local/nginx/sbin/nginx

linux下安裝ngin

Linux下常用軟體

引導工具 unetbootin only linux syslinux all ultraiso all epel release wget rpm ivh rpmforge release 0.3.6 1.el5.rf.x86 64.rpm yum install ntfs 3g 更新軟體源 su...

Linux 安裝常用軟體

1 chromium browser sudo apt get install chromium browser 2 google chrome a sudo vi etc apt sources.list.d google.list b 輸入 deb stable main c sudo apt ...

Linux常用軟體安裝

wget no check certificate no cookies header cookie oraclelicense accept securebackup cookie mv jdk 8u172 linux x64 tar.gz usr local src 解壓 z 代表操作的是有 g...