1.创建文件夹 :mkdir nginx

2.解压nginx: tar zxvf nginx.gz.tar

3.nginx 初始化:在nginx的路径下执行:./configure

有可能会报错:

./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.

解决办法:yum -y install pcre-devel ,如果报

执行 sudo apt install yum 还是报错,查找资料后发现在ubuntu中要用apt-get 的方法安装PCRE 依赖包

  sudo apt-get install openssl libssl-dev

  sudo apt-get install libpcre3 libpcre3-dev

sudo make 命令进行编译

sudo make install 安装nginx软件

这是默认安装到user文件夹下

4.nginx的启动与关闭

1.找到默认nginx的安装文件夹 usr/local/sbin 是nginx脚本所在的位置

  nginx -h :查看nginx所有相关命令  nginx 的操作时通过发送信号给进程进行操作

nginx -q  测试配置时只显示错误

nginx -s  SINGLE(信号类型)  向主机进程发送信号   :nginx -s quit 关闭nginx  nginx -s reload 启动nginx

nginx -p :设置nginx服务器路径前缀

nginx -t :检查nginx服务器配置文件是否有语法错误

nginx -c :指定nginx的配置文件

nginx for ubuntu的更多相关文章

  1. [django] Deploy Django Applications Using uWSGI and Nginx on Ubuntu 14.04

    关键点1:chmod-socket=666 (mysite_uwsgi.ini) 关键点2 : 工程目录和虚拟环境目录搞清楚 几个参考: http://uwsgi-docs.readthedocs.i ...

  2. How To Install Nginx on Ubuntu 16.04 zz

    Introduction Nginx is one of the most popular web servers in the world and is responsible for hostin ...

  3. How to install nginx in Ubuntu

    The steps for installing the nginx on Ubuntu below. 1.install the packages first. apt-get install gc ...

  4. nginx 在ubuntu上使用笔记(绑定域名)

    1. 重启nginx的两个语句: sudo service nginx restart sudo nginx -s reload 2. nginx配置文件路径: etc/nginx/ 尤其是 site ...

  5. Django + Gunicorn + Nginx 部署 Ubuntu 服务器

    Django + Gunicorn + Nginx 部署服务器 获取腾讯云 root权限 本人的服务器使用的是腾讯云,腾讯云默认是没有开放 root 用户的,我们来创建 root 用户. 创建 roo ...

  6. nginx 在ubuntu 上的启动,停止,重启

    vi 显示行号 :set num 在开始玩nginx之前,得先安装nginx,可以参考 <ubuntu15.10_x64 安装 nginx>   启动 sudo /usr/local/ng ...

  7. Build Laravel Blog PigJian by PHP7 and Nginx on Ubuntu

    Recently, I found an interesting framework Laravel written by PHP. i have never used PHP to write an ...

  8. Install nginx on ubuntu

    1. Install libpcre3, libpcre3-dev2. Install zlib1g-dev3. Download nginx and unzip it4. ./configure5. ...

  9. 在Ubuntu 12.4 下安装 nginx, MySQL, PHP

    LNMP是时下很流行的网站配置,我在配置蝉大师服务器的时候顺带把经验做个分享,蝉大师的网址是:http://www.ddashi.com/ 1.第一步, 跟新apt-get 输入: sudo apt- ...

随机推荐

  1. asp.net listview 实现分页浏览效果

    页面代码: <div style="margin-top:0px;">共<asp:Label ID="lb_count" runat=&quo ...

  2. mysql 查看编码方式

    一. 查看数据库的字符集 show variables like 'character\_set\_%'; 输出: +--------------------------+--------+ | Va ...

  3. 区块链共识算法 PBFT(拜占庭容错)、PAXOS、RAFT简述

    共识算法 区块链中最重要的便是共识算法,比特币使用的是POS(Proof of Work,工作量证明),以太币使用的是POS(Proof of Stake,股权证明)使得算理便的不怎么重要了,而今PO ...

  4. 如何将Eclipse中的项目迁移到Android Studio中

    如果你之前有用Eclipse做过安卓开发,现在想要把Eclipse中的项目导入到Android Studio的环境中,那么首先要做的是生成Build Gradle的文件.因为Android Studi ...

  5. 创建cell的三种方式

    方式一 注册cell -> 无需为cell绑定标识符 [使用UIViewController完成!] l  1> static NSString * const ID = @"c ...

  6. [USACO 2004DEC] Navigation Nightmare

    [题目链接] https://www.lydsy.com/JudgeOnline/problem.php?id=3362 [算法] 带权并查集 时间复杂度 : O(NlogN) [代码] #inclu ...

  7. bzoj 1127 KUP —— 最大子矩形+答案构造

    题目:https://www.lydsy.com/JudgeOnline/problem.php?id=1127 首先,把权值 > 2*k 的点作为“坏点”,然后在图中用悬线法找权值最大的子矩形 ...

  8. 洛谷P3778 [APIO2017]商旅——01分数规划

    题目:https://www.luogu.org/problemnew/show/P3778 转化有点技巧: 其实直接关注比率的上下两项,也就是盈利和时间: 通过暴枚和 floyd 可以处理出两两点间 ...

  9. 从0开始学习Hadoop(2)安装JDK

    参考文档: 安装包方式安装:http://www.cnblogs.com/wuyudong/p/ubuntu-jdk8.html PPA方式安装:推荐  http://www.cnblogs.com/ ...

  10. linuxmint17.3提示flash不是最新版本解决方法(copy)

    [资料来自于:http://blog.csdn.net/kh896424665/article/details/54879608] 问题:播放视频提示:Adobe Flash Player 不是最新版 ...