ubuntu15.10_x64 安装 nginx

 

浏览器到 http://nginx.org/en/download.html

下载 stable version的nginx 如nginx-1.10.1.tar.gz,这是一个nginx源码包,需要经过编译和安装才能使用。

解压命令: tar –zxvf  nginx-1.10.1.tar.gz

cd nginx解压目录 :  ./configure 命令
 

   问题一:gcc和gcc++ 编译器未安装

   ./configure: error:    C compiler cc is not found
   解决:安装gc++
    sudo apt-get install gcc
    sudo apt-get install gcc++

   
    问题二: http模块缺少prce正则表达式库
    ./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.
    解决:安装pcre库

    sudo apt-get install libpcre3 libpcre3-dev

 

   问题三: http gzip 模块缺少  zlib库
    ./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.
    解决:安装zlib库

    $ sudo apt-get install zlib1g
    $ sudo apt-get install zlib1g.dev

 

再次:./configure

编译 make

安装 make install

 

进入nginx安装目录

cd /usr/local/

ls  可以看到nginx,则代表nginx在ubuntu上安装成功了

进入  cd /usr/local/nginx/sbin

sudo ./nginx  启动nginx

 

若nginx没有启动成功,很可能是80端口被占用了,更换一下端口即可(编辑conf/nginx.conf文件  80改为81)

http://localhost

时间: 2024-08-28 18:46:57

ubuntu15.10_x64 安装 nginx的相关文章

编译安装Nginx

############## 安装OpenSSL ######################wget https://www.openssl.org/source/openssl-1.0.2l.tar.gztar zxvf openssl-1.0.2l.tar.gzcd openssl-1.0.2l/./config --prefix=/opt/local/openssl :make && sudo make install ################ 安装PCRE #######

centos7编译安装nginx

linux及nginx版本 CentOS Linux release 7.2.1511 nginx-1.11.9 第一步安装依赖包 [[email protected] ~]# yum -y install pcre pcre-devel gcc openssl openssl-devel 第二步创建nginx用户 [[email protected] ~]# useradd nginx -s /sbin/nologin -M 第三部进入下载的nginx目录下编译 [[email protect

配置LANMP环境(5)-- 安装NGINX与配置

安装nginx yum install nginx 若提示找不到nginx,则在软件源中添加nginx的软件源文件: vim /etc/yum.repos.d/nginx.repo 添加如下内容: [nginx] name=nginx repo baseurl=http://nginx.org/packages/mainline/centos/7/$basearch/ gpgcheck=0 enabled=1 在根目录中创建data文件夹,在data文件夹中创建nginx文件夹,里面放置ngin

CentOS下安装Nginx

1 nginx安装环境 nginx是C语言开发,建议在linux上运行,本教程使用Centos6.5作为安装环境.  gcc 安装nginx需要先将官网下载的源码进行编译,编译依赖gcc环境,如果没有gcc环境,需要安装gcc:yum install gcc-c++  PCRE PCRE(Perl Compatible Regular Expressions)是一个Perl库,包括 perl 兼容的正则表达式库.nginx的http模块使用pcre来解析正则表达式,所以需要在linux上安装pc

003.安装nginx(lnmp)

一.下载nginx 下载nginx源码包,解压: [[email protected] ~]# cd /usr/local/src/ [[email protected] src]# wget http://nginx.org/download/nginx-1.6.2.tar.gz[[email protected] src]# tar zxvf nginx-1.6.2.tar.gz [[email protected] src]# cd nginx-1.6.2 二.安装nginx [[emai

今天用pro安装nginx+php+mysql出现问题的解决方法

今天用pro安装nginx+php+mysql出现问题的解决方法 by 伍雪颖 dyld: Library not loaded: @@[email protected]@/openssl/1.0.1h/lib/libcrypto.1.0.0.dylib Referenced from: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib Reason: image not found 解决方法:重装openssl Starting MySQL . ERR

CentOS7 安装 Nginx 1.12.1

安装准备: nginx 依赖的一些 lib 库: yum install gcc-c++ yum install pcre pcre-devel yum install zlib zlib-devel yum install openssl openssl--devel 安装 Nginx 检查一下安装已有的 nginx find -name nginx 如果系统安装了Nginx,那么卸载 yum remove nginx 然后开始安装,首先进入 /usr/local 目录 cd /usr/loc

安装nginx 配置虚拟主机

nginx安装 #查看操作系统版本 [[email protected] ~]# cat /etc/redhat-release CentOS Linux release 7.3.1611 (Core) #查看内核版本和64位还是32位 [[email protected] ~]# uname -a Linux master1 3.10.0-514.el7.x86_64 #1 SMP Tue Nov 22 16:42:41 UTC 2016 x86_64 x86_64 x86_64 GNU/Li

一键安装nginx脚本

#!/bin/bash . /etc/init.d/functions #安装依赖包 yum -y install pcre-devel openssl-devel #创建相关目录,并下载nginx软件包 [ ! -d /application ] && mkdir -p /application [ ! -d /server/tools ] && mkdir -p /server/tools cd /server/tools wget http://nginx.org/d