Linux-rhel6.4部署nginx

检查安装

[ro[email protected] ~]# rpm -qa pcre*
pcre-devel-7.8-6.el6.x86_64
pcre-7.8-6.el6.x86_64
[[email protected] ~]# rpm -qa openssl*
openssl-1.0.0-27.el6.x86_64

安装nginx

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

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

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

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

[[email protected] 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
[[email protected] 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%]

重新安装成功:

[[email protected] 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"
[[email protected] nginx-1.10.3]# make
[[email protected] nginx-1.10.3]# make install

主页测试:

[[email protected] ~]# cd /usr/local/nginx/html
[[email protected] html]# cat index.html
<!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>

出错,没有开启服务:

[[email protected] html]# curl http://localhost
curl: (7) couldn‘t connect to host

开启服务测试成功:

[[email protected] ~]# cd /usr/local/nginx/sbin
[[email protected] 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>
时间: 2024-12-24 03:07:31

Linux-rhel6.4部署nginx的相关文章

LINUX测试环境部署nginx(五)

安装配置nginx 安装编译环境:yum -y install pcre-devel openssl openssl-devel 拷贝nginx压缩文件到目标目录后,解压tar -zxvf nginx1.4.4.tar.gz 设置编译参数:./configure --prefix=/usr/local/nginx --with-http_stub_status_module      (/usr/local/nginx目录下运行) 编译:make 安装:make install 启动cd /us

linux企业常用服务---部署NGINX虚拟主机

部署前准备: 光盘配置本地yum源,修改yum配置文件 防火墙和selinux不做设置,关掉 IP地址设置为192.168.100.222 nginx已安装完成 1.安装安装并配置dns: 安装dns: [[email protected] ~]# yum install bind-utils bind bind-chroot 配置: [[email protected] ~]# cd /var/named/chroot/etc/ 配置主文件: [[email protected] etc]#

Linux平台部署nginx反向代理实例

nginx有着优秀的代理性能,很多情况下,nginx常常被充当反向代理服务器负载后端应用web构建起一个高性能高可用的web集群(淘宝tengix ,京东的nginx集群都使用到了nginx反向代理功能),接下来给大家讲解Linux平台部署nginx反向代理实例. [本文档所介绍的内容适用于公司测试/生产等常见的nginx反向代理应用] 1. nginx环境部署前准备: 1.1相关软件以及系统 系统要求:Centos 6.0以上 (64位) 相关中间件:Nginx: 1.6.0 以上(包含1.6

Linux中以单容器部署Nginx+ASP.NET Core

引言 正如前文提到的,强烈推荐在生产环境中使用反向代理服务器转发请求到Kestrel Http服务器,本文将会实践将Nginx --->ASP.NET Core 部署架构容器化的过程. Nginx->ASP.NET Coe部署架构容器化 在Docker中部署Nginx--->ASP.NETCore 有两种选择, 第一种是在单容器内部署Nginx+ASP.NET Core, 这是本文着重要讲述的,另外一种是以独立容器分别部署Nginx和ASP.NET Core,容器之间通过Docker内建

uWSGI+Nginx+Flask在Linux下的部署

搞了一天多,终于搞通了uWSGI的部署原理,下面总结一下遇到的一些坑,希望给读者能够少走弯路. 简单来说,uWSGI是一个web服务器,Nginx进行反向代理的其实跟这些服务器可以说没有任何关系,你提供动态内容的服务器可以是apache/nginx/tomcat,当然也可以是uWSGI,他们之间的代理关系其实都是通过tcp/ip协议进行通信的.当然uWSGI相对于其它服务器来说有其特殊的地方,不同之处在于它可以提供独特的uwsgi协议进行通信.也就是说,nginx和uWSGI之间的通信协议可以有

lamp/lnmp阶段练习Linux常用服务部署与优化

lamp/lnmp阶段练习Linux常用服务部署与优化 我们以模拟实际需求的形式来复习.需求如下: 1. 准备两台centos 6,其中一台机器跑mysql,另外一台机器跑apache和nginx + php 2. 同时安装apache和nginx,其中nginx启动80端口,用来跑静态对象(图片.js.css),apache监听88端口,负责跑动态页(php相关的),并且需要由nginx代理对外访问3. mysql服务器需要开启慢查询日志4. 搭建discuz.wordpress以及phpmy

Linux网络服务--LAMP+Nginx+Squid搭建web集群

一.         项目名称         LAMP+Nginx+Squid搭建web集群环境 二.         项目拓扑 三.         项目描述 3.1 项目环境 某部队为了满足信息化政治工作建设需要,用以丰富官兵日常生活内容,活化教育形式,更好的建设部队人文环境,准备架设部队内部的网站服务器,并申请使用军内公网IP:1.1.1.1 基于以上情况为该部提出以下解决方案.   3.2 实施方案 3.2.1  服务器操作系统与软件版本选择 操作系统选择RedHat企业版5.10:

RHEL6.5 部署RAID1

# uname -a Linux hs105.localdomain2.6.32-358.el6.x86_64 #1 SMP Tue Jan 29 11:47:41 EST 2013 x86_64 x86_64 x86_64GNU/Linux # cat /etc/redhat-release Red Hat Enterprise Linux Server release 6.4(Santiago) 使用rpm 安装mdadm [[email protected] ~]# mount /dev/

debian完整部署 Nginx + uWSGI + Django

debian完整部署 Nginx + uWSGI + Django 手工部署一个Django服务器真心不容易,需要安装很多东西.从头开始搭建服务器,主要是为了梳理一下后续开发中一般为碰到的平台部署.对后续问题的解决有一定帮助. 通常部署有2中方式: 一种是使用现成提供的服务器包用apt-get这种方式安装的.这种方式比较简单,但没有新版本. 另外就是使用源代码自己编译安装,这种比较繁琐,但能选择适合的版本安装. 这里介绍的是第二种,使用源代码编译的版本进行安装部署. 部署测试环境: - wind

RHEL6.4 搭建Nginx反向代理服务器

实验需求:使用nginx搭建反向代理服务器,把用户的请求分发给后端的web服务器组192.168.100.1和192.168.100.2 内网web服务器192.168.100.1          内网接口eth0(192.168.1.254) ----------- nginx反向代理服务器------------ 公网客户端1.1.1.1 内网web服务器192.168.100.2           公网接口eth1(1.1.1.254) 一.部署内网的网站服务器192.168.100.