ubuntu安装Nginx
什么都不说了 直接干
一、安装Nginx
首先从Nginx的官网下载最新的稳定版本1.14.0:nginx
1.解压安装包
1.root@ubuntu:tar -zxf nginx-1.14.0.tar.gz
2.root@ubuntu:cd nginx-1.14.0/
3.root@ubuntu:./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.
如果出现以上错误 提示HTTP的rewrite模块需要PCRE库,如果需要使用HTTP的rewrite功能,需要首先安装PCRE库
PCRE库的下载地址:https://sourceforge.net/projects/pcre/files/pcre/8.42/pcre-8.42.tar.gz/download
root@ubuntu:~$ tar -xzf pcre-8.42.tar.gz
root@ubuntu:~$ cd pcre-8.42/
root@ubuntu:~/pcre-8.42$ sudo ./configure
root@ubuntu:~/pcre-8.42$ sudo make
root@ubuntu:~/pcre-8.42$ sudo make install
PCRE安装完成之后继续Nginx的安装
root@ubuntu:~/pcre-8.42$ cd ../nginx-1.14./
root@ubuntu:~/nginx-1.14.$ sudo ./configure
......
./configure: error: the HTTP gzip module requires the zlib library.
You can either disable the module by using --without-http_gzip_module
option, or install the zlib library into the system, or build the zlib library
statically from the source with nginx by using --with-zlib=<path> option.
HTTP的gzip模块需要zlib库的支持,下载zlib库的最新版本:http://www.zlib.net/
root@ubuntu:~$ tar -xzf zlib-1.2..tar.gz
root@ubuntu:~$ cd zlib-1.2./
root@ubuntu:~/zlib-1.2.$ sudo ./configure
root@ubuntu:~/zlib-1.2.$ sudo make
root@ubuntu:~/zlib-1.2.$ sudo make install
安装完zlib库之后再次安装Nginx
root@ubuntu:~/zlib-1.2.$ cd ../nginx-1.14./
root@ubuntu:~/nginx-1.14.$ sudo ./configure
root@ubuntu:~/nginx-1.14.$ sudo make
root@ubuntu:~/nginx-1.14.$ sudo make instal
进入/usr/local/nginx/sbin 目录下 启动nginx
root@ubuntu:/usr/local/nginx/sbin$ ./nginx
查看nginx进程 ps -ef|grep nginx
root@ubuntu:/home/ubuntu/Nginx# ps -ef |grep nginx
root : ? :: nginx: master process ./nginx
nobody : ? :: nginx: worker process
root : pts/ :: grep --color=auto nginx
root@ubuntu:/home/ubuntu/Nginx#
然后浏览器输入IP地址 默认80端口

到这里就完成了Nginx的安装
如果出现此报错
./nginx: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory
在/usr/local/nginx/sbin 目录下执行以下命令 创建目录
root@ubuntu:/usr/local/nginx/sbin$ sudo ln -s /usr/local/lib/libpcre.so. /lib
技术QQ群:216868740
ubuntu安装Nginx的更多相关文章
- ubuntu安装nginx踩坑
ubuntu安装nginx 安装nginx tar -zxvf nginx-1.15.5.tar.gz -C /usr/local/src 解压 cd /usr/local/src/nginx-1.1 ...
- ubuntu安装nginx时提示error: the HTTP rewrite module requires the PCRE library
ubuntu安装nginx时提示error: the HTTP rewrite module requires the PCRE library 须要安装pcre包. sudo apt-get upd ...
- Ubuntu安装Nginx+PHP7.0.4+MySQL5.6
安装Nginx 1.首先添加nginx_signing.key(必须,否则出错) $ wget http://nginx.org/keys/nginx_signing.key $ sudo apt-k ...
- Ubuntu 安装 Nginx 实现反向代理
安装Nginx依赖库(ubuntu平台) 最近域名通过了备案, 想着应用总不能带着端口号访问吧, 于是在网上踩了很多坑, 终于找到了一步直达的方法,起码这一次很顺利的实现了 安装gcc g++的依赖库 ...
- ubuntu安装nginx和设置网站https访问
安装nginx 在控制台 输入 sudo apt-get install nginx 等待安装成功之后.可以打开浏览器.输入你的域名或者ip地址会出现"Welcome to nginx!&q ...
- ubuntu安装nginx pagespeed
一.自动安装 使用最新稳定版本的ngx_pagespeed自动安装依赖项并构建最新的主线版nginx,请运行: $ sudo bash <(curl -f -L -sS https://ngxp ...
- ubuntu 安装nginx, 出现 Unable to locate package
今天在初始化一台新的ubuntu 服务器时,敲上了 sudo apt-get install nginx 来安装nginx, 却发现提示: Reading package lists... Done ...
- ubuntu安装nginx及其默认目录结构
一. 安装包安装 1.1 安装Nginx $sudo apt-get install nginx Ubuntu安装之后的文件结构大致为: 所有的配置文件都在/etc/nginx下,并且每个虚拟主机已经 ...
- Ubuntu 安装nginx
https://www.nginx.com/resources/admin-guide/load-balancer/ https://github.com/gplessis/dotdeb-nginx/ ...
随机推荐
- js实现在当前页面搜索高亮显示字的方法
在html页面上,有时候会遇到一些检索高亮显示的问题,具体用js是实现的方式,代码展示. Jsp页面设置方式 <li class="pull-left" id="s ...
- 修改Android idc文件
安卓系统idc文件里面包含以下几点内容: 1 #=0 外部设备 =1内部设备 2 device.internal = 0 3 #定义:keyboard.layout = <name> 4 ...
- MIP开发教程(三) 使用MIP-CLI工具调试组件
一 . 在 mip-extensions 仓库中创建新的组件 二 . 预览调试组件 三 . 在 MIP 页中引用自己编写的 MIP 组件 四 . 组件提交到 GitHub 仓库时需要进行校验 站长开发 ...
- 免费申请使用IBM Cloud Lite(轻量套餐) 续
之前尝试申请了IBM的轻量套餐,过程很简单,操作起来也比较方便,就是能够用到的地方不多,虽说几乎是无限流量且永久免费,我能做的也只是做个小网站 免费用户默认的是轻量应用服务,如果需要功能更多更全的应用 ...
- Oracle AWRSQRPT报告生成和性能分析
我写的SQL调优专栏:https://blog.csdn.net/u014427391/article/category/8679315 对于局部的,比如某个页面列表sql,我们可以使用Oracle的 ...
- Oracle ASH报告生成和性能分析
我写的SQL调优专栏:https://blog.csdn.net/u014427391/article/category/8679315 对于局部的,比如某个页面列表sql,我们可以使用Oracle的 ...
- 【机器学习】--Python机器学习库之Numpy
一.前述 NumPy(Numerical Python的缩写)是一个开源的Python科学计算库.使用NumPy,就可以很自然地使用数组和矩阵. NumPy包含很多实用的数学函数,涵盖线性代数运算.傅 ...
- mysql的学习笔记(九)
mysql不支持FULL JOIN时可用UNION ALL代替 SELECT t1.user_id,t2.user_name FROM t1 LIFT JOIN t2 ON t1.user_id = ...
- 《HelloGitHub》第 27 期
公告 网站新增了简单的搜索功能,可以通过项目名称或地址搜索.查看项目.欢迎star和推荐项目,我们一只在路上,希望志同道合者加入进来. 现招募专栏负责人: C# Java <HelloGitHu ...
- debian The type initializer for 'System.Drawing.KnownColors' threw an exception
Change the "System.Drawing" reference of "CoreCompat.System.Drawing"if you thro ...