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 :  error: the HTTP rewrite module requires the PCRE library.

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


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

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


重新安装成功:

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 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


主页测试:

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
<!DOCTYPE html>
< html >
< head >
< title >Welcome to nginx!</ title >
< style >
     body {
         width: 35em;
         margin: 0 auto;
         font-family: Tahoma, Verdana, Arial, sans-serif;
     }
</ style >
</ head >
< body >
< h1 >Welcome to nginx!</ h1 >
< p >If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</ p >
< p >For online documentation and support please refer to
< a  href = "http://nginx.org/" >nginx.org</ a >.< br />
Commercial support is available at
< a  href = "http://nginx.com/" >nginx.com</ a >.</ p >
< p >< em >Thank you for using nginx.</ em ></ p >
</ body >
</ html >


出错,没有开启服务:

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
24
25
[root@kurolz ~] # cd /usr/local/nginx/sbin
[root@kurolz sbin] # curl http://localhost
<!DOCTYPE html>
<html>
< head >
<title>Welcome to nginx!< /title >
<style>
     body {
         width: 35em;
         margin: 0 auto;
         font-family: Tahoma, Verdana, Arial, sans-serif;
     }
< /style >
< /head >
<body>
<h1>Welcome to nginx!< /h1 >
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.< /p >
<p>For online documentation and support please refer to
<a href= "http://nginx.org/" >nginx.org< /a >.<br/>
Commercial support is available at
<a href= "http://nginx.com/" >nginx.com< /a >.< /p >
<p><em>Thank you  for  using nginx.< /em >< /p >
< /body >
< /html >



      本文转自谢育政 51CTO博客,原文链接:http://blog.51cto.com/kurolz/1927570 ,如需转载请自行联系原作者



相关文章
|
5月前
|
应用服务中间件 网络安全 nginx
手把手教你使用 Docker 部署 Nginx 教程
本文详解Nginx核心功能与Docker部署优势,涵盖镜像拉取、容器化部署(快速、挂载、Compose)、HTTPS配置及常见问题处理,助力高效搭建稳定Web服务。
2236 4
|
5月前
|
应用服务中间件 Linux nginx
在虚拟机Docker环境下部署Nginx的步骤。
以上就是在Docker环境下部署Nginx的步骤。需要注意,Docker和Nginix都有很多高级用法和细节需要掌握,以上只是一个基础入门级别的教程。如果你想要更深入地学习和使用它们,请参考官方文档或者其他专业书籍。
263 5
|
8月前
|
NoSQL 关系型数据库 Linux
ERPNext 搭建教程:Linux 一键部署与维护
ERPNext 是一款开源免费的企业资源计划系统,适用于中小企业信息化管理。基于 Python 和 Frappe 框架开发,支持财务、销售、人力、库存等模块,具备高度可定制性。本文介绍如何通过 Websoft9 在 Linux 下快速部署 ERPNext,并提供环境配置、系统维护等实用建议,适合开发者和企业用户快速上手。
1362 7
ERPNext 搭建教程:Linux 一键部署与维护
|
10月前
|
监控 Linux 应用服务中间件
Linux多节点多硬盘部署MinIO:分布式MinIO集群部署指南搭建高可用架构实践
通过以上步骤,已成功基于已有的 MinIO 服务,扩展为一个 MinIO 集群。该集群具有高可用性和容错性,适合生产环境使用。如果有任何问题,请检查日志或参考MinIO 官方文档。作者联系方式vx:2743642415。
3365 57
|
8月前
|
Java Linux 网络安全
Linux云端服务器上部署Spring Boot应用的教程。
此流程涉及Linux命令行操作、系统服务管理及网络安全知识,需要管理员权限以进行配置和服务管理。务必在一个测试环境中验证所有步骤,确保一切配置正确无误后,再将应用部署到生产环境中。也可以使用如Ansible、Chef等配置管理工具来自动化部署过程,提升效率和可靠性。
799 13
|
8月前
|
关系型数据库 Linux Nacos
Rocky Linux 部署 Docker 和 NACOS 实例
本文介绍在阿里云环境下基于 Rocky Linux 搭建 Docker 并部署 Nacos 的完整流程。涵盖 Docker 安装、镜像加速配置、网络设置及 MySQL 与 Nacos 容器的创建,适用于开发与生产环境。
1036 2
|
10月前
|
应用服务中间件 Linux 网络安全
技术指南:如何把docsify项目部署到基于CentOS系统的Nginx中。
总结 与其他部署方法相比,将docsify项目部署到基于CentOS系统的Nginx中比较简单。以上步骤应当帮助你在不花费太多时间的情况下,将你的项目顺利部署到Nginx中。迈出第一步,开始部署你的docsify项目吧!
409 14
|
10月前
|
开发框架 Java 关系型数据库
在Linux系统中安装JDK、Tomcat、MySQL以及部署J2EE后端接口
校验时,浏览器输入:http://[your_server_IP]:8080/myapp。如果你看到你的应用的欢迎页面,恭喜你,一切都已就绪。
636 17
|
10月前
|
Java 关系型数据库 MySQL
在Linux操作系统上设置JDK、Tomcat、MySQL以及J2EE后端接口的部署步骤
让我们总结一下,给你的Linux操作系统装备上最强的军队,需要先后装备好JDK的弓箭,布置好Tomcat的阵地,再把MySQL的物资原料准备好,最后部署好J2EE攻城车,那就准备好进军吧,你的Linux军团,无人可挡!
305 18