1. 程式人生 > 資訊 >曝華為 P50/Pro 系列最終版確定,6 月 2 日揭曉鴻蒙手機發布時間

曝華為 P50/Pro 系列最終版確定,6 月 2 日揭曉鴻蒙手機發布時間

下載地址:http://nginx.org/en/download.html

1.YUM安裝
vim  /etc/yum.repos.d/nginx.repo
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true
安裝
yum install nginx -y
2.原始碼安裝
安裝依賴環境
[root@server ~]# yum -y install pcre-devel openssl openssl-devel gd-devel

[root@server ~]# yum -y groups install 'Development Tools'
建立日誌存放目錄
[root@server ~]# mkdir -p /var/log/nginx
[root@server ~]# chown -R nginx.nginx /var/log/nginx/
下載nginx
[root@server ~]# cd /usr/src/
[root@server src]# wget http://nginx.org/download/nginx-1.12.0.tar.gz
編譯安裝
[root@server ~]# cd /usr/src/
[root@server src]# tar xf nginx-1.12.0.tar.gz
[root@server src]# cd nginx-1.12.0
[root@server nginx-1.12.0]# ./configure \
--prefix=/usr/local/nginx \
--user=nginx \
--group=nginx \
--with-debug \
--with-http_ssl_module \
--with-http_realip_module \
--with-http_image_filter_module \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-http_stub_status_module \
--http-log-path=/var/log/nginx/access.log \
--error-log-path=/var/log/nginx/error.log

[root@server nginx-1.12.0]# make -j 2 && make install
3.nginx安裝後配置配置環境變數
[root@server nginx-1.12.0]# echo 'export PATH=/usr/local/nginx/sbin:$PATH' > /etc/profile.d/nginx.sh
[root@server nginx-1.12.0]#  . /etc/profile.d/nginx.sh

//注:

[root@nginx-server nginx-1.12.0]# echo $PATH
/usr/local/nginx/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
4.啟動nginx
[root@server ~]# nginx
[root@server ~]# ss -antl