我正在尝试在服务器上运行容器化的 Apache httpd

这是我的docker-compose.yml文件

version: '3'
services:
  httpd:
    container_name: httpd
    image: httpd:latest
    network_mode: host
docker-compose up

如下所示:

Recreating httpd ... done
Attaching to httpd
httpd    | AH00557: httpd: apr_sockaddr_info_get() failed for blast.server.com
httpd    | AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
httpd    | AH00557: httpd: apr_sockaddr_info_get() failed for blast.server.com
httpd    | AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
httpd    | [Thu Oct 24 19:12:27.242433 2024] [mpm_event:notice] [pid 1:tid 1] AH00489: Apache/2.4.62 (Unix) configured -- resuming normal operations
httpd    | [Thu Oct 24 19:12:27.263452 2024] [core:notice] [pid 1:tid 1] AH00094: Command line: 'httpd -D FOREGROUND'
httpd    | [Thu Oct 24 19:12:27.243243 2024] [mpm_event:alert] [pid 9:tid 9] (1)Operation not permitted: AH00480: ap_thread_create: unable to create worker thread
httpd    | [Thu Oct 24 19:12:27.243243 2024] [mpm_event:alert] [pid 10:tid 10] (1)Operation not permitted: AH00480: ap_thread_create: unable to create worker thread
httpd    | [Thu Oct 24 19:12:27.243405 2024] [mpm_event:alert] [pid 11:tid 11] (1)Operation not permitted: AH00480: ap_thread_create: unable to create worker thread
httpd    | [Thu Oct 24 19:12:29.265647 2024] [mpm_event:alert] [pid 1:tid 1] AH02324: A resource shortage or other unrecoverable failure was encountered before any child process initialized successfully... httpd is exiting!
httpd exited with code 0

因为它在 pid 9、10 处退出……这是否意味着我的机器配置为只有 8 个 pid/线程,并且前 8 个已经创建?我应该在conf文件中调整什么(以及哪个文件)?会是那个吗ThreadsPerChild?第一次通过 docker 运行 apache,在实时服务器上没有遇到过这个问题。

4

  • 1
    配置是什么?如何运行 docker?容器使用什么命令行?


    – 

  • 配置与图像中的配置相同。hub.docker.com layers/library /httpd/latest/images/… 我认为 docker-compose 调用等于docker run -d -net host httpd:latest (或类似)


    – 

  • 你使用无根 docker 吗?


    – 

  • 不,我不知道,正常安装吗?


    – 

0