开发者社区> 问答> 正文

nginx编译安装报错,不知什么原因?


进行configure是正常的


./configure \
--prefix=/usr/local/nginx \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--pid-path=/var/run/nginx.pid \
--lock-path=/var/run/nginx.lock \
--http-client-body-temp-path=/var/cache/nginx/client_temp \
--http-proxy-temp-path=/var/cache/nginx/proxy_temp \
--http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \
--http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp \
--http-scgi-temp-path=/var/cache/nginx/scgi_temp \
--user=www \
--group=www \
--with-http_v2_module \
--with-http_ssl_module \
--with-http_realip_module \
--with-http_addition_module \
--with-http_sub_module \
--with-http_dav_module \
--with-http_flv_module \
--with-http_mp4_module \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-http_random_index_module \
--with-http_secure_link_module \
--with-http_stub_status_module \
--with-http_auth_request_module \
--with-mail \
--with-mail_ssl_module \
--with-file-aio \
--with-ipv6 \
--with-threads \
--with-stream \
--with-stream_ssl_module


make后报错,如图:



展开
收起
ydjy2009 2016-08-16 16:38:14 5422 0
3 条回答
写回答
取消 提交回答
  • configure 格式不对 不需要 \ 各个参数空格即可

    -------------------------

    回 6楼(ydjy2009) 的帖子
    这两个其实是相关的 配置和安装 配置时候虽然有验证但是不完全的 安装则是执行配置中的参数
    2016-08-18 18:00:40
    赞同 展开评论 打赏
  • 旺旺:nectar2。
    楼主您好,

    请问您使用的系统是什么版本呢?

    您是用现成的 lnamp 安装脚本来自动安装的,还是单独自行编译安装 nginx 呢?
    2016-08-17 09:16:54
    赞同 展开评论 打赏
  • 有没哪位能帮忙看下?

    -------------------------

    Re:回 2楼(dongshan8) 的帖子
    centos 7.2 64位系统。


    一、准备工作


    1.安装一些组件和库
    yum -y install gcc wget automake autoconf libtool libxml2-devel libxslt-devel perl-devel perl-ExtUtils-Embed pcre-devel openssl-devel zlib


    2.下载nginx
    cd /root/lnamp
    wget http://nginx.org/download/nginx-1.10.1.tar.gz


    二、安装nginx
    1.先创建用户和用户组
    groupadd www
    useradd -g www www -s /bin/false


    2.创建一个nginx目录用来存放运行的临时文件夹
    mkdir -p /var/cache/nginx


    3.开始安装nginx
    解压nginx
    tar zxvf nginx-1.10.1.tar.gz
    cd nginx-1.10.1


    2.进行configure
    ./configure \
    --prefix=/usr/local/nginx \
    --sbin-path=/usr/sbin/nginx \
    --conf-path=/etc/nginx/nginx.conf \
    --error-log-path=/var/log/nginx/error.log \
    --http-log-path=/var/log/nginx/access.log \
    --pid-path=/var/run/nginx.pid \
    --lock-path=/var/run/nginx.lock \
    --http-client-body-temp-path=/var/cache/nginx/client_temp \
    --http-proxy-temp-path=/var/cache/nginx/proxy_temp \
    --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \
    --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp \
    --http-scgi-temp-path=/var/cache/nginx/scgi_temp \
    --user=nobody \
    --group=nobody \
    --with-pcre \
    --with-http_v2_module \
    --with-http_ssl_module \
    --with-http_realip_module \
    --with-http_addition_module \
    --with-http_sub_module \
    --with-http_dav_module \
    --with-http_flv_module \
    --with-http_mp4_module \
    --with-http_gunzip_module \
    --with-http_gzip_static_module \
    --with-http_random_index_module \
    --with-http_secure_link_module \
    --with-http_stub_status_module \
    --with-http_auth_request_module \
    --with-mail \
    --with-mail_ssl_module \
    --with-file-aio \
    --with-ipv6 \
    --with-http_v2_module \
    --with-threads \
    --with-stream \
    --with-stream_ssl_module


    3.make && make install
    make && make install



    4.启动nginx
    /usr/sbin/nginx


    5.用ps aux来查看nginx是否启动
    ps aux|grep nginx




    6.然后配置服务
    vi /usr/lib/systemd/system/nginx.service


    按"i"输入以下内容


    [Unit]
    Description=nginx - high performance web server Documentation=http://nginx.org/en/docs/
    After=network.target remote-fs.target nss-lookup.target


    [Service]Type=forking
    PIDFile=/var/run/nginx.pid
    ExecStartPre=/usr/sbin/nginx -t -c /etc/nginx/nginx.conf
    ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf
    ExecReload=/bin/kill -s HUP $MAINPID
    ExecStop=/bin/kill -s QUIT $MAINPIDPrivateTmp=true


    [Install]
    WantedBy=multi-user.target


    编辑好后保存
    :wq!
    (注)
    [Unit]部分主要是对这个服务的说明,内容包括Description和After,Description用于描述服务,After用于描述服务类别


    [Service]部分是服务的关键,是服务的一些具体运行参数的设置,这里Type=forking是后台运行的形式,PIDFile为存放PID的文件路径,ExecStart为服务的具体运行命令,ExecReload为重启命令,ExecStop为停止命令,PrivateTmp=True表示给服务分配独立的临时空间,注意:[Service]部分的启动、重启、停止命令全部要求使用绝对路径,使用相对路径则会报错!


    [Install]部分是服务安装的相关设置,可设置为多用户的




    7.开启开机启动
    systemctl enable nginx.service


    8.测试配置文件
    用命令关掉nginx
    pkill -9 nginx


    后面可以用systemctl来操作nginx.service
    systemctl start nginx.service


    可以看到已启动成功
    访问ip会看到nginx的启动画面

    -------------------------

    以上是安装过程,有错误吗?

    -------------------------

    回 5楼(龙吟风) 的帖子
    .进行configure 通过,只是make出错
    2016-08-16 19:30:00
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
《Nginx 代理系统常用手册》 立即下载
CentOS Nginx PHP JAVA 多语言镜像使用手 立即下载
CentOS Nginx PHP JAVA多语言镜像使用手册 立即下载