Linux-rhel6.4部署nginx
admin
2023-03-23 08:00:48
0

检查安装

[root@kurolz ~]# rpm -qa pcre*
pcre-devel-7.8-6.el6.x86_64
pcre-7.8-6.el6.x86_64
[root@kurolz ~]# rpm -qa openssl*
openssl-1.0.0-27.el6.x86_64

安装nginx

包下载地址:http://nginx.org/en/download.html

[root@kurolz ~]# tar -zxvf nginx-1.10.3.tar.gz
[root@kurolz ~]# cd ngunx-1.10.3
[root@kurolz ~]# ./configure
./configure:  error: the HTTP rewrite module requires the PCRE library.

报错,原因:没有安装pcre-devel


解决,挂载系统盘,找到rpm包安装:

[root@kurolz Packages]# ls pcre*
pcre-7.8-6.el6.i686.rpm  pcre-7.8-6.el6.x86_64.rpm  pcre-devel-7.8-6.el6.i686.rpm  pcre-devel-7.8-6.el6.x86_64.rpm
[root@kurolz Packages]# rpm -ivh pcre-devel-7.8-6.el6.x86_64.rpm 
warning: pcre-devel-7.8-6.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing...                ########################################### [100%]
   1:pcre-devel             ########################################### [100%]


重新安装成功:

[root@kurolz nginx-1.10.3]# ./configure 
checking for OS
 + Linux 2.6.32-358.el6.x86_64 x86_64
checking for C compiler ... found
 + using GNU C compiler
 + gcc version: 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC) 
checking for gcc -pipe switch ... found
......
  nginx http client request body temporary files: "client_body_temp"
  nginx http proxy temporary files: "proxy_temp"
  nginx http fastcgi temporary files: "fastcgi_temp"
  nginx http uwsgi temporary files: "uwsgi_temp"
  nginx http scgi temporary files: "scgi_temp"
[root@kurolz nginx-1.10.3]# make
[root@kurolz nginx-1.10.3]# make install


主页测试:

[root@kurolz ~]# cd /usr/local/nginx/html
[root@kurolz html]# cat index.html



Welcome to nginx!



Welcome to nginx!

If you see this page, the nginx web server is successfully installed and working. Further configuration is required.

For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.

Thank you for using nginx.


出错,没有开启服务:

[root@kurolz html]# curl http://localhost
curl: (7) couldn't connect to host


开启服务测试成功:

[root@kurolz ~]# cd /usr/local/nginx/sbin
[root@kurolz sbin]# curl http://localhost



Welcome to nginx!



Welcome to nginx!

If you see this page, the nginx web server is successfully installed and working. Further configuration is required.

For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.

Thank you for using nginx.

上一篇:web反馈错误代码

下一篇:高可用PXC

相关内容

热门资讯

“华盛顿”号航母驶离日本横须贺... △“乔治·华盛顿”号核动力航空母舰(资料图)当地时间10日上午,美国“乔治·华盛顿”号核动力航母完成...
司机因操作不当引发车祸致2死6... 极目新闻记者 谢茂5月10日13时40分许,重庆黔江区一处十字路口发生一起交通事故。据重庆市公安局黔...
中国公民涉嫌非法持有武器,驻泰... 问:泰国警方日前表示,一中国在泰公民涉嫌非法持有武器,泰警方已开展调查。请问中国驻泰国使馆对此有何评...
榴莲商家千里维权,“仅退款”不... 近日,一则“河南商家驱车1600公里赴山东寻找‘仅退款’买家”的消息,引发社会关注。买家被行政拘留5...
原创 魏... 懦夫一生数死,丈夫只死一遭。莎士比亚的这句名言犹如利刃,直刺人心。他用极为尖锐的语言提醒我们:真正的...
三星的撤退与进击 文 | 华商韬略 苏州工业园。 这片土地,承载着三星在中国制造业版图中最具象征意义的记忆。 三十多...
利好!AI、算力,大消息! 重点关注 近日,国家发展改革委主任郑栅洁赴上海人工智能实验室,专题调研人工智能发展情况。 国家网信办...
原创 这... 在繁忙的都市生活中,我们常常被压力和疲惫所困扰。然而,有一种植物,它以其古朴、典雅的姿态,静静地绽放...
两台Figure AI人形机器... IT之家 5 月 9 日消息,当地时间 5 月 8 日,Figure AI 公布了一段视频:两台人形...
首款,成功研制!我国“太极计划... 记者5月9日从中国科学院力学研究所获悉,我国空间引力波探测“太极计划”核心测量系统研制工作取得重要进...