Linux-rhel6.4部署nginx

检查安装

 
 
1
2
3
4
5
[ 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

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

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


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

 
 
1
2
3
4
5
6
7
[ 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 
warningpcre - devel - 7.8 - 6. el6. x86_64. rpmHeader  V3  RSA / SHA256  Signaturekey  ID  fd431d51NOKEY
Preparing...                 ########################################### [100%]
    1: pcre - devel              ########################################### [100%]


重新安装成功:

 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
[ 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  version4.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


主页测试:

 
 
1
2
[ root@ kurolz  ~ ]cd  / usr / local / nginx / html
[ root@ kurolz  html ]cat  index. html
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Welcome  to  nginx!
     body  {
         width35 em;
         margin0  auto;
         font - familyTahomaVerdanaArialsans - serif;
     }
Welcome  to  nginx!
If  you  see  this  pagethe  nginx  web  server  is  successfully  installed  and
workingFurther  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.


出错,没有开启服务:

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


开启服务测试成功:

 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
[ root@ kurolz ~ ]# cd / usr / local / nginx / sbin
[ root@ kurolz sbin ]# curl http: // localhost
Welcome to nginx!
body {
width: 35 em;
margin: 0 auto;
font - family: Tahoma, Verdana, Arial, sans - serif;
}
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.

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值