# 客戶端修改網站根目錄為/web
~ mount -t nfs 192.168.16.180:/Nfsdir /web // vim /etc/fstab 開機就掛載的設備
~ vim /etc/nginx/nginx.conf
~ systemctl reload nginx //重新加載配置文件
~ vim /etc/selinux/config //關閉硬件防火墻 改為disabled 需要重啟
#setenforce 0 臨時關閉防火墻,不需要重啟
vim /etc/fstab
# /etc/fstab
# Created by anaconda on Wed Mar 8 22:54:46 2017
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/cl-root / xfs defaults 0 0
UUID=4b0a06e7-efa0-464e-b668-8d02da33c482 /boot xfs defaults 0 0
/dev/mapper/cl-swap swap swap defaults 0 0
#把共享nfs目錄開機掛載,公司環境會用到
192.168.16.180:/Nfsdir /web nfs defaults 0 0
源碼安裝nginx,并按照作業一描述的那樣去測試使用
下載nginx
~ wget http://nginx.org/download/nginx-1.10.3.tar.gz
~ tar xvf nginx-1.10.3.tar.gz && cd nginx-1.10.3
安裝nginx
~ ./configure --prefix=/usr/local/nginx
#出現問題
./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.
安裝yum -y install pcre-devel 解決問題
~ yum -y install pcre-devel
~ ./configure //成功編譯
~ make && make install
~ vim /etc/nginx/nginx.conf /修改配置文件
~ systemctl start nginx