nginx for ubuntu
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的更多相关文章
- [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 ...
- 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 ...
- How to install nginx in Ubuntu
The steps for installing the nginx on Ubuntu below. 1.install the packages first. apt-get install gc ...
- nginx 在ubuntu上使用笔记(绑定域名)
1. 重启nginx的两个语句: sudo service nginx restart sudo nginx -s reload 2. nginx配置文件路径: etc/nginx/ 尤其是 site ...
- Django + Gunicorn + Nginx 部署 Ubuntu 服务器
Django + Gunicorn + Nginx 部署服务器 获取腾讯云 root权限 本人的服务器使用的是腾讯云,腾讯云默认是没有开放 root 用户的,我们来创建 root 用户. 创建 roo ...
- nginx 在ubuntu 上的启动,停止,重启
vi 显示行号 :set num 在开始玩nginx之前,得先安装nginx,可以参考 <ubuntu15.10_x64 安装 nginx> 启动 sudo /usr/local/ng ...
- 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 ...
- Install nginx on ubuntu
1. Install libpcre3, libpcre3-dev2. Install zlib1g-dev3. Download nginx and unzip it4. ./configure5. ...
- 在Ubuntu 12.4 下安装 nginx, MySQL, PHP
LNMP是时下很流行的网站配置,我在配置蝉大师服务器的时候顺带把经验做个分享,蝉大师的网址是:http://www.ddashi.com/ 1.第一步, 跟新apt-get 输入: sudo apt- ...
随机推荐
- Linux服务基础命令
---恢复内容开始--- 1简介: Linux的网络功能相当强悍,一时之间我们无法了解所有的文阿罗命令,在配置服务器基础环境时,先了解下网络参数设定命令. ifconfig 查询,设置网卡和i ...
- ES6 模块化(Module)export和import详解 export default
ES6 模块化(Module)export和import详解 - CSDN博客 https://blog.csdn.net/pcaxb/article/details/53670097 微信小程序笔记 ...
- LEA指令与MOV指令的区别——发现一本汇编好书
一.汇编语言中PTR的含义及作用mov ax,bx ;是把BX寄存器“里”的值赋予AX,由于二者都是word型,所以没有必要加“WORD”mov ax,word ptr [bx];是把内存地址等于“B ...
- 注册中心Eureka页面添加用户认证
我们需要登录即可访问到Eureka服务,这样其实是不安全的 为Eureka添加用户认证. 第一步,为itcast-microservice-eureka添加安全认证依赖: 第二步,增加applicat ...
- C#使用 webBrowser 控件总结
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...
- YTU 2435: C++ 习题 输出日期时间--友元函数
2435: C++ 习题 输出日期时间--友元函数 时间限制: 1 Sec 内存限制: 128 MB 提交: 1069 解决: 787 题目描述 设计一个日期类和时间类,编写display函数用于 ...
- CentOS 7下Keepalived + HAProxy 搭建配置详解
第一步:准备 1. 简介 本文搭建的是利用 Keepalived 实现 HAProxy 的热备方案,即两台主机上的 HAProxy 实例同时运行,其中全总较高的实例为 MASTER,MASTER出现异 ...
- android 改变状态栏(StatusBar)颜色
public static void changeColor(Activity paramActivity, int paramInt1) { if (Build.VERSION.SDK_INT &g ...
- I.MX6 wpa_applicant 开启 debug 输出
/*********************************************************************** * I.MX6 wpa_applicant 开启 de ...
- Splay 区间反转
同样的,我们以一道题来引入. 传送门 这次的任务比较少,只要求进行区间反转.区间反转? 这个好像用啥都是O(n)的吧……(这次vector,set也救不了你了) 我们来使用splay解决这个问题.我们 ...