Linux下Nginx安装
2017-06-06 09:52
375 查看
0 下载地址
1 安装过程
2 安装中存在的问题
问题1 ./configure: error: the HTTP rewrite module requires the PCRE library.
问题2 ./configure: error: the HTTP gzip module requires the zlib library.
问题3 启动后无法访问,但是进程存在,且没有错误日志
问题4 启动报错
3 常用命令
3.1 启动
3.2 重启
3.3 关闭
3.4 检测配置文件是否正确
参考
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.
解决:
option, or install the zlib library into the system, or build the zlib library
statically from the source with nginx by using –with-zlib= option.
解决:
解决:
Nginx: error while loading shared libraries: libpcre.so.1解决
启动nginx,报错:error while loading shared libraries: libpcre.so.1:
1 安装过程
2 安装中存在的问题
问题1 ./configure: error: the HTTP rewrite module requires the PCRE library.
问题2 ./configure: error: the HTTP gzip module requires the zlib library.
问题3 启动后无法访问,但是进程存在,且没有错误日志
问题4 启动报错
3 常用命令
3.1 启动
3.2 重启
3.3 关闭
3.4 检测配置文件是否正确
参考
0 下载地址
下载地址1 安装过程
# 1.解压 tar -zxvf nginx-1.9.13.tar.gz # 2.切换到解压后的目录 cd nginx-1.9.13 # 3.创建组和用户 groupadd -f www useradd -g www www # 4.配置(包含HTTP SSL模块) ./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_stub_status_module --with-http_ssl_module # 5.编译 make # 6.安装 make install
2 安装中存在的问题
问题1 ./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 library
statically from the source with nginx by using –with-pcre= option.
解决:
yum -y install pcre-devel
问题2 ./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 library
statically from the source with nginx by using –with-zlib= option.
解决:
yum -y install openssl openssl-devel
问题3 启动后无法访问,但是进程存在,且没有错误日志
解决:# 关闭防火墙 systemctl stop firewalld.service
问题4 启动报错
./nginx: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory解决:
# 查找libpcre.so.1 find / -iname "libpcre.so.1" # 结果 # /software/apache/pcre-8.34/.libs/libpcre.so.1 # /usr/local/lib/libpcre.so.1 # /usr/local/pcre-8.34/lib/libpcre.so.1 # 原因: # 1.没装PCRE # 2.PCRE包路径不在LD_LIBRARY_PATH下 # 方法1:设置LD_LIBRARY_PATH中包含pcre包的路径 # 这种方式使用export命令,所以只在本次登录生效 export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH # 方法2:nginx默认会从/lib64或/lib下读取libpcre.so.1文件,所以设置软链接即可 ln -s /usr/local/lib/libpcre.so.1 /lib64/
3 常用命令
3.1 启动
cd /usr/local/nginx/sbin ./nginx
3.2 重启
/usr/local/nginx/sbin/nginx -s reload
3.3 关闭
#方法1:第一个是完整有序的停止,第二个是快速停止 /usr/local/nginx/sbin/nginx -s quit /usr/local/nginx/sbin/nginx -s stop #方法2: pkill -9 nginx
3.4 检测配置文件是否正确
/usr/nginx/sbin/nginx -t
参考
linux下安装nginxNginx: error while loading shared libraries: libpcre.so.1解决
启动nginx,报错:error while loading shared libraries: libpcre.so.1:
相关文章推荐
- Linux下nginx的安装
- linux 下nginx安装与配置
- Linux下的Nginx安装(开机自启动)
- LNMP一键安装Linux系统下Nginx+MySQL+PHP这种网站服务器架构
- 【Linux】Nginx安装、部署--CentOS5.4
- LNMP-Linux下Nginx+PHP+MySQL+phpMyAdmin+eAcelerator一键安装包
- LNMP-Linux下Nginx+MySQL+PHP+phpMyAdmin+eAcelerator一键安装包(2011年2月8日更新)
- nginx-linux安装说明
- linux 下 Nginx 0.8.40的安装
- Linux 编译安装Nginx 配置 Python FastCGI Django (3) 配置nginx和django
- linux 下 nginx 安装 配置
- LNMP一键安装包 0.5 正式发布(Linux+Nginx+Mysql+PHP)
- Linux 编译安装Nginx 配置 Python FastCGI Django (1) 编译安装nginx
- LNMP-Linux下Nginx+MySQL+PHP+phpMyAdmin+eAcelerator一键安装包(2009年11月17日更新)
- Linux环境下nginx的安装
- Linux下nginx的安装问题
- linux 下安装nginx经常出现 make[2]: Leaving directory `/usr/local/ssl' 或make[2]: Leaving directory `/usr/local/openssl' 找不到的情况解决方法
- nginx 0.6.3 安装与配置(linux,nginx,php-cgi)
- Linux下怎么确定Nginx安装目录
- linux下怎么安装nginx