Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No access through web #23

Open
ezmiller opened this issue Jan 9, 2017 · 8 comments
Open

No access through web #23

ezmiller opened this issue Jan 9, 2017 · 8 comments

Comments

@ezmiller
Copy link

ezmiller commented Jan 9, 2017

Hi, I ran your command list from the README, i.e.:

git clone https://github.com/indiehosters/piwik.git
cd piwik
MYSQL_ROOT_PASSWORD=mystrongpassword docker-compose up

But there's no access through the web. I'm wondering if there are dependencies or other steps that haven't been listed in the README...

@ezmiller
Copy link
Author

ezmiller commented Jan 9, 2017

Here are some errors in the output:

Warning: require(/var/www/html/config/global.php): failed to open stream: No such file or directory in /var/www/html/vendor/php-di/php-di/src/DI/Definition/Source/Defi
nitionFile.php on line 56
cron_1 |
cron_1 | Fatal error: require(): Failed opening required '/var/www/html/config/global.php' (include_path='/var/www/html/vendor/pear/pear_exception:/var/www/html/vendor/pear/con
sole_getopt:/var/www/html/vendor/pear/pear-core-minimal/src:/var/www/html/vendor/pear/archive_tar:.:/usr/local/lib/php') in /var/www/html/vendor/php-di/php-di/src/DI/Definition/
Source/DefinitionFile.php on line 56

@jimklo
Copy link

jimklo commented Jan 17, 2017

This config is designed to work with another set of containers for load balancing. Basically by default there are no ports exposed to your host.

I was having the same issue as I don't need to do that, I'm hoping to use this setup to develop a PIWIK plugin.

I've tried modifying the docker-compose.yml to expose the host ports on the web service, and then commented out the lb_web network:

version: '2'
networks:
  # lb_web:
  #   external: true
  back:
    driver: bridge
services:
  db:
    image: mysql
    volumes:
      - ./mysql/runtime:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD
    networks:
      - back
  app:
    image: piwik
    links:
      - db
    volumes:
      - ./config:/var/www/html/config
    networks:
      - back
  web:
    image: nginx
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf:ro
    links:
      - app
    volumes_from:
      - app
    environment:
      - VIRTUAL_HOST
    networks:
      - back
      # - lb_web
    ports:
      - "8080:80"
      - "8443:443"
  cron:
    image: piwik
    links:
      - db
    volumes_from:
      - app
    entrypoint: |
      bash -c 'bash -s <<EOF
      trap "break;exit" SIGHUP SIGINT SIGTERM
      while /bin/true; do
        su -s "/bin/bash" -c "/usr/local/bin/php /var/www/html/console core:archive" www-data
        sleep 3600
      done
      EOF'
    networks:
      - back

Once saved, if when you docker-compose up -d you should be able to reach the PIWIK server on http://localhost:8080.

@kvordf
Copy link

kvordf commented Apr 11, 2017

I tryed following the step above, but am still getting the same errors. I also tried installing nginx, but that didn't make a huge difference. Is any body else have the same problems? It looks like /var/www/* is missing for me.

Thanks
Khanh

@jaymjax1
Copy link

@kvordf Had this problem too. When you add the port to the yml file and save, be sure you do a docker-compose down then docker-compose up. At first I was doing docker stop webserver, but that wasn't the solution.

@loleg
Copy link

loleg commented Jun 14, 2017

I think it would be good to link to Docker Compose networking and give a quick example of the host config in the README.

@madnight
Copy link

madnight commented Jul 9, 2017

the only problem, in order to get it working on localhost, is the missing port mapping

ports:
      - "80:80"
      - "443:443"

This is like the EXPOSE command inside of docker and necessary to expose the docker ports to localhost.
https://github.com/indiehosters/piwik/pull/26/files

@josmitc
Copy link

josmitc commented Oct 5, 2017

To run this locally I had to change these things in the docker-compose file:

  1. lb_web network to external: false
  2. under the web service I added ports 8080:80

@MuLoo
Copy link

MuLoo commented Mar 1, 2024

This config is designed to work with another set of containers for load balancing. Basically by default there are no ports exposed to your host.此配置旨在与另一组容器一起使用以实现负载均衡。基本上,默认情况下,没有端口暴露给您的主机。

I was having the same issue as I don't need to do that, I'm hoping to use this setup to develop a PIWIK plugin.我遇到了同样的问题,因为我不需要这样做,我希望使用此设置来开发 PIWIK 插件。

I've tried modifying the docker-compose.yml to expose the host ports on the web service, and then commented out the lb_web network:我尝试修改docker-compose.yml以公开 Web 服务上的主机端口,然后注释掉 lb_web 网络:

version: '2'
networks:
  # lb_web:
  #   external: true
  back:
    driver: bridge
services:
  db:
    image: mysql
    volumes:
      - ./mysql/runtime:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD
    networks:
      - back
  app:
    image: piwik
    links:
      - db
    volumes:
      - ./config:/var/www/html/config
    networks:
      - back
  web:
    image: nginx
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf:ro
    links:
      - app
    volumes_from:
      - app
    environment:
      - VIRTUAL_HOST
    networks:
      - back
      # - lb_web
    ports:
      - "8080:80"
      - "8443:443"
  cron:
    image: piwik
    links:
      - db
    volumes_from:
      - app
    entrypoint: |
      bash -c 'bash -s <<EOF
      trap "break;exit" SIGHUP SIGINT SIGTERM
      while /bin/true; do
        su -s "/bin/bash" -c "/usr/local/bin/php /var/www/html/console core:archive" www-data
        sleep 3600
      done
      EOF'
    networks:
      - back

Once saved, if when you docker-compose up -d you should be able to reach the PIWIK server on http://localhost:8080.保存后,如果当您能够 docker-compose up -d 访问 PIWIK 服务器时 http://localhost:8080

thank you ! it works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants