网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

centos7编译安装nginx的方法步骤

安装nginx编译所需的lib库

创新互联公司专注于沈阳网站建设服务及定制,我们拥有丰富的企业做网站经验。 热诚为您提供沈阳营销型网站建设,沈阳网站制作、沈阳网页设计、沈阳网站官网定制、小程序开发服务,打造沈阳网络公司原创品牌,更为您提供沈阳网站排名全网营销落地服务。

yum -y install make zlib zlib-devel gcc-c++ libtool openssl openssl-devel
yum -y install pcre pcre-devel

查看pcre(正则库)版本

pcre-config --version

进入编译目录

cd /usr/local/src

从官网下载最新的nginx(stable version稳定版)

wget http://nginx.org/download/nginx-1.14.0.tar.gz

解压nginx压缩包

tar -zxvf nginx-1.14.0.tar.gz

进入解压目录

cd nginx-1.14.0

运行配置脚本(--prefix参数指定nginx安装的目录,默认安装在/usr/local/nginx )

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

编译安装nginx

make && make install

将nginx执行命令软链接到/usr/bin

ln -s /usr/local/nginx/sbin/nginx /usr/bin

启动nginx

nginx

设置开机自启动

echo "/usr/local/nginx/sbin/nginx" >> /etc/rc.d/rc.local
chmod +x /etc/rc.d/rc.local

以上就是整个安装过程...

执行nginx -h查看相关命令

[root@localhost ~]# nginx -h
nginx version: nginx/1.14.0
Usage: nginx [-?hvVtTq] [-s signal] [-c filename] [-p prefix] [-g directives]

Options:
 -?,-h     : this help
 -v      : show version and exit
 -V      : show version and configure options then exit
 -t      : test configuration and exit
 -T      : test configuration, dump it and exit
 -q      : suppress non-error messages during configuration testing
 -s signal   : send signal to a master process: stop, quit, reopen, reload
 -p prefix   : set prefix path (default: /usr/local/nginx/)
 -c filename  : set configuration file (default: conf/nginx.conf)
 -g directives : set global directives out of configuration file

查看nginx安装目录

whereis nginx

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持创新互联。


网页名称:centos7编译安装nginx的方法步骤
网址分享:http://bjjierui.cn/article/gojcsi.html

其他资讯