Open jujes opened 8 years ago
The file '/owncloud/dhparam.pem' seems to be missing. This file should be generated on the first run of a container. Are you just running 'make owncloud-production'? Any modifications to the makefile? And what do you mean with 'with/without :ro'?
Hi @FreekKalter,
True: I have only this files into /owncloud = 3party_apps.conf docker_image_owncloud.config.php
Here is my step by step running script =
-- step 0 sudo apt-get install pwgen
-- step 1 git clone https://github.com/jchaney/owncloud.git && cd owncloud
-- step 2 make owncloud-mariadb
Failed to remove container (owncloud-mariadb): Error response from daemon: No such container: owncloud-mariadb
make: [owncloud-mariadb] Error 1 (ignored)
docker run --detach \
--name "owncloud-mariadb" \
--env "TZ=Europe/Berlin" \
--volume /tmp/owncloud/db:/var/lib/mysql \
--env "MYSQL_ROOT_PASSWORD=6X0DuQFNV4lJOkOt9M8vA9NlG0jgYACXpgJlO24x" \
--env "MYSQL_USER=owncloud-production" \
--env "MYSQL_DATABASE=owncloud-production" \
--env "MYSQL_PASSWORD=MLcuLuh4ZEq316TR5aB0g7filCnktGtZdA6q2BFG" \
mariadb
77f50248b314103064cfe4e4f8608f2e5b07093d86350e4abfbdb690ebebdd1e
-- step 3 make owncloud-production
owncloud-mariadb
docker run --detach \
--name "owncloud-mariadb" \
--env "TZ=Europe/Berlin" \
--volume /tmp/owncloud/db:/var/lib/mysql \
--env "MYSQL_ROOT_PASSWORD=nvJ3pfSE8b0Hm29kCMUVuS03lsStj8jG4FZD4TAc" \
--env "MYSQL_USER=owncloud-production" \
--env "MYSQL_DATABASE=owncloud-production" \
--env "MYSQL_PASSWORD=06Bls3lc2nC6lJQZQyh18OGPMwFdXNKMGOutNJ51" \
mariadb
37ee122d674c9971a93b3bbf755d4c3249708e311e9c4b42a3d1c36b46506b74
Failed to remove container (owncloud-production): Error response from daemon: No such container: owncloud-production
make: [owncloud-production] Error 1 (ignored)
docker run --detach \
--name "owncloud-production" \
--env "TZ=Europe/Berlin" \
--link owncloud-mariadb:db \
--publish 80:80 \
--publish 443:443 \
--volume "/tmp/owncloud/data:/var/www/owncloud/data" \
--volume "/tmp/owncloud/additional_apps:/var/www/owncloud/apps_persistent" \
--volume "/tmp/owncloud/config:/owncloud" \
--volume "/etc/ssl/certs/ssl-cert-snakeoil.pem:/etc/ssl/certs/ssl-cert-snakeoil.pem:ro" \
--volume "/etc/ssl/private/ssl-cert-snakeoil.key:/etc/ssl/private/ssl-cert-snakeoil.key:ro" \
--env "OWNCLOUD_IN_ROOTPATH=1" \
--env "OWNCLOUD_SERVERNAME=localhost" \
--env "SSL_CERT=/etc/ssl/certs/ssl-cert-snakeoil.pem" \
--env "SSL_KEY=/etc/ssl/private/ssl-cert-snakeoil.key" \
--env "DB_ENV_MYSQL_USER=overwrite" \
--env "DB_ENV_MYSQL_PASSWORD=overwrite" \
--env "DB_ENV_MYSQL_DATABASE=overwrite" \
--env "DB_ENV_MYSQL_ROOT_PASSWORD=overwrite" \
jchaney/owncloud
48cb675ad3797213599cbbda8c0d4a28fa46243a69418f0ab55492cc627b0362
-- step 4 docker exec -it owncloud-production bash
-- step 5 nginx -t
nginx: [emerg] PEM_read_bio_X509_AUX("/etc/ssl/certs/ssl-cert-snakeoil.pem") failed (SSL: error:0906D06C:PEM routines:PEM_read_bio:no start line:Expecting: TRUSTED CERTIFICATE)
nginx: configuration file /etc/nginx/nginx.conf test failed
No modifications to the makefile
I mean about 'with/without :ro' this script change de way to load the .key and .pem certificates..
Thanks in advance, :+1:
Okay i see. If you want to run 'nginx -t' like this, there should be a step between 4&5. If you use 'docker run' without arguments it runs a bootstrap script which generates dhparams if it is not present jet. So if you start the docker container with bash, like you did in step 4, you need to either run '/usr/local/bin/bootstrap.sh' or just the command wich generates the file 'openssl dhparam -out /owncloud/dhparam.pem 4096'. Let me know if this works. Op woensdag 2 maart 2016 heeft jujes notifications@github.com het volgende geschreven:
Hi @FreekKalter https://github.com/FreekKalter,
True: I have only this files into /owncloud = 3party_apps.conf docker_image_owncloud.config.php
Here is my step by step running script =
-- step 0 sudo apt-get install pwgen -- step 1 git clone https://github.com/jchaney/owncloud.git https://github.com/jchaney/owncloud.git && cd owncloud -- step 2 \ make owncloud-mariadb**
Failed to remove container (owncloud-mariadb): Error response from daemon: No such container: owncloud-mariadb make: [owncloud-mariadb] Error 1 (ignored) docker run --detach \ --name "owncloud-mariadb" \ --env "TZ=Europe/Berlin" \ --volume /tmp/owncloud/db:/var/lib/mysql \ --env "MYSQL_ROOT_PASSWORD=6X0DuQFNV4lJOkOt9M8vA9NlG0jgYACXpgJlO24x" \ --env "MYSQL_USER=owncloud-production" \ --env "MYSQL_DATABASE=owncloud-production" \ --env "MYSQL_PASSWORD=MLcuLuh4ZEq316TR5aB0g7filCnktGtZdA6q2BFG" \ mariadb 77f50248b314103064cfe4e4f8608f2e5b07093d86350e4abfbdb690ebebdd1e
-- step 3 \ make owncloud-production**
owncloud-mariadb docker run --detach \ --name "owncloud-mariadb" \ --env "TZ=Europe/Berlin" \ --volume /tmp/owncloud/db:/var/lib/mysql \ --env "MYSQL_ROOT_PASSWORD=nvJ3pfSE8b0Hm29kCMUVuS03lsStj8jG4FZD4TAc" \ --env "MYSQL_USER=owncloud-production" \ --env "MYSQL_DATABASE=owncloud-production" \ --env "MYSQL_PASSWORD=06Bls3lc2nC6lJQZQyh18OGPMwFdXNKMGOutNJ51" \ mariadb 37ee122d674c9971a93b3bbf755d4c3249708e311e9c4b42a3d1c36b46506b74 Failed to remove container (owncloud-production): Error response from daemon: No such container: owncloud-production make: [owncloud-production] Error 1 (ignored) docker run --detach \ --name "owncloud-production" \ --env "TZ=Europe/Berlin" \ --link owncloud-mariadb:db \ --publish 80:80 \ --publish 443:443 \ --volume "/tmp/owncloud/data:/var/www/owncloud/data" \ --volume "/tmp/owncloud/additional_apps:/var/www/owncloud/apps_persistent" \ --volume "/tmp/owncloud/config:/owncloud" \ --volume "/etc/ssl/certs/ssl-cert-snakeoil.pem:/etc/ssl/certs/ssl-cert-snakeoil.pem:ro" \ --volume "/etc/ssl/private/ssl-cert-snakeoil.key:/etc/ssl/private/ssl-cert-snakeoil.key:ro" \ --env "OWNCLOUD_IN_ROOTPATH=1" \ --env "OWNCLOUD_SERVERNAME=localhost" \ --env "SSL_CERT=/etc/ssl/certs/ssl-cert-snakeoil.pem" \ --env "SSL_KEY=/etc/ssl/private/ssl-cert-snakeoil.key" \ --env "DB_ENV_MYSQL_USER=overwrite" \ --env "DB_ENV_MYSQL_PASSWORD=overwrite" \ --env "DB_ENV_MYSQL_DATABASE=overwrite" \ --env "DB_ENV_MYSQL_ROOT_PASSWORD=overwrite" \ jchaney/owncloud 48cb675ad3797213599cbbda8c0d4a28fa46243a69418f0ab55492cc627b0362
-- step 4 docker exec -it owncloud-production bash -- step 5 nginx -t
nginx: [emerg] PEM_read_bio_X509_AUX("/etc/ssl/certs/ssl-cert-snakeoil.pem") failed (SSL: error:0906D06C:PEM routines:PEM_read_bio:no start line:Expecting: TRUSTED CERTIFICATE) nginx: configuration file /etc/nginx/nginx.conf test failed
No modifications to the makefile
I mean about 'with/without :ro' this script change de way to load the .key and .pem certificates..
Thanks in advance, [image: :+1:]
— Reply to this email directly or view it on GitHub https://github.com/jchaney/owncloud/issues/46#issuecomment-191481894.
Okay I tried both methods:
cp: cannot stat '/root/owncloud_config.php': No such file or directory
Copying nginx.conf with SSL support …
Generating prime for diffie-hellman key exchange …
Generating DH parameters, 4096 bit long safe prime, generator 2
This is going to take a long time
.................................... After a while, docker Exited (0) and don't want start if I use docker restart owncloud-production
exec: "openssl\ndhparam -out /owncloud/dhparam.pem 4096": stat openssl
dhparam -out /owncloud/dhparam.pem 4096: no such file or directory
:)
I think i know what is going on now.
You are missing some important options when using docker run
. The best way to use this project is through the Makefile. So everything you need to start the the db and the owncloud application is run make owncloud-production
. If you look at this target in the Makefile (also in the output of step 3 above), you see what happens when you run make. It starts a container with the owncloud app and specifies all the options and environment variables it needs to run:
docker run --detach \
--name "owncloud-production" \
--env "TZ=Europe/Berlin" \
--link owncloud-mariadb:db \
--publish 80:80 \
--publish 443:443 \
--volume "/tmp/owncloud/data:/var/www/owncloud/data" \
--volume "/tmp/owncloud/additional_apps:/var/www/owncloud/apps_persistent" \
--volume "/tmp/owncloud/config:/owncloud" \
--volume "/etc/ssl/certs/ssl-cert-snakeoil.pem:/etc/ssl/certs/ssl-cert-snakeoil.pem:ro" \
--volume "/etc/ssl/private/ssl-cert-snakeoil.key:/etc/ssl/private/ssl-cert-snakeoil.key:ro" \
--env "OWNCLOUD_IN_ROOTPATH=1" \
--env "OWNCLOUD_SERVERNAME=localhost" \
--env "SSL_CERT=/etc/ssl/certs/ssl-cert-snakeoil.pem" \
--env "SSL_KEY=/etc/ssl/private/ssl-cert-snakeoil.key" \
--env "DB_ENV_MYSQL_USER=overwrite" \
--env "DB_ENV_MYSQL_PASSWORD=overwrite" \
--env "DB_ENV_MYSQL_DATABASE=overwrite" \
--env "DB_ENV_MYSQL_ROOT_PASSWORD=overwrite" \
jchaney/owncloud
So when you just run the container named 'owncloud-production' it is missing the volumes wich contains the files it is missing. If you need to modify some behaviour, specify your own ssl key/certificate for example, the best way to this is to modify the variables at the top of the Makefile.
Hi @FreekKalter :) I'm using only make command for launch all. -- step 2 make owncloud-mariadb -- step 3 make owncloud-production
So I'm not running the container named 'owncloud-production'
Next, what I do is go into the container to see what happen with nginx, to make that, I use your advice: docker exec -it owncloud-production '/usr/local/bin/bootstrap.sh' or docker exec -it owncloud-production 'openssl dhparam -out /owncloud/dhparam.pem 4096'
and get:
cp: cannot stat '/root/owncloud_config.php': No such file or directory
Copying nginx.conf with SSL support …
Generating prime for diffie-hellman key exchange …
Generating DH parameters, 4096 bit long safe prime, generator 2
This is going to take a long time
After a while, docker Exited (0) and don't want start if I use docker restart owncloud-production or
exec: "openssl\ndhparam -out /owncloud/dhparam.pem 4096": stat openssl
dhparam -out /owncloud/dhparam.pem 4096: no such file or directory
Okay, i have to try it for myself. I will let you know tonight.
Op donderdag 3 maart 2016 heeft jujes notifications@github.com het volgende geschreven:
Hi @FreekKalter https://github.com/FreekKalter :) I'm using only make command for launch all. -- step 2 make owncloud-mariadb -- step 3 make owncloud-production
So I'm not run the container named 'owncloud-production'
Next, what I do is go into the container to see what happen with nginx, to make that, I use your advice: docker exec -it owncloud-production '/usr/local/bin/bootstrap.sh' or docker exec -it owncloud-production 'openssl dhparam -out /owncloud/dhparam.pem 4096'
and get:
cp: cannot stat '/root/owncloud_config.php': No such file or directory Copying nginx.conf with SSL support … Generating prime for diffie-hellman key exchange … Generating DH parameters, 4096 bit long safe prime, generator 2 This is going to take a long time
After a while, docker Exited (0) and don't want start if I use docker restart owncloud-production or
exec: "openssl\ndhparam -out /owncloud/dhparam.pem 4096": stat openssl dhparam -out /owncloud/dhparam.pem 4096: no such file or directory
— Reply to this email directly or view it on GitHub https://github.com/jchaney/owncloud/issues/46#issuecomment-191722065.
@FreekKalter some news?
Just for info...
I had the same issue this morning. nginx did not start with the same message.
I tried to execute $ docker exec -it owncloud-production 'openssl dhparam -out /owncloud/dhparam.pem 4096' rpc error: code = 2 desc = oci runtime error: exec failed: exec: "openssl dhparam -out /owncloud/dhparam.pem 4096": stat openssl dhparam -out /owncloud/dhparam.pem 4096: no such file or directory
and it did not work.
So I decided to attach to container and run the command just to see what happend. And strangely it worked.
$ docker exec -it owncloud-production bash root@4e7fe4d15a7f:/# openssl dhparam -out /owncloud/dhparam.pem 4096 Generating DH parameters, 4096 bit long safe prime, generator 2 This is going to take a long time .............................................................................+...[skip a lot of lines]
It took really a lot of time (probably two hours), but finally it finished and now my nginx (and owncloud) starts. Hope it helps.
I need set up the owncloud production environment but for some reason Nginx won't start... here the output for my container:
with :ro into Makefile owncloud-production: owncloud-mariadb
nginx: [emerg] BIO_new_file("/owncloud/dhparam.pem")failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/owncloud/dhparam.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file)
without :ro into Makefile owncloud-production: owncloud-mariadb
nginx: [emerg] PEM_read_bio_X509_AUX("/etc/ssl/certs/ssl-cert-snakeoil.pem") failed (SSL: error:0906D06C:PEM routines:PEM_read_bio:no start line:Expecting: TRUSTED CERTIFICATE)
Someone know how fix it? thanks in advance.