求助:编译安装Nginx时的报错,请教,谢谢!
报错信息:-bash: --conf-path=/etc/nginx/nginx.conf: No such file or directoryOS:CentOS7 Mini
步骤:
yum groupinstall "Development Tools" "Server Platform Development"
yum install pcre-devel openssl-devel zlib-devel -y
cd /usr/local/src
wget NGINX的链接
tar xf nginx-1.11.2.tar.gz-C /usr/local/
cd /usr/src/
ln -s nginx-1.11.2 nginx
cd nginx/
groupadd -r nginx
useradd -r -g nginx -s /sbin/nologin -M nginx
mkdir -pv /var/tmp/nginx/{client,proxy,fastcgi}
./configure --prefix=/usr/local/nginx \
> --conf-path=/etc/nginx/nginx.conf \
> --user=nginx --group=nginx \
> --error-log-path=/var/log/nginx/error.log \
> --http-log-path=/var/log/nginx/access.log \
> --pid-path=/var/run/nginx/nginx.pid \
> --lock-path=/var/lock/nginx.lock \
> --with-http_v2_module \
> --with-http_ssl_module \
> --with-http_stub_status_module \
> --with-http_gzip_static_module \
> --with-http_flv_module \
> --with-http_mp4_module \
> --http-client-body-temp-path=/var/tmp/nginx/client \
> --http-proxy-temp-path=/var/tmp/nginx/proxy \
> --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi
然后就出现了第一行的报错,此时/etc/下没有nginx目录
请教各位这是什么问题,请指导,谢谢 你把编译参数简单化
直接 ./configure && make install clean 很多人学习这些老古董技术的时候,都是直接抄袭老的config编译参数
这点官方网站的做法就是最简单,需要的模块可以根据需求定制
参数部分根本就没必要,nginx配置文件自己手动配置不挺好的么?? 感觉似乎是权限问题,但是对比之下,又似乎没有问题
安装过程中使用的是root账号 那咱不安装./configure && make 这个问题就是今天才出现,这些编译参数昨天在另外一台VM上测试是成功的
而VM本身(Centos)是从模板部署出来的 错误信息是依赖文件系统的一个目录文件
但是对编译nginx来说,不是必要的步骤 感觉是没有权限建立目录和文件
依次删除编译的参数,但凡涉及到指定目录的,就都报错,比如:
删除了--conf-path=/usr/local/nginx/nginx.conf
报错就变成了:-bash: --error-log-path=/var/log/nginx/error.log: No such file or directory
因为在编译参数里面有这样的指定 不加任何编译参数,直接./configure 通过
make && make install 通过
但是启动nginx进程就失败
# ./nginx
nginx: could not open error log file: open() "/usr/local/nginx/logs/error.log" failed (2: No such file or directory)
2016/07/17 16:12:56 22424#0: open() "/usr/local/nginx/logs/access.log" failed (2: No such file or directory)
感觉是没有权限创建文件,之前的报错应该也是创建目录和文件失败
请问有人能指点一下吗,谢谢
页:
[1]
2