nginx编译遇到的环境问题

安装nginx过程,遇到的问题


一、编译pcre时,报如下错误

PCRE libtool: unrecognized option `-DHAVE_CONFIG_H'


原因:缺少 gcc-c++

安装:yum install gcc-c++


二、环境缺少unzip命令

安装:yum install unzip


三、为nginx打补丁,报”patch : command not found“

安装:yum install patch


四、启动nginx时,报”/usr/local/nginx/sbin/nginx: error while loading shared libraries: libprofiler.so.0: cannot open shared object file: No such file or directory“


解决思路:

1、查找该文件



2、编辑 ”/etc/ld.so.conf“文件,将 ”/usr/local/lib/“目录,加入其中,执行ldconfig


五、启动nginx时,报”nginx: [emerg] could not build the types_hash, you should increase either types_hash_max_size: 1024 or types_hash_bucket_size: 32“错误


解决思路:

在nginx http部分增加

types_hash_max_size 2048;
server_names_hash_max_size 1024;


六、在使用nginx过程中,不太想使用swap交换空间

1、编辑 /etc/sysctl.conf,增加 vm.swappiness key条目,数值约低,使用swap交换空间的可能性越小

eg:

  vm.swappiness = 10


2、sysctl -p 使配置生效


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值