我使用以下参数运行docker容器;
docker run -d \ -v "$(pwd)/data/logs:/logs" \ -v "$(pwd)/data/auth:/auth" \ -v "/mnt/data:/data" \ -v "$(pwd)/data/dav.config:/usr/local/apache2/conf/dav.conf" \ --memory="2g" \ --cpu-shares=1024 \ --read-only="true" \ --tmpfs /tmp --tmpfs /run \ --restart="always" \ --name dav \ dav
但是,当启动httpd时,我得到;
[Wed May 11 10:26:32.938887 2016] [auth_digest:notice] [pid 1:tid 139835054438272] AH01757: generating secret for digest authentication ... [Wed May 11 10:26:32.939164 2016] [auth_digest:error] [pid 1:tid 139835054438272] (30)Read-only file system: AH01762: Failed to create shared memory segment on file /usr/local/apache2/logs/authdigest_shm.1 [Wed May 11 10:26:32.939194 2016] [auth_digest:error] [pid 1:tid 139835054438272] (30)Read-only file system: AH01760: failed to initialize shm - all nonce-count checking, one-time nonces, and MD5-sess algorithm disabled [Wed May 11 10:26:32.939210 2016] [:emerg] [pid 1:tid 139835054438272] AH00020: Configuration Failed, exiting
我不知道任何指令来指定/usr/local/apache2/logs/authdigest_shm.1的位置。 / run和/ tmp是tmpfs,其余是只读的。 有任何想法吗?
尝试更改DefaultRuntimeDir指令值
DefaultRuntimeDir指令设置服务器将在其中创build各种运行时文件(共享内存,锁等)的目录。 如果设置为相对path,则完整path将相对于ServerRoot。
请参阅: https : //httpd.apache.org/docs/2.4/mod/core.html#defaultruntimedir