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 mvc + javascript导入文件内容

    .近期做的是对现有项目进行重构.WEB FROM改成MVC,其实也算是推倒重来了. 里面有一个导入功能,将文件上传.原先的做法是有一个隐藏的iframe,在这个iframe的页面中设置一个表单form ...

  2. 更改Mysql登录密码

    版本号49之前的跨域设置 在Windows命令行下修改mysql数据库密码步骤如下: 1.通过dos命令进入mysql的bin目录: 2.输入“mysql -uroot -p”,回车进入mysql命令 ...

  3. xcode 程序配置 python 解释器嵌入

    1.点击项目->Buid Phases->加号点击 添加RunScript,Shell中写为python路径.一般是/usr/bin/python 2.同样是Build Phases中,L ...

  4. high-level operations on files and collections of files

    11.10. shutil — High-level file operations — Python 3.6.5 documentation https://docs.python.org/3/li ...

  5. AWS携手上海嘉定政府推出首个联合孵化器 为创业公司拓展AWS云服务可用资源

    2014年10月17日 AWS Activate创业加速计划为中国创业公司提供各种支持,包含AWS全球和中国区服务抵扣券.培训和开发人员支持.同一时候,AWS携手上海嘉定政府成立首家联合孵化器,为创业 ...

  6. 在 Vim 中优雅地查找和替换 vi【转】

    本文转载自:http://harttle.land/2016/08/08/vim-search-in-file.html 总有人问我 Vim 中能不能查找,当然能!而且是超级强的查找! 这篇文章来详细 ...

  7. DGA域名可以是色情网站域名

    恶意域名指传播蠕虫.病毒和特洛伊木马或是进行诈骗.色情内容传播等不法行为的网站域名. 恶意域名指传播蠕虫.病毒和特洛伊木马或是进行诈骗.色情内容传播等不法行为的网站域名.本文面临能够的挑战,就是恶意网 ...

  8. kafka-net

    基于kafka-net实现的可以长链接的消息生产者 今天有点时间,我就来说两句.最近接触的Kafka相关的东西要多一些,其实以前也接触过,但是在项目使用中的经验不是很多.最近公司的项目里面使用了Kaf ...

  9. poyla计数问题

    关于poyla定理,首先推荐两篇很好的文章阅读 2001-----符文杰<poyla原理及其应用> 2008-----陈瑜希<poyla计数法的应用> 在然后就是自己的学习笔记 ...

  10. sass 基本语法

    sass语法 文件后缀名 sass有两种后缀名文件:一种后缀名为sass,不使用大括号和分号:另一种就是我们这里使用的scss文件,这种和我们平时写的css文件格式差不多,使用大括号和分号. 而本教程 ...