一、安装

sudo wget http://nginx.org/download/nginx-1.4.4.tar.gz

sudo tar zxvf ng。。。。
cd nginx-1.4.4
sudo ./configure
sudo make
sudo make install

--------------------

./configure: error: the HTTP rewrite module requires the PCRE library.

---------------------------------------

解决方法:

安装nginx依赖包运行命令:

sudo apt-get install libssl-dev
sudo apt-get install libpcre3 libpcre3-dev

2014/12/29 05:04:14 [error] 11808#0: open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)

---------------------

解决方法:
[root@localhost nginx]# /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
 
使用nginx -c的参数指定nginx.conf文件的位置
"/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)错误,进到logs文件发现的确没有nginx.pid文件
二、输入ip 出现 welcome to nginx 就代表ok
三、nginx配置文件所在目录/usr/local/nginx/conf/nginx.conf【转发端口】
  server {
listen 85;
#Allow file uploads
client_max_body_size 50M;

location / {
  proxy_pass http://10.10.3.99:81;
proxy_pass_header Server;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;

}
}

 
 
 
四、 sudo /usr/local/nginx/sbin/nginx -s reload 重启nginx
 
 
 
 
五、nginx 转发多个端口【和server要并联噢,就是重写一个,不在原来的括号里面】

server {
        listen       83;
        server_name  localhost;

#charset koi8-r;

#access_log  logs/host.access.log  main;

location / {
    proxy_pass http://10.10.3.99:83;
                        proxy_pass_header Server;
                        proxy_set_header Host $http_host;
                        proxy_set_header X-Real-IP $remote_addr;
                        proxy_set_header X-Scheme $scheme;

}
}

六、让普通用户拥有root权限

sudo vim /etc/sudoers

然后 ggm=  All。。。 仿照上面写就可以了

 
 

ubutun中安装nginx的更多相关文章

  1. 在CentOS 7中安装nginx服务器

    简要地介绍一下,如何在CentOS 7中安装nginx服务器  下载对应当前系统版本的nginx包(package) # wget  http://nginx.org/packages/centos/ ...

  2. 在win10 docker启动的centos容器中安装nginx

    我是在win10机器上搭建了一个docker,在docker启动了centos容器,在centos中安装nginx. 安装配置docker 直接在官网下载docker for windows:http ...

  3. Windows2012中安装Nginx并创建为Windows服务

    安装Nginx 下载windows版nginx (http://nginx.org/download/nginx-1.10.0.zip),之后解压到需要放置的位置(D:\xampp\nginx) 将N ...

  4. 【Asp.net Core】在 Linux 子系统中安装 nginx 并配置反向代理

    上一篇鸟文中,老周已经介绍过在 Ubuntu 子系统中安装 dotnet-sdk 的方法,本文老周给大伙伴们说说安装 nginx 服务,并配置反向代理.同样,老周假设你从来没有用过 Linux,所以老 ...

  5. Nginx系列篇一:linux中安装Nginx

    提示: 如遇到yum或者wget的问题, 请详见--->杂集:更换centos yum源 请详见--->杂集:关于VMware中linux使用NAT模式配置 1.安装nginx需要的环境 ...

  6. 在linux中安装nginx

    linux系统安装在vmware中,首先在主机中利用shell工具与虚拟机连接 1.在linux中查看虚拟机的ip地址 在终端输入 ifconfig 红框里面就是ip地址 2.在主机中打开shell工 ...

  7. CentOS中安装Nginx

    一.背景 最近在写一些自己的项目,用到了nginx,所以自己动手来在Centos7上安装nginx,以下是安装步骤. 二.基本概念以及应用场景 1.什么是nginx Nginx是一款使用C语言开发的高 ...

  8. CentOS 中安装nginx

    Centos6.8 yum  安装 nginx  1:使用yum安装nginx,安装nginx库 [root@hadoop110 //]# rpm -Uvh http://nginx.org/pack ...

  9. nginx - ubutun下安装nginx(详述编译方法)

    一.使用apt命令安装 sudo apt-get install nginx 二.编译方法安装(个人实践方法,具体见官方文档) 1)说明:我使用的虚拟机是64位 ubuntu server14.04, ...

随机推荐

  1. 手势冲突UIPanGestureRecognizer 和UIPinchGestureRecognizer

    当同时使用pan和pin手势时假如冲突,需要加入下面方法 - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shou ...

  2. android学习笔记---发送状态栏通知

    发送消息的代码如下: //获取通知管理器 NotificationManager mNotificationManager = (NotificationManager) getSystemServi ...

  3. openstack neutron

  4. HP ILO2 使用详细教程

    iLO是Intergrated Light-Out的缩写,是惠普特有的远程管理功能,目前最新的版本是iLO2.通过iLO2可以实现硬件级别的服务器远程管理,包括开关机.重启.服务器状态的监控.虚拟KV ...

  5. centos安装lxml和pyspider

    yum -y install --nogpgcheck python34u-devel.x86_64 yum -y install libcurl-devel yum -y install libxs ...

  6. McAfee VirusScan Enterprise

    企业版下载入口:  http://www.mcafee.com/cn/downloads/downloads.aspxGrant number:6240017-NAI6240018-NAI 下载Vir ...

  7. Android 解析JSONObject以及JSONArray对比

    在Android客户端与服务器交互的过程中,客户端一般采用json解析服务器的返回数据.此时有两种数据格式.但其根本都是字符串或字符串数组! 1.JSONObject 下面是PHP端代码: <? ...

  8. 建表的sql

    1. 创建用户表 create table user( id int unsigned not null primary key auto_increment comment '自增id', user ...

  9. IntegrityError错误

    Python插入数据库提交失败,一直走IntegrityError错误,没打印错误信息(一定注意编码规范,记住打印错误信息),以为插不进去,弄了好久,最后打印了错误信息 (sqlite3.Integr ...

  10. OC:面向对象的编程思想、基本的知识点总结、强,弱引用

    OC 面向对象 和 面向过程 参考 面向过程:使用步骤划分功能,然后用函数一步一步的调用 面向对象:OOP (Object Oriented Programming) 使用功能来简化问题, 面向对象语 ...