centos7 64位使用心得
2017-03-03 14:07
246 查看
版权声明:本文为博主原创文章,未经博主允许不得转载。
系统:Centos7 64位
Nginx: http://nginx.org/en/download.html 我下载1.10.3
下载模块依赖性Nginx需要依赖下面3个包
1.gzip 模块需要 zlib 库 ( 下载: http://www.zlib href="http://lib.csdn.net/base/dotnet" target=_blank>.NET/ )
2.rewrite 模块需要 pcre 库 ( 下载: http://www.pcre.org/ )
3.ssl 功能需要 openssl 库 ( 下载: http://www.openssl.org/ )
依赖包安装顺序依次为:openssl、zlib、pcre, 然后安装Nginx包
如果没有安装c++编译环境,还得安装,通过yum install gcc-c++完成安装
下载完成后:
下一步,编译安装
openssl :
[root@localhost] tar zxvf openssl-fips-2.0.9.tar.gz
[root@localhost] cd openssl-fips-2.0.9
[root@localhost] ./config && make && make install
pcre:
[root@localhost] tar zxvf pcre-8.36.tar.gz
[root@localhost] cd pcre-8.36
[root@localhost] ./configure && make && make install
zlib:
[root@localhost]tar zxvf zlib-1.2.8.tar.gz
[root@localhost] cd zlib-1.2.8
[root@localhost] ./configure && make && make install
最后安装nginx
[root@localhost]tar zxvf nginx-1.8.0.tar.gz
[root@localhost] cd nginx-1.8.0
[root@localhost] ./configure && make && make install
安装完成后,可启动nginx:
启动命令:/usr/local/nginx/sbin/nginx
发现报错了:
error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory
经网上查询,这是Linux的通病
[root@localhost nginx]# sbin/nginx
sbin/nginx: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory
[root@localhost nginx]# error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory
[root@localhost nginx]# whereis libpcre.so.1
libpcre.so: /lib64/libpcre.so.0 /usr/local/lib/libpcre.so /usr/local/lib/libpcre.so.1
[root@localhost nginx]# ln -s /usr/local/lib/libpcre.so.1 /lib64
[root@localhost nginx]# sbin/nginx
先找到libpcre.so.1所在位置,然后做个软链接就可以了。
查看是否已启动:
通过浏览器访问:
看到这个就说明nginx安装并启动成功。
ps:
启动:/usr/local/nginx/sbin/nginx
停止/重新加载:/usr/local/nginx/sbin/nginx -s stop(quit、reload)
验证配置文件是否合法:/usr/local/nginx/sbin/nginx -t
命令帮助:/usr/local/nginx/sbin/nginx -h
如果中途安装失败,就把 lib lib64 nginx 目录下所有文件删除重新安装
系统:Centos7 64位
Nginx: http://nginx.org/en/download.html 我下载1.10.3
下载模块依赖性Nginx需要依赖下面3个包
1.gzip 模块需要 zlib 库 ( 下载: http://www.zlib href="http://lib.csdn.net/base/dotnet" target=_blank>.NET/ )
2.rewrite 模块需要 pcre 库 ( 下载: http://www.pcre.org/ )
3.ssl 功能需要 openssl 库 ( 下载: http://www.openssl.org/ )
依赖包安装顺序依次为:openssl、zlib、pcre, 然后安装Nginx包
如果没有安装c++编译环境,还得安装,通过yum install gcc-c++完成安装
下载完成后:
下一步,编译安装
openssl :
[root@localhost] tar zxvf openssl-fips-2.0.9.tar.gz
[root@localhost] cd openssl-fips-2.0.9
[root@localhost] ./config && make && make install
pcre:
[root@localhost] tar zxvf pcre-8.36.tar.gz
[root@localhost] cd pcre-8.36
[root@localhost] ./configure && make && make install
zlib:
[root@localhost]tar zxvf zlib-1.2.8.tar.gz
[root@localhost] cd zlib-1.2.8
[root@localhost] ./configure && make && make install
最后安装nginx
[root@localhost]tar zxvf nginx-1.8.0.tar.gz
[root@localhost] cd nginx-1.8.0
[root@localhost] ./configure && make && make install
安装完成后,可启动nginx:
启动命令:/usr/local/nginx/sbin/nginx
发现报错了:
error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory
经网上查询,这是Linux的通病
[root@localhost nginx]# sbin/nginx
sbin/nginx: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory
[root@localhost nginx]# error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory
[root@localhost nginx]# whereis libpcre.so.1
libpcre.so: /lib64/libpcre.so.0 /usr/local/lib/libpcre.so /usr/local/lib/libpcre.so.1
[root@localhost nginx]# ln -s /usr/local/lib/libpcre.so.1 /lib64
[root@localhost nginx]# sbin/nginx
先找到libpcre.so.1所在位置,然后做个软链接就可以了。
查看是否已启动:
通过浏览器访问:
看到这个就说明nginx安装并启动成功。
ps:
启动:/usr/local/nginx/sbin/nginx
停止/重新加载:/usr/local/nginx/sbin/nginx -s stop(quit、reload)
验证配置文件是否合法:/usr/local/nginx/sbin/nginx -t
命令帮助:/usr/local/nginx/sbin/nginx -h
如果中途安装失败,就把 lib lib64 nginx 目录下所有文件删除重新安装
相关文章推荐
- 使用VirtalBox在CentOS7(64位最小化安装)中通过源码安装MySQL5.7.18
- ab和jmeter进行GET/POST压力测试的使用心得和比较(转载,在ubuntu16.04下使用ab带json对centos7压力测试验证可用)
- pmd CamBoard PICO flexx 相机使用心得-64位win7,VS2013开发
- 64位机器使用java开发串口程序心得
- CentOS7 yum 命令使用心得-代理上网,从光盘安装软件
- Google Closure Complier使用心得与文档
- 使用VS在64位平台下编译代码,生成64位dll
- CentOS7 防火墙命令使用
- ajaxpro 的使用心得
- DevExpress TreeList使用心得
- Hudson使用心得
- Ubuntu 64位 WPS使用
- .9png 个人使用心得
- 几种优化工具(linprog,lpsolve,yamlip,gurobi)使用心得
- Hint 使用心得
- static控件说明(使用心得)
- 【原】使用Bmob作为iOS后台开发心得——查询关联关系(BmobRelation)
- win7+64位+Oracle+11g+64位下使用PLSQL+Developer+的解决办法
- webview使用心得