1

I am running a docker container using following arguments;

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

However, when starting httpd, I get;

[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

I do not know any directives to specifiy the location of /usr/local/apache2/logs/authdigest_shm.1. /run and /tmp are tmpfs, rest is read-only. Any ideas?

  • The error "Read-only file system: AH01762" . It's a permission issue, Check if docker is able to wrte to filesystem or not – serverliving.com May 11 '16 at 10:34
  • @serverliving.com ; as I mentioned in my post, it is on purpose the root filesystem is read-only. (Docker best-practice) – nindustries May 11 '16 at 11:48
  • Th error says, it's unable to create file /usr/local/apache2/logs/authdigest_shm.1 , you need to provide appropriate permissions here, so file can be created under /usr/local/apache2/logs/ – serverliving.com May 11 '16 at 11:55
  • I know, but I would like to keep the root filesystem read-only. Another question is why it is created in the logs directory. – nindustries May 11 '16 at 11:58
  • Take a look https://httpd.apache.org/docs/2.4/mod/core.html#defaultruntimedir – Federico Sierra May 11 '16 at 14:53

1 Answers1

1

Try change DefaultRuntimeDir directive value

The DefaultRuntimeDir directive sets the directory in which the server will create various run-time files (shared memory, locks, etc.). If set as a relative path, the full path will be relative to ServerRoot.

See: https://httpd.apache.org/docs/2.4/mod/core.html#defaultruntimedir

Federico Sierra
  • 3,499
  • 1
  • 18
  • 24