nginx学习2——ubuntu下配置nginx

    xiaoxiao2021-04-11  33

    安装C/C++编译器 #apt-get install gcc gcc安装相关构建工具 #apt-get install build-essential zlib安装:

    #wget http://www.zlib.net/zlib-1.2.11.tar.gz

    #tar -xvzf zlib-1.2.11.tar.gz

    #cd zlib-1.2.11.tar.gz #./configure #make #sudo make install

    pcre安装:

    #wget https://nchc.dl.sourceforge.net/project/pcre/pcre/8.40/pcre-8.40.tar.gz

    #tar -xvzf pcre-8.40.tar.gz

    #cd pcre-8.40 #./configure #make #sudo make install

    openssl 库安装

    #wget http://www.openssl.org/source/openssl-1.0.1e.tar.gz

    #cd openssl-1.0.1e/ #./configure 或者 #./config #make #sudo make install

    通过openssl version命令查看是否安装成功。

    libgd2-xpm安装

    #apt-get install libgd2-xpm libgd2-xpm-dev 

    nginx安装

    #wget http://nginx.org/download/nginx-1.12.0.tar.gz

    #tar zxvf nginx-1.2.0.tar.gz

    #cd nginx-1.2.0

    #./configure --prefix=/usr/nginx --with-http_ssl_module --with-http_image_filter_module

    或者

    #./configure --user=nginx --group=nginx --prefix=/usr/local/nginx --with-http_ssl_module--with-pcre=../pcre-8.40 --with-zlib=../zlib-1.2.11--with-openssl=../openssl-1.0.1e --with-http_stub_status_module  #make #make install

    启动nginx

    首先到如下目录

    #cd /usr/nginx/sbin/

    #sudo ./nginx

    进入浏览器输入http://localhost,如果看到如下界面,则配置成功

    注意:

    1.

    ./configure: error: the HTTP image filter module requires the GD library.   You can either do not enable the module or install the libraries.   ”   apt-get install libgd2-xpm libgd2-xpm-dev   2.每次安装都可以用

    echo $? 命令来检查是否有安装错误的地方

    转载请注明原文地址: https://ju.6miu.com/read-666548.html

    最新回复(0)