Open jujes opened 8 years ago
I can't get it to work either. My file looks like this:
koken:
image: 'koken/koken-lemp'
restart: always
hostname: koken.example.com
ports:
- '8080:80'
environment:
- VIRTUAL_HOST=koken.example.com
volumes:
- './koken/data:/usr/share/nginx/www'
- './koken/db:/var/lib/mysql'
Log in to the admin interface, download a theme and make sure to configure your site to use that theme.
@5an1ty downloaded an additional theme, but I can't change the settings so that koken uses it. Do you also use a docker installation with port forwarding?
Yes, installed it regularly, I recall having a similar theme error, opened up the admin interface on yourip/admin and modified the theme settings there.
You have to go to the site section, then click on the themes button at the bottom of the page and activate the theme you selected. (I tried the theme elementary)
Not sure what this env variable does, don't think I set it: VIRTUAL_HOST=koken.example.com
I was able to fix this problem by modifying user_setup.php
and adding following line:
define('LOOPBACK_HOST_HEADER', true);
For new build change file deploy/php/user_setup.php
For already deployed app file is under storage/configuration/
@darklow your advice don't solve my fix.... someone know how fix it?
thanks in advance...
I use https
version: '2'
services:
web:
image: jujes/koken:0.22.23
hostname: koken.dev
# volumes:
# - $HOME/.docker/koken/html:/var/www/html
networks:
- docker_webgateway
- back
environment:
- VIRTUAL_HOST=koken.dev
labels:
- "traefik.domain=koken.dev"
- "traefik.enable=true"
- "traefik.backend=koken.dev"
- "traefik.frontend.rule=Host:koken.dev"
- "traefik.docker.network=docker_webgateway"
- "traefik.port=80"
links:
- db
db:
image: mysql:latest
environment:
- MYSQL_DATABASE=koken
- MYSQL_USER=koken
- MYSQL_PASSWORD=demo0909809
- MYSQL_ROOT_PASSWORD=demodododo
# volumes:
# - $HOME/.docker/koken/mysql:/var/lib/mysql
networks:
- back
restart: always
labels:
- "traefik.enable=false"
networks:
docker_webgateway:
external:
name: docker_webgateway
back:
driver: bridge
If you're running in your own machine (i.e., not a public URL), your koken container needs to access your host.
Try adding:
web:
extra_hosts:
- koken.dev: 10.254.254.254
Replace 10.254.254.254
with your host's IP, but you might want to make an alias so it's always available independently from your network.
sudo ifconfig en0 alias 10.254.254.254 255.255.255.0
Note: find your network interface, it might not be eth0.
This works for me.
I was facing the same issue while using the guide for Installing Koken to Digital Ocean droplet (via docker). The installation page was hanging. I added in user_setup.php:
define('LOOPBACK_HOST_HEADER', true);
under storage/configuration/
No need for any process restart, just refresh your browser. Your fresh new koken is there. It took me 1 week searching on web about this.
Thanks @darklow for sharing!
I had a similar issue even with define('LOOPBACK_HOST_HEADER', true);
when I had another host terminate the SSL connection:
+--------------------------+
| |
| Docker Host |
HTTPS | +----------------------+ |
+------------->+ | | |
| | NGINX Reverse Proxy | |
HTTP | | | |
+------------->+ | | |
| +--+-------------------+ |
| | |
| | HTTP Connection |
| | |
| +--v-------------------+ |
| | | |
| | Koken Host | |
| | | |
| | | |
| +----------------------+ |
+--------------------------+
If you have this problem then you will probably see weird characters in the koken apache/nginx log: \x16\x03\x01\x02
. The problem is that Koken determines the protocol it should use based on the web protocol used on the SSL-terminating proxy.
One option is to hack app/site/Koken.php
with the solution shown here - which is not sustainable if you wonder why your koken does not run after an update.
I managed to get around this by enabling SSL in the Dockerfile:
# Enable SSL for loopback connections
RUN a2ensite default-ssl
RUN a2enmod ssl
RUN make-ssl-cert generate-default-snakeoil --force-overwrite
EXPOSE 443
and exposing the koken host as an extra_hosts in the docker compose:
extra_hosts:
- ${DOMAIN}:127.0.0.1
Dockerfile and docker-compose.yml as a reference. If you are interested in my setup I have it here: https://github.com/pspoerri/docker-koken-letsencrypt (I still need to document and test it properly).
This is getting even more weird, under different server and different docker setup using docker-compose.yml in order to fix this issue I needed to do exact opposite - remove this line which I added to for previous setup to work define('LOOPBACK_HOST_HEADER', true);
API Error
The theme is not able to make contact with your Koken installation. Contact your host to see if they are blocking loopback connections.
proxy script
docker run -d -p 80:80 -p 443:443 -v /etc/nginx/certs:/etc/nginx/certs -v /var/run/docker.sock:/tmp/docker.sock:ro --name=proxy --restart=always jwilder/nginx-proxy
docker-compose.yml
someone know how fix it?