Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No such file or directoryodule-vts/config: line 2: auto/have #273

Open
waterCoding opened this issue Jun 27, 2023 · 2 comments
Open

No such file or directoryodule-vts/config: line 2: auto/have #273

waterCoding opened this issue Jun 27, 2023 · 2 comments

Comments

@waterCoding
Copy link

i use it by docker ,but find some errors

: No such file or directoryodule-vts/config: line 2: auto/have

this is Dockerfile

`
FROM centos:centos7

#安装相关依赖
RUN yum -y update
RUN yum -y install gcc gcc-c++ autoconf automake make
RUN yum -y install zlib zlib-devel openssl* pcre* wget lua-devel

#MAINTAINER 维护者信息
MAINTAINER zyb [email protected]

#ADD 获取url中的文件,放在当前目录下
ADD http://nginx.org/download/nginx-1.20.2.tar.gz /tmp/

拷贝文件夹到/usr/local/目录下,并切换到该目录

COPY ./nginx-module-vts/ /usr/local/nginx-module-vts/

#切换目录
WORKDIR /tmp
RUN mkdir -p {/usr/local/nginx/logs,/var/lock}

#编译安装Nginx
RUN useradd -M -s /sbin/nologin nginx
RUN tar -zxvf nginx-1.20.2.tar.gz -C /tmp/
RUN mkdir -p /usr/local/nginx

RUN cd /tmp/nginx-1.20.2
&& ./configure --prefix=/etc/nginx --user=nginx --group=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
--with-http_stub_status_module
--with-http_ssl_module
--with-http_sub_module
--add-dynamic-module=/usr/local/nginx-module-vts
&& make && make install

#参数说明
#--prefix 用于指定nginx编译后的安装目录
#--add-module 为添加的第三方模块,此次添加了fdfs的nginx模块
#--with..._module 表示启用的nginx模块,如此处启用了http_ssl_module模块

RUN /etc/nginx/sbin/nginx -c /etc/nginx/nginx.conf
RUN ln -s /usr/local/nginx/sbin/* /usr/local/sbin/

#EXPOSE 映射端口
EXPOSE 80 443

#CMD 运行以下命令
#CMD ["nginx"]
CMD ["/etc/nginx/sbin/nginx","-g","daemon off;"]
`

@waterCoding waterCoding changed the title auto have .... No such file or directoryodule-vts/config: line 2: auto/have Jun 27, 2023
@u5surf
Copy link
Collaborator

u5surf commented Jun 29, 2023

@waterCoding
Hi, Thanks report!
I tried to build almost the same the dockerfile which you suggested but it worked fine.

dockerfile:

RUN yum -y update
RUN yum -y install gcc gcc-c++ autoconf automake make
RUN yum -y install zlib zlib-devel openssl* pcre* wget lua-devel

WORKDIR /tmp
ADD http://nginx.org/download/nginx-1.20.2.tar.gz /tmp/
COPY ./nginx-module-vts/ /usr/local/nginx-module-vts/
RUN mkdir -p {/usr/local/nginx/logs,/var/lock}

RUN useradd -M -s /sbin/nologin nginx
RUN tar -zxvf nginx-1.20.2.tar.gz -C /tmp/
RUN mkdir -p /usr/local/nginx

RUN cd /tmp/nginx-1.20.2 && ./configure --prefix=/etc/nginx --user=nginx --group=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 \
--with-http_stub_status_module \
--with-http_ssl_module \
--with-http_sub_module \
--add-dynamic-module=/usr/local/nginx-module-vts && make && make install

RUN /etc/nginx/sbin/nginx -c /etc/nginx/nginx.conf
RUN ln -s /usr/local/nginx/sbin/* /usr/local/sbin/

EXPOSE 80 443

CMD ["/etc/nginx/sbin/nginx","-g","daemon off;"]

image:

% docker images
REPOSITORY                  TAG                          IMAGE ID       CREATED          SIZE
<none>                      <none>                       7881d08789ca   14 minutes ago   1.15GB

docker container:

% docker run -d 7881d08789ca
4f37b618a3bf051412dfc557182c4e63e2f01f145c7f64767beaeb1142cda57d
%
% docker ps -a
CONTAINER ID   IMAGE                            COMMAND                  CREATED          STATUS                      PORTS
NAMES
4f37b618a3bf   7881d08789ca                     "/etc/nginx/sbin/ngi…"   4 seconds ago    Up 3 seconds                80/tcp, 443/tcp

@ascarl2010
Copy link

老铁,解决了吗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants