Container image has no envvar directory in /apache2/ and therefore I cannot restart apache

Steps to reproduce

  1. Install docker image for owncloud:10.5 with Docker Compose (and docker-compose.yml & .env files as presented in the official documentation
  2. Launch with docker-compose up -d
  3. Owncloud runs fine over http
  4. Try to configure the system in the container for SSL
  5. Log into the container with docker exec -ti XXXX bin/bash
  6. Try to stop, restart apache2

Expected behaviour

apache2 stops or restarts

Actual behaviour

Get following error:
root@xxxx: /etc/apache2/ # service apache2 stop
/etc/init.d/apache2: 46: .: Can’t open /etc/apache2/envvars
/etc/init.d/apache2: 57: .: Can’t open /etc/apache2/envvars
ERROR: APACHE_PID_FILE needs to be defined in /etc/apache2/envvars

When checking, there is no ennvars file in /etc/init.d/apache2

Server configuration

Operating system: official owncloud:10.5 container image

Web server:


PHP version:

**ownCloud version:1.5 (see ownCloud admin page)

**Updated from an older ownCloud or fresh install: fresh

Where did you install ownCloud from:

Signing status (ownCloud 9.0 and above):

Login as admin user into your ownCloud and access 
paste the results into and puth the link here.

The content of config/config.php:

Log in to the web-UI with an administrator account and click on
'admin' -> 'Generate Config Report' -> 'Download ownCloud config report'
This report includes the config.php settings, the list of activated apps
and other details in a well sanitized form.


If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your ownCloud installation folder

set -eo pipefail
[[ "${DEBUG}" == "true" ]] && set -x

  for FILE in $(find /etc/entrypoint.d -iname \*.sh | sort)
    source ${FILE}

if [[ "$(id -u)" == "0" ]]
  su-exec www-data php /var/www/owncloud/occ "${@}"
  php /var/www/owncloud/occ "${@}"

*ATTENTION:* Do not post your config.php file in public as is. Please use one of the above
methods whenever possible. Both, the generated reports from the web-ui and from occ config:list
consistently remove sensitive data. You still may want to review the report before sending.
If done manually then it is critical for your own privacy to dilligently
remove *all* host names, passwords, usernames, salts and other credentials before posting.
You should assume that attackers find such information and will use them against your systems.

List of activated apps:

If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your ownCloud installation folder.

Are you using external storage, if yes which one: local/smb/sftp/…

Are you using encryption: yes/no

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/…

LDAP configuration (delete this part if not used)

With access to your command line run e.g.:
sudo -u www-data php occ ldap:show-config
from within your ownCloud installation folder

Without access to your command line download the data/owncloud.db to your local
computer or access your SQL server remotely and run the select query:
SELECT * FROM `oc_appconfig` WHERE `appid` = 'user_ldap';

Eventually replace sensitive data as the name/IP-address of your LDAP server or groups.

Client configuration


Operating system:


Web server error log

Insert your webserver log here

ownCloud log (data/owncloud.log)

Insert your ownCloud log here

Browser log

Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log 
c) ...

As far as I know apache is running in foreground inside the container. So any init tool like service/systemctl won’t work here. To restart apache you have to restart the container.

However, if you exec into the container like so:

docker-compose exec owncloud entrypoint bash

(only works inside the folder where your docker-compose resides)

the env variables for apache will be properly set inside your session. Then you can use a tool like apache2ctl to control your apache service. However a restart will also restart the container, and your session will be terminated.

1 Like

I’m having the same issue. Trying to get this running in vsphere integrated containers. The old image from library/owncloud works, but trying to get the one from owncloud/server running has proven to be… somewhat impossible, at least for me. I’m setting all the variables listed on the docker install page on the container, but even the container itself cannot connect to port 80.

Figured it out!!! you have to add the environment variable APACHE_LISTEN to the container options. Apparently HTTP_PORT doesn’t do anything, even though that’s what done in the documentation.


My setup would connect port 80 and run fine out of the box. Trouble starts when trying to activate SSL for https connexion.


The initial image I tried would do that, but the new one that is not deprecated wouldn’t. I’m using a reverse proxy for SSL (which I believe is the recommended configuration anyway), which makes the SSL part a cinch. After many hours of trial and error I think I have a fully functioning OwnCloud instance.

1 Like