centos7怎么安装nginx
答案:2 悬赏:60
解决时间 2021-01-10 14:50
- 提问者网友:姑娘长的好罪过
- 2021-01-10 11:28
centos7怎么安装nginx
最佳答案
- 二级知识专家网友:长青诗
- 2021-01-10 13:06
安装环境为:最小化安装的centos7,关闭seliunx。
最小化安装centos:
关闭selinux
sed –i ‘s/SELINUX=enforcing/SELINUX=disabled/g’ /etc/selinux/config
开始安装nginx1.7.8
创建群组
groupadd www
创建一个用户,不允许登陆和不创主目录
useradd -s /sbin/nologin -g www -M www
#下载最新版nginx
wget -C
tar zxvf nginx-1.7.8.tar.gz
#编译基本能运行的nginx
./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module
make
make install
如果有错误提示:
./configure: error: C compiler cc is not found
解决方法:
yum install gcc gcc-c++
如果有错误提示:
./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= option.
解决方法:
yum install pcre-devel
如果有错误提示:
./configure: error: SSL modules require the OpenSSL library.
最小化安装centos:
关闭selinux
sed –i ‘s/SELINUX=enforcing/SELINUX=disabled/g’ /etc/selinux/config
开始安装nginx1.7.8
创建群组
groupadd www
创建一个用户,不允许登陆和不创主目录
useradd -s /sbin/nologin -g www -M www
#下载最新版nginx
wget -C
tar zxvf nginx-1.7.8.tar.gz
#编译基本能运行的nginx
./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module
make
make install
如果有错误提示:
./configure: error: C compiler cc is not found
解决方法:
yum install gcc gcc-c++
如果有错误提示:
./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=
解决方法:
yum install pcre-devel
如果有错误提示:
./configure: error: SSL modules require the OpenSSL library.
全部回答
- 1楼网友:像个废品
- 2021-01-10 14:09
谜底是刨笔机
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯