开发者社区> 问答> 正文

centos6.5 nginx1.8.1编译安装出错

经测试,6.5-7.2的 系统 ,安装nginx1.8.1时均会出错,有时能成功装上,不知何故? 安装 脚本为 阿里云 一键sh1.5:
tar zxvf nginx-1.8.1.tar.gz
cd nginx-1.8.1
./configure --user=www \
--group=www \
--prefix=/alidata/server/nginx \
--with-http_stub_status_module \
--without-http-cache \
--with-http_ssl_module \
--with-http_gzip_static_module
CPU_NUM=$(cat /proc/cpuinfo | grep processor | wc -l)
if [ $CPU_NUM -gt 1 ];then
    make -j$CPU_NUM
else
    make
fi
make install
chmod 775 /alidata/server/nginx/logs
chown -R www:www /alidata/server/nginx/logs
chmod -R 775 /alidata/www
chown -R www:www /alidata/www
cd ..
cp -fR ./nginx/config-nginx/* /alidata/server/nginx/conf/
sed -i 's/worker_processes  2/worker_processes  '"$CPU_NUM"'/' /alidata/server/nginx/conf/nginx.conf
chmod 755 /alidata/server/nginx/sbin/nginx
#/alidata/server/nginx/sbin/nginx
mv /alidata/server/nginx/conf/nginx /etc/init.d/
chmod +x /etc/init.d/nginx
/etc/init.d/nginx start



出错在make语句,如图:


展开
收起
秋日的私语 2016-12-12 18:07:04 3947 0
4 条回答
写回答
取消 提交回答
  • 目录切换错误,脚本不严谨。将cd..改为cd绝对路径即可。
    2016-12-15 09:42:58
    赞同 展开评论 打赏
  • Recentos6.5 nginx1.8.1编译安装出错
    一样的错误,阿里云ECS安装NGINX经常出错:
    objs/src/http/modules/ngx_http_ssi_filter_module.o \
    objs/src/http/modules/ngx_http_charset_filter_module.o \
    objs/src/http/modules/ngx_http_userid_filter_module.o \
    objs/src/http/modules/ngx_http_gzip_static_module.o \
    objs/src/http/modules/ngx_http_autoindex_module.o \
    objs/src/http/modules/ngx_http_auth_basic_module.o \
    objs/src/http/modules/ngx_http_access_module.o \
    objs/src/http/modules/ngx_http_limit_conn_module.o \
    objs/src/http/modules/ngx_http_limit_req_module.o \
    objs/src/http/modules/ngx_http_geo_module.o \
    objs/src/http/modules/ngx_http_map_module.o \
    objs/src/http/modules/ngx_http_split_clients_module.o \
    objs/src/http/modules/ngx_http_referer_module.o \
    objs/src/http/modules/ngx_http_rewrite_module.o \
    objs/src/http/modules/ngx_http_ssl_module.o \
    objs/src/http/modules/ngx_http_proxy_module.o \
    objs/src/http/modules/ngx_http_fastcgi_module.o \
    objs/src/http/modules/ngx_http_uwsgi_module.o \
    objs/src/http/modules/ngx_http_scgi_module.o \
    objs/src/http/modules/ngx_http_memcached_module.o \
    objs/src/http/modules/ngx_http_empty_gif_module.o \
    objs/src/http/modules/ngx_http_browser_module.o \
    objs/src/http/modules/ngx_http_upstream_hash_module.o \
    objs/src/http/modules/ngx_http_upstream_ip_hash_module.o \
    objs/src/http/modules/ngx_http_upstream_least_conn_module.o \
    objs/src/http/modules/ngx_http_upstream_keepalive_module.o \
    objs/src/http/modules/ngx_http_stub_status_module.o \
    objs/ngx_modules.o \
    -lpthread -lcrypt -lpcre -lssl -lcrypto -ldl -lz
    make[1]: Leaving directory `/home/sh/nginx-1.8.1'
    make -f objs/Makefile manpage
    make[1]: Entering directory `/home/sh/nginx-1.8.1'
    sed -e "s|%%PREFIX%%|/alidata/server/nginx|" \
    -e "s|%%PID_PATH%%|/alidata/server/nginx/logs/nginx.pid|" \
    -e "s|%%CONF_PATH%%|/alidata/server/nginx/conf/nginx.conf|" \
    -e "s|%%ERROR_LOG_PATH%%|/alidata/server/nginx/logs/error.log|" \
    < man/nginx.8 > objs/nginx.8
    make[1]: Leaving directory `/home/sh/nginx-1.8.1'
    make -f objs/Makefile install
    make[1]: Entering directory `/home/sh/nginx-1.8.1'
    test -d '/alidata/server/nginx' || mkdir -p '/alidata/server/nginx'
    test -d '/alidata/server/nginx/sbin' || mkdir -p '/alidata/server/nginx/sbin'
    test ! -f '/alidata/server/nginx/sbin/nginx' || mv '/alidata/server/nginx/sbin/nginx' '/alidata/server/nginx/sbin/nginx.old'
    cp objs/nginx '/alidata/server/nginx/sbin/nginx'
    test -d '/alidata/server/nginx/conf' || mkdir -p '/alidata/server/nginx/conf'
    cp conf/koi-win '/alidata/server/nginx/conf'
    cp conf/koi-utf '/alidata/server/nginx/conf'
    cp conf/win-utf '/alidata/server/nginx/conf'
    test -f '/alidata/server/nginx/conf/mime.types' || cp conf/mime.types '/alidata/server/nginx/conf'
    cp conf/mime.types '/alidata/server/nginx/conf/mime.types.default'
    test -f '/alidata/server/nginx/conf/fastcgi_params' || cp conf/fastcgi_params '/alidata/server/nginx/conf'
    cp conf/fastcgi_params '/alidata/server/nginx/conf/fastcgi_params.default'
    test -f '/alidata/server/nginx/conf/fastcgi.conf' || cp conf/fastcgi.conf '/alidata/server/nginx/conf'
    cp conf/fastcgi.conf '/alidata/server/nginx/conf/fastcgi.conf.default'
    test -f '/alidata/server/nginx/conf/uwsgi_params' || cp conf/uwsgi_params '/alidata/server/nginx/conf'
    cp conf/uwsgi_params '/alidata/server/nginx/conf/uwsgi_params.default'
    test -f '/alidata/server/nginx/conf/scgi_params' || cp conf/scgi_params '/alidata/server/nginx/conf'
    cp conf/scgi_params '/alidata/server/nginx/conf/scgi_params.default'
    test -f '/alidata/server/nginx/conf/nginx.conf' || cp conf/nginx.conf '/alidata/server/nginx/conf/nginx.conf'
    cp conf/nginx.conf '/alidata/server/nginx/conf/nginx.conf.default'
    test -d '/alidata/server/nginx/logs' || mkdir -p '/alidata/server/nginx/logs'
    test -d '/alidata/server/nginx/logs' || mkdir -p '/alidata/server/nginx/logs'
    test -d '/alidata/server/nginx/html' || cp -R html '/alidata/server/nginx'
    test -d '/alidata/server/nginx/logs' || mkdir -p '/alidata/server/nginx/logs'
    make[1]: Leaving directory `/home/sh/nginx-1.8.1'
    cp: cannot stat ‘./nginx/config-nginx/*’: No such file or directory
    mv: cannot stat ‘/alidata/server/nginx/conf/nginx’: No such file or directory
    chmod: cannot access ‘/etc/init.d/nginx’: No such file or directory
    ./install_nginx+php-1.8.1.sh: line 30: /etc/init.d/nginx: No such file or directory


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

    回 3楼匆匆过客ol的帖子
    cp -fR ./nginx/config-nginx/* /alidata/server/nginx/conf/
    这一句开始出错,这是阿里云最新的一键安装包。
    2016-12-12 18:39:17
    赞同 展开评论 打赏
  • 解决方案工程师,负责为企业规划上云迁移方案和云上架构设计,在网站建设开发和云计算领域有多年经验,专注于Linux平台的系统维护以及应用部署。致力于以场景化的方式让云计算,用更加通俗易懂的方式让更多人体验云计算,让云端的计算更质朴的落地。
    你把有error的代码贴出来呀
    2016-12-12 18:22:10
    赞同 展开评论 打赏
  • 有人说是pcre库问题,还有人说是ssl 版本问题,但通过yum还是wget下载编译安装,都一样在make时出错。 初始化系统盘,反复用这个脚本安装,有时又能正常通过。同样的系统,好奇怪。



    2016-12-12 18:08:41
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

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