puphpet / puphpet

Vagrant/Puppet GUI
Other
3.83k stars 627 forks source link

Nginx default vhost problem (Adminer unaccessible) #1500

Closed dsge closed 9 years ago

dsge commented 9 years ago

After provision opening http://10.0.0.11/adminer in my browser causes "500 Internal Server Error nginx/1.6.2".

The myproject.dev vhost works as expected. Only the www/html/ folder and it's contents (like adminer) produce this error.

/var/log/nginx/3blsanq4ejro.error.log file:

2015/04/03 11:36:50 [error] 9165#0: *14 rewrite or internal redirection cycle while internally redirecting to "/index.php", client: 10.0.0.1, server: myproject.dev, request: "GET /adminer/ HTTP/1.1", host: "10.0.0.11"
2015/04/03 11:36:51 [error] 9165#0: *15 rewrite or internal redirection cycle while internally redirecting to "/index.php", client: 10.0.0.1, server: myproject.dev, request: "GET /adminer/ HTTP/1.1", host: "10.0.0.11"
2015/04/03 13:55:50 [error] 9165#0: *87 rewrite or internal redirection cycle while internally redirecting to "/index.php", client: 10.0.0.1, server: myproject.dev, request: "GET /adminer HTTP/1.1", host: "10.0.0.11"

/var/log/nginx/3blsanq4ejro.access.log file:

10.0.0.1 - - [03/Apr/2015:11:36:50 +0000] "GET /adminer/ HTTP/1.1" 500 594 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.89 Safari/537.36 OPR/28.0.1750.48"
10.0.0.1 - - [03/Apr/2015:11:36:51 +0000] "GET /adminer/ HTTP/1.1" 500 594 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.89 Safari/537.36 OPR/28.0.1750.48"
10.0.0.1 - - [03/Apr/2015:13:55:50 +0000] "GET /adminer HTTP/1.1" 500 594 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.89 Safari/537.36 OPR/28.0.1750.48"

/var/log/nginx/_.error.log file is empty. /var/log/nginx/_.access.log file is empty. /var/log/nginx/error.log file is empty. /var/log/nginx/access.log file is empty.

My config.yaml:


---
vagrantfile-local:
    vm:
        box: puphpet/ubuntu1404-x64
        box_url: puphpet/ubuntu1404-x64
        hostname: vagrant-clapp-box
        memory: '512'
        cpus: '2'
        chosen_provider: virtualbox
        network:
            private_network: 10.0.0.11
            forwarded_port:
                6dJ3wRZKkGYw:
                    host: '5708'
                    guest: '22'
                3Lsq0AUVCJvc:
                    host: '8181'
                    guest: '80'
        post_up_message: ''
        provider:
            virtualbox:
                modifyvm:
                    natdnshostresolver1: on
            vmware:
                numvcpus: 1
            parallels:
                cpus: 1
        provision:
            puppet:
                manifests_path: puphpet/puppet
                manifest_file: site.pp
                module_path: puphpet/puppet/modules
                options:
                    - '--verbose'
                    - '--hiera_config /vagrant/puphpet/puppet/hiera.yaml'
                    - '--parser future'
        synced_folder:
            LNN7KSVePzxQ:
                owner: www-data
                group: www-data
                source: ./www
                target: /var/www
                sync_type: default
                rsync:
                    args:
                        - '--verbose'
                        - '--archive'
                        - '-z'
                    exclude:
                        - .vagrant/
                    auto: 'false'
        usable_port_range:
            start: 10200
            stop: 10500
    ssh:
        host: null
        port: null
        private_key_path: null
        username: vagrant
        guest_port: null
        keep_alive: true
        forward_agent: false
        forward_x11: false
        shell: 'bash -l'
    vagrant:
        host: detect
server:
    install: '1'
    packages:
        - mc
        - dstat
        - iptraf
        - wget
        - phpunit
        - npm
        - python-pip
users_groups:
    install: '1'
    groups: {  }
    users: {  }
cron:
    install: '1'
    jobs: {  }
firewall:
    install: '1'
    rules: {  }
apache:
    install: '0'
    settings:
        user: www-data
        group: www-data
        default_vhost: true
        manage_user: false
        manage_group: false
        sendfile: 0
    modules:
        - proxy_fcgi
        - rewrite
    vhosts:
        zgb6da5e5tpg:
            servername: awesome.dev
            serveraliases:
                - www.awesome.dev
            docroot: /var/www/awesome
            port: '80'
            setenv:
                - 'APP_ENV dev'
            custom_fragment: ''
            directories:
                afvhqi9v55mb:
                    provider: directory
                    path: /var/www/awesome
                    options:
                        - Indexes
                        - FollowSymlinks
                        - MultiViews
                    allow_override:
                        - All
                    require:
                        - 'all granted'
                    custom_fragment: ''
                    files_match:
                        jrxat4ucrsmi:
                            provider: filesmatch
                            path: \.php$
                            sethandler: 'proxy:fcgi://127.0.0.1:9000'
                            custom_fragment: ''
            ssl_cert: ''
            ssl_key: ''
            ssl_chain: ''
            ssl_certs_dir: ''
nginx:
    install: '1'
    settings:
        default_vhost: 1
        proxy_buffer_size: 128k
        proxy_buffers: '4 256k'
    upstreams: {  }
    vhosts:
        3blsanq4ejro:
            proxy: ''
            server_name: myproject.dev
            server_aliases:
                - ~^myproject\..+\.c\.hu$
            www_root: /var/www/myproject/public
            listen_port: '80'
            index_files:
                - index.html
                - index.htm
                - index.php
            client_max_body_size: 1m
            locations:
                xyv6unoufsdc:
                    location: /
                    try_files:
                        - $uri
                        - $uri/
                        - index.php
                    fastcgi: ''
                    fastcgi_index: ''
                    fastcgi_split_path: ''
                czfuqeb4svpk:
                    location: '~ \.php$'
                    try_files:
                        - $uri
                        - $uri/
                        - index.php
                        - /index.php$is_args$args
                    fastcgi: '127.0.0.1:9000'
                    fastcgi_index: index.php
                    fastcgi_split_path: '^(.+\.php)(/.*)$'
                    fast_cgi_params_extra:
                        - 'SCRIPT_FILENAME $request_filename'
                        - 'APP_ENV dev'
            ssl_cert: ''
            ssl_key: ''
            ssl_port: '443'
php:
    install: '1'
    settings:
        version: '56'
    fpm_settings:
        port: 9000
    composer: '1'
    composer_home: ''
    modules:
        php:
            - cli
            - intl
            - mcrypt
            - curl
            - fpm
            - gd
            - geoip
            - mbstring
            - memcached
            - mysql
        pear: {  }
        pecl:
            - APC
            - pecl_http
    ini:
        display_errors: On
        error_reporting: '-1'
        session.save_path: /var/lib/php/session
        date.timezone: Europe/Budapest
        upload_max_filesize: 1024M
hhvm:
    install: '0'
    nightly: 0
    composer: '1'
    composer_home: ''
    settings:
        host: 127.0.0.1
        port: '9000'
    ini:
        display_errors: On
        error_reporting: '-1'
    timezone: null
xdebug:
    install: '0'
    settings:
        xdebug.default_enable: '1'
        xdebug.remote_autostart: '0'
        xdebug.remote_connect_back: '1'
        xdebug.remote_enable: '1'
        xdebug.remote_handler: dbgp
        xdebug.remote_port: '9000'
xhprof:
    install: '0'
wpcli:
    install: '0'
    version: v0.17.1
drush:
    install: '0'
    version: 6.3.0
ruby:
    install: '1'
    versions:
        3PBB8p1p9Rhh:
            default: '1'
            version: 1.9.3
            gems:
                - sass
nodejs:
    install: '1'
    npm_packages:
        - jshint
        - grunt-cli
        - bower
        - karma
python:
    install: '1'
    packages: {  }
    versions: {  }
mysql:
    install: '1'
    settings:
        version: '5.6'
        root_password: ROOT.
        override_options: {  }
    adminer: '1'
    users: {  }
    databases: {  }
    grants: {  }
postgresql:
    install: '0'
    settings:
        global:
            encoding: UTF8
            version: '9.3'
        server:
            postgres_password: '123'
    databases: {  }
    users: {  }
    grants: {  }
    adminer: 0
sqlite:
    install: '0'
    adminer: 0
    databases: {  }
mongodb:
    install: '0'
    settings:
        auth: 1
        bind_ip: 127.0.0.1
        port: '27017'
    databases: {  }
redis:
    install: '1'
    settings:
        conf_port: '6379'
mailcatcher:
    install: '0'
    settings:
        smtp_ip: 0.0.0.0
        smtp_port: 1025
        http_ip: 0.0.0.0
        http_port: '1080'
        mailcatcher_path: /usr/local/rvm/wrappers/default
        from_email_method: inline
beanstalkd:
    install: '0'
    settings:
        listenaddress: 0.0.0.0
        listenport: '13000'
        maxjobsize: '65535'
        maxconnections: '1024'
        binlogdir: /var/lib/beanstalkd/binlog
        binlogfsync: null
        binlogsize: '10485760'
    beanstalk_console: 0
    binlogdir: /var/lib/beanstalkd/binlog
rabbitmq:
    install: '0'
    settings:
        port: '5672'
    users: {  }
    vhosts: {  }
    plugins: {  }
elastic_search:
    install: '0'
    settings:
        version: 1.4.1
        java_install: true
solr:
    install: '0'
    settings:
        version: 4.10.2
        port: '8984'
adamlundrigan commented 9 years ago

I have the same problem with both CentOS and Ubuntu 12.04 LTS manifests. I get a 504 Gateway Timeout when both my site's vhost and the default vhost are enabled. In the error log for my site's vhost I see:

2015/04/07 12:36:04 [error] 8259#0: *2 rewrite or internal redirection cycle while internally redirecting to "/adminer/", client: 192.168.56.1, server: k12pl.dev, request: "GET /adminer/ HTTP/1.1", host: "192.168.56.101"

If I disable my site's vhost Adminer works fine.

kusmierz commented 9 years ago

@dsge Has it started working after #1515 solution? If not, could you try run:

[11:50 AM]-[vagrant@test]-[~] 
$ cd /etc/nginx/sites-enabled/

[11:50 AM]-[vagrant@test]-[/etc/nginx/sites-enabled] 
$ sudo mv _.conf 000000000000.conf

[11:51 AM]-[vagrant@test]-[/etc/nginx/sites-enabled] 
$ sudo service nginx restart
 * Restarting nginx nginx                                                [ OK ] 

[11:51 AM]-[vagrant@test]-[/etc/nginx/sites-enabled] 
$ 

and check it again?

dsge commented 9 years ago

Yes it is working now! I did not have to rename the _.conf file.

My temporary workaround was to create a vagrant.dev vhost for the var/www/html folder so I could access adminer on http://vagrant.dev/adminer. But coworkers had to set that vhost in their hosts file so it's better now that the http://10.0.0.11/adminer is working again.

jtreminio commented 9 years ago

This is working well by default now.