nginx ubantu 安装步骤
Ubuntu14.04默认安装的是Nginx 1.4.6
如果已经安装,请先卸载
sudo apt-get remove nginx
最新的稳定版Nginx 1.6.0在ubuntuupdates ppa库中提供,网址http://www.ubuntuupdates.org/ppa/nginx?dist=trusty
安装方法:
sudo add-apt-repository ppa:nginx/stable
sudo apt-get update
sudo apt-get install nginx
查看nginx 版本
nginx -v
nginx version: nginx/1.6.0
-----------------------------------另一例-----------------------------------
一、检测主机信息
root@slave:~# cat /etc/issue
Ubuntu 12.04.1 LTS \n \l
root@slave:~# uname -a
Linux slave 3.2.0-29-generic #46-Ubuntu SMP Fri Jul 27 17:03:23 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
PS:一下操作小编只针对如上环境进行测试
二、更新apt源
登录nginx官网 依次点击右边download 下边的stable version 找到响应系统并复制deb连接添加至源配置文件
eg:
复制
deb http://nginx.org/packages/mainline/ubuntu/ codename nginx
deb-src http://nginx.org/packages/mainline/ubuntu/ codename nginx
添加至/etc/apt/sources.list文件中
下载并导入/
wget http://nginx.org/keys/nginx_signing.key
sudo apt-key add nginx_signing.key
更新apt-get源
apt-get update
安装nginx
root@slave:~# apt-get install nginx
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
下列【新】软件包将被安装:
nginx
升级了 0 个软件包,新安装了 1 个软件包,要卸载 0 个软件包,有 154 个软件包未被升级。
需要下载 462 kB 的软件包。
解压缩后会消耗掉 1,030 kB 的额外空间。
获取:1 http://nginx.org/packages/mainline/ubuntu/ precise/nginx nginx amd64 1.7.4-1~precise [462 kB]
下载 462 kB,耗时 2秒 (207 kB/s)
Selecting previously unselected package nginx.
(正在读取数据库 ... 系统当前共安装有 49098 个文件和目录。)
正在解压缩 nginx (从 .../nginx_1.7.4-1~precise_amd64.deb) ...
----------------------------------------------------------------------
Thanks for using nginx!
Please find the official documentation for nginx here:
* http://nginx.org/en/docs/
Commercial subscriptions for nginx are available on:
* http://nginx.com/products/
----------------------------------------------------------------------
正在处理用于 ureadahead 的触发器...
ureadahead will be reprofiled on next reboot
正在设置 nginx (1.7.4-1~precise) ...
检查nginx版本
root@slave:~# nginx -v
nginx version: nginx/1.7.4
/-------------------------设置nginx.conf----------------------
默认安装路径 /etc/nginx/nginx.conf
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
underscores_in_headers on; #自定义 Head 必须定义
server {
# 监听 8089 端口
listen 8089;
autoindex on;
server_name 124.128.235.247;
access_log /var/log/nginx/access.log combined;
index index.html index.htm index.jsp index.php;
if ( $query_string ~* ".*[\;'\<\>].*" ){
return 404;
}
location / {
# 反向代理到 8089 端口
proxy_pass http://10.10.0.245:8089;
# add_header Access-Control-Allow-Origin *;
proxy_set_header HOST $HOST;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Request-Url $request_uri;
}
}
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
nginx ubantu 安装步骤的更多相关文章
- windows10系统下安装nginx的安装步骤
打开nginx的官网:http://nginx.org/,下载最新的稳定版本. 下载完成后,解压到你想要解压的文件路径中,我解压到了D盘中,并把文件名改为nginx:进入文件内,打开nginx.e ...
- nginx的安装步骤
nginx学习资料;https://zhuanlan.zhihu.com/p/34943332 1.下载nginx的安装包:https://nginx.org/en/download.html 2. ...
- ubuntu配置Python-Django Nginx+uwsgi 安装配置
安装Nginx sudo apt-get install nginx ubantu安装完Nginx后,文件结构大致为: 所有的配置文件都在 /etc/nginx下: 启动程序文件在 /usr/sbin ...
- Nginx的安装--------tar包安装
Nginx的安装,在网上搜索是很多的结果,但是 真的安装起来却花费了不少 心思,总结起来就是依赖包安装了,但是没有指定对的路径,在安装的过程中遇到过两个问题: ①make[1]: *** [/usr/ ...
- linux/centos下安装nginx(rpm安装和源码安装)详细步骤
Centos下安装nginx rpm包 ...
- Nginx安装(我觉得我这篇可能是全网最清晰的一篇安装步骤了)
原文内容来自于LZ(楼主)的印象笔记,如出现排版异常或图片丢失等问题,可查看当前链接:https://app.yinxiang.com/shard/s17/nl/19391737/46aadb8f-5 ...
- nginx安装步骤和加固方案
安装步骤参考https://blog.csdn.net/qq_37345604/article/details/90034424 出现以下页面就表示安装完成(默认是80端口,我修改成了8009端口,所 ...
- Nginx安装步骤及本地浏览器不通解决方案,Nginx在Linux发布项目,Tomcat 与本地浏览器不通解决方案
Nginx安装步骤及本地浏览器不通解决方案 1.将安装包放到usr/local文件夹下 2..进入local目录,解压 tar -zxvf nginx-1.17.5.tar.gz 3.进入 nginx ...
- 转载《centos6安装nginx最详细步骤》
出处:https://www.cnblogs.com/hltswd/p/6956264.html 第一步:在centos下面下载 nginx wget http://nginx.or ...
随机推荐
- 树莓派4B 更新wiringPi库到2.52的方法的wiringPi库2.5.2版本wiringpi-latest.deb下载
树莓派4B 更新wiringPi库到2.52的方法 – 树莓派中文站 http://www.52pi.net/archives/1918 通过如上链接可知,需要通过如下命令下载wiringpi-lat ...
- 第一届云原生应用大赛火热报名中! helm install “一键安装”应用触手可及!
云原生应用,是指符合“云原生”理念的应用开发与交付模式,这是当前在云时代最受欢迎的应用开发最佳实践. 在现今的云原生生态当中,已经有很多成熟的开源软件被制作成了 Helm Charts,使得用户可以非 ...
- 【04】Nginx:rewrite / if / return / set 和变量
写在前面的话 我们前面已经谈了编译安装,基本语法,日志处理,location 匹配,root / alias 的不同效果.这里我们主要谈谈 rewrite(重写)功能,顺便说说 nginx 中自带的变 ...
- mysql建表中auto_increment=21
CREATE TABLE `demo` ( `id` ) NOT NULL AUTO_INCREMENT, `img` ) DEFAULT NULL COMMENT '大图', `status` ) ...
- c# 调用接口返回json
需要命名空间 using System.Net; using System.Net.Security using System.Security.Cryptography.X509Certificat ...
- YII 项目部署时, 显示空白内容
本地开发完成,想部署到服务器上,选用了GIT来在服务器上获取上传的本地项目,结果clone后,访问网址后,YII就是个空白页,啥信息也没有,无语.. 刚开始以为是权限问题,后来给访问的目录加了777, ...
- 钉钉企业内部H5微应用开发
企业内部H5微应用开发 分为 服务端API和前端API的开发,主要涉及到进入应用免登流程和JSAPI鉴权. JSAPI鉴权开发步骤: 1.创建H5微应用 登入钉钉开放平台(https://open-d ...
- PHP MySQL数据分页
SQL SELECT语句查询总是可能导致数千条记录.但是在一个页面上显示所有结果并不是一个好主意.因此,我们可以根据要求将此结果划分为多个页面.分页意味着在多个页面中显示您的查询结果,而不是仅将它们全 ...
- B+树的算法(java实现)
定义 一颗m阶B+树满足以下几个条件: 1.除根节点外的节点的关键字个数最大为m-1,最小为m/2 2.除叶节点外的每个节点的孩子节点的数目为该节点关键字个数加一,这些孩子节点的的关键字的范围与父节点 ...
- 基于rtmp+nginx 、vlc实现FFmpeg推流与wpf端拉流
这周在研究基于rtmp+nginx直播流的实现,现总结如下: 0.所需文件: 链接:https://pan.baidu.com/s/1U5gsNI8Rcl684l5gVL6swg 提取码:dli9 1 ...