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

http://symfony.localhost host not working on ubuntu 16.04 #110

Closed
shahzadthathal opened this issue Apr 16, 2019 · 3 comments
Closed

http://symfony.localhost host not working on ubuntu 16.04 #110

shahzadthathal opened this issue Apr 16, 2019 · 3 comments

Comments

@shahzadthathal
Copy link

shahzadthathal commented Apr 16, 2019

symfony.conf
server {
server_name symfony.localhost;
root /var/www/html/simple-api/symfony/public;

My project structure:

simple-api
 -elk
 -nginx
 -php-fpm
 -symfony
     --.env
 docker-compose.yml

I also added symfony.localhost in /etc/hosts

127.0.0.1	localhost
127.0.0.1 symfony.localhost

docker-compose.yml (in simple-api root folder)
I already have local running mysql, apache so I changed the ports.

version: '2'
services:
    db:
        image: mysql
        command: ["--default-authentication-plugin=mysql_native_password"]
        ports:
            - "3308:3308"
        environment:
            MYSQL_ROOT_PASSWORD: root
            MYSQL_DATABASE: symfony4-docker-2019
            MYSQL_USER: symfony4-docker-2019
            MYSQL_PASSWORD: symfony4-docker-2019
    php:
        build: ./php-fpm
        ports:
            - "9000:9001"
        volumes:
            - ./symfony:/var/www/html/simple-api/symfony:cached
            - ./logs/symfony:/var/www/html/simple-api/symfony/var/log:cached
        links:
            - db
        extra_hosts:
            - "docker-host.localhost:127.0.0.1"
    nginx:
        build: ./nginx
        ports:
            - "90:90"
        links:
            - php
        volumes:
            - ./logs/nginx:/var/log/nginx:cached
            - ./symfony:/var/www/html/simple-api/symfony:cached
    elk:
        image: willdurand/elk
        ports:
            - "81:80"
        volumes:
            - ./elk/logstash:/etc/logstash:cached
            - ./elk/logstash/patterns:/opt/logstash/patterns:cached
            - ./logs/symfony:/var/www/symfony/var/log:cached
            - ./logs/nginx:/var/log/nginx:cached


-symfony
--.env

DATABASE_URL=mysql://symfony4-docker-2019:symfony4-docker-2019@db/symfony4-docker-2019

And when I run sudo docker-compose up db_1 container hanged on this point.

Creating network "simpleapi_default" with the default driver
Creating simpleapi_db_1
Creating simpleapi_elk_1
Creating simpleapi_php_1
Creating simpleapi_nginx_1
Attaching to simpleapi_db_1, simpleapi_elk_1, simpleapi_php_1, simpleapi_nginx_1
db_1     | Initializing database
elk_1    | 2019-04-16 09:01:07,908 CRIT Supervisor running as root (no user in config file)
elk_1    | 2019-04-16 09:01:07,909 WARN Included extra file "/etc/supervisor/conf.d/kibana.conf" during parsing
elk_1    | 2019-04-16 09:01:07,909 WARN Included extra file "/etc/supervisor/conf.d/logstash.conf" during parsing
php_1    | [16-Apr-2019 09:01:13] NOTICE: PHP message: PHP Warning:  Version warning: Imagick was compiled against Image Magick version 1799 but version 1800 is loaded. Imagick will run but may behave surprisingly in Unknown on line 0
elk_1    | 2019-04-16 09:01:07,909 WARN Included extra file "/etc/supervisor/conf.d/elasticsearch.conf" during parsing
elk_1    | 2019-04-16 09:01:07,965 INFO RPC interface 'supervisor' initialized
elk_1    | 2019-04-16 09:01:07,965 CRIT Server 'unix_http_server' running without any HTTP authentication checking
elk_1    | 2019-04-16 09:01:07,965 INFO supervisord started with pid 1
elk_1    | 2019-04-16 09:01:08,997 INFO spawned: 'elasticsearch' with pid 8
elk_1    | 2019-04-16 09:01:09,003 INFO spawned: 'logstash' with pid 9
elk_1    | 2019-04-16 09:01:09,006 INFO spawned: 'kibana' with pid 10
elk_1    | 2019-04-16 09:01:10,008 INFO success: elasticsearch entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
elk_1    | 2019-04-16 09:01:10,008 INFO success: logstash entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
elk_1    | 2019-04-16 09:01:10,008 INFO success: kibana entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
db_1     | 2019-04-16T09:01:07.957725Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
db_1     | 2019-04-16T09:01:07.957814Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.15) initializing of server in progress as process 29
db_1     | 2019-04-16T09:02:48.063795Z 5 [Warning] [MY-010453] [Server] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
db_1     | 2019-04-16T09:03:36.330295Z 0 [System] [MY-013170] [Server] /usr/sbin/mysqld (mysqld 8.0.15) initializing of server has completed
db_1     | Database initialized
db_1     | MySQL init process in progress...
db_1     | MySQL init process in progress...
db_1     | MySQL init process in progress...
db_1     | MySQL init process in progress...
db_1     | MySQL init process in progress...
db_1     | MySQL init process in progress...
db_1     | mbind: Operation not permitted
db_1     | MySQL init process in progress...
db_1     | 2019-04-16T09:03:48.471696Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
db_1     | 2019-04-16T09:03:48.472038Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.15) starting as process 80
db_1     | 2019-04-16T09:03:55.958671Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
db_1     | 2019-04-16T09:03:56.067145Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
db_1     | 2019-04-16T09:03:56.115937Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.15'  socket: '/var/run/mysqld/mysqld.sock'  port: 0  MySQL Community Server - GPL.
db_1     | 2019-04-16T09:03:56.411031Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: '/var/run/mysqld/mysqlx.sock'
db_1     | Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it.
db_1     | Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.
db_1     | Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time zone. Skipping it.
db_1     | Warning: Unable to load '/usr/share/zoneinfo/zone1970.tab' as time zone. Skipping it.
db_1     | mysql: [Warning] Using a password on the command line interface can be insecure.
db_1     | mysql: [Warning] Using a password on the command line interface can be insecure.
db_1     | mysql: [Warning] Using a password on the command line interface can be insecure.
db_1     | mysql: [Warning] Using a password on the command line interface can be insecure.
db_1     | 
db_1     | 2019-04-16T09:04:36.423840Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.15)  MySQL Community Server - GPL.
db_1     | 
db_1     | MySQL init process done. Ready for start up.
db_1     | 
db_1     | 2019-04-16T09:04:37.156241Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
db_1     | 2019-04-16T09:04:37.156335Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.15) starting as process 1
db_1     | 2019-04-16T09:04:40.623748Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
db_1     | 2019-04-16T09:04:40.740067Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
db_1     | 2019-04-16T09:04:40.793428Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.15'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server - GPL.
db_1     | 2019-04-16T09:04:41.253207Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: '/var/run/mysqld/mysqlx.sock' bind-address: '::' port: 33060


I can access project here:
http://localhost/simple-api/symfony/public/
Screenshot from 2019-04-16 14-52-55

http://symfony.localhost/
Screenshot from 2019-04-16 14-58-04

@marcopicasso
Copy link

Is it possible that you have apache2 service running in background and listening on port 80?

@wabbenhuis
Copy link
Contributor

The Apache page is for its locally installed machine.
This stack used Nginx.

You specified, in the docker-compose.yml that nginx should export port 90 not 80. And bound it to port 90 not 80.

You should change the port:

nginx:
        build: ./nginx
        ports:
            - "90:80"

Then try:
http://symfony.localhost:90

The port is required since you mapped a different port then 80 and 443 therefor you should specify it.

Also note that port 90 is not a common HTTP port and it is reserved. Therefor I would change this one too. Use ports which are not reserved or better even reserved as alternative ports for HTTP like 8080 and 8008.

@eko
Copy link
Owner

eko commented May 2, 2021

Exactly as commented here, Apache is not related to docker-symfony technical stack.

Please be sure your 80 port is free before using our stack or configure another port number as mentioned in the comment just below.

Closing this issue for now but feel free to reopen is you still have any issue.

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

4 participants