国产系统安装nginx

安装nginx

sudo -i 进入root用户

使用cd命令 进入nginx文件夹

执行

./configure

若出现 

./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_moduleoption, 
or install the PCRE library into the system, 
or build the PCRE librarystatically from the source with nginx by using --with-pcre=<path> option.

则需要安装,若系统是Ubuntu /Debian则执行这个命令

sudo apt-get install ibpcre3 ibpcre3-dev

 若系统是CentOS / RedHat则执行这个命令

sudo yum install pcre pcre-devel

若yum没有的话则需要运行命令安装yum

sudo apt-get install yum

 若出现无法定位软件包yum则需要安装yum

在执行这个yum的命令时出现 没有可用的仓库这种意思的话语时,则需要运行Ubuntu /Debian的命令

执行上面的命令后再次执行 ./configure

若出现

./configure: error: the HTTP gzip module requires the zlib library.
You can either disable the module by using --without-http gzip moduleoption, 
or install the zlib library into the system,
 or build the zlib librarystatically from the source with nginx by using --with-zlib=epath> option.

则需要安装,若系统是Ubuntu /Debian则执行这个命令

sudo apt-get install zliblg-dev

 若系统是CentOS / RedHat则执行这个命令

sudo yum install zlib-devel

安装之后再次执行  ./configure

然后再运行

make  //安装

 安装之后返回到根目录,然后运行 whereis nginx 就知道nginx的启动项在哪

安装yum 

 需要去源里面添加

vim /etc/apt/sources.list

//添加这个
deb http://archive.ubuntu.com/ubuntu/ trusty main universe restricted multiverse

//然后运行
sudo apt-get update

在运行上面最后一个出现 

W:GPG 错误:http://archive.ubuntu.com/ubuntu trsty Release: 由于没有公钥,无法验证下列签名: NO PUBKEY 40976EAF437D05B5 NO PUBKEY 3B4FE6ACCOB21F32
W:仓库“http://archive.ubuntu.com/ubuntu trusty Release”没有数字签名。

则 运行

 // 3B4FE6ACCOB21F32就是上面所说的缺失的密钥
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACCOB21F32

上面的执行完后在执行 

sudo apt-get update

//成功之后在运行
sudo apt-get install yum

 查看该文件中的原是否有配置,若有配置则取消注释,若无配置则

vim /etc/apt/sources.list

  • 7
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值