CentOS 7 安装并启动Nginx
生活随笔
收集整理的這篇文章主要介紹了
CentOS 7 安装并启动Nginx
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
一、安裝必要的庫
1、安裝gcc gcc-c ++
yum install -y gcc gcc-c ++2、gzip模塊需要 zlib 庫
cd /usr/local wget http://zlib.net/zlib-1.2.11.tar.gz tar -zxvf zlib-1.2.11.tar.gz cd zlib-1.2.11 ./config make && make install3、重寫模塊需要pcre庫
cd /usr/local wget http://jaist.dl.sourceforge.net/project/pcre/pcre/8.33/pcre-8.33.tar.gz tar -zxvf pcre-8.33.tar.gz cd pcre-8.33 ./configure make && make install4、ssl功能需要openssl庫
cd /usr/local wget http://www.openssl.org/source/openssl-1.0.1j.tar.gz tar -zxvf openssl-1.0.1j.tar.gz cd openssl-1.0.1j ./configure make && make install二、安裝nginx
cd /usr/local wget http://nginx.org/download/nginx-1.14.0.tar.gz tar -zxvf nginx-1.14.0.tar.gz cd nginx-1.14.0 ./configure --user=nobody --group=nobody --prefix=/usr/localinx --with-http_stub_status_module --with-http_gzip_static_module --with-http_realip_module --with-http_sub_module --with-http_ssl_module --with-pcre=/usr/local/pcre-8.33 --with-zlib=/usr/local/zlib-1.2.11 --with-openssl=/usr/local/openssl-1.0.1j make && make install三、啟動
cd /usr/local/nginx ./sbin/nginx四、瀏覽器訪問IP地址,出現Welcome to nginx!
總結
以上是生活随笔為你收集整理的CentOS 7 安装并启动Nginx的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 数据库基础知识——MySQL服务的启动和
- 下一篇: nginx动静分离配置_Nginx 动静