puphpet / puphpet

Vagrant/Puppet GUI
Other
3.84k stars 629 forks source link

Nginx vhosts don't include "\.php$" location block #1443

Closed markjaquith closed 9 years ago

markjaquith commented 9 years ago

Nginx and PHP-FPM are both installed correctly. But the vhost file for Nginx lacks the block that processes PHP files. As such, Nginx just sends the PHP code as a download to the browser.

Here is the file it produces:

/etc/nginx/sites-available/fbsvugeljk8q.conf

server {
  listen                *:80;

  server_name           example.com ;
  client_max_body_size 1m;

  root /var/www/example.com.com;
    index  index.html index.htm index.php;

  access_log            /var/log/nginx/fbsvugeljk8q.access.log;
  error_log             /var/log/nginx/fbsvugeljk8q.error.log;

  sendfile off;
}

And here is my config:

config.yaml


---
vagrantfile-local:
    vm:
        box: puphpet/ubuntu1404-x64
        box_url: puphpet/ubuntu1404-x64
        hostname: ''
        memory: '2048'
        cpus: '2'
        chosen_provider: vmware_fusion
        network:
            private_network: 192.168.82.126
            forwarded_port: {  }
        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:
            IQeHP2WHAack:
                owner: ''
                group: ''
                source: ./example.com
                target: /var/www/example.com
                sync_type: nfs
                rsync:
                    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:
        - curl
        - ack-grep
        - vim
        - sendmail
        - redis-server
        - wget
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: {  }
    vhosts: {  }
    mod_pagespeed: 0
nginx:
    install: '1'
    settings:
        default_vhost: 1
        proxy_buffer_size: 128k
        proxy_buffers: '4 256k'
    upstreams: {  }
    vhosts:
        fbsvugeljk8q:
            proxy: ''
            server_name: example.com
            www_root: /var/www/example.com
            listen_port: '80'
            index_files:
                - index.html
                - index.htm
                - index.php
            client_max_body_size: 1m
            ssl_cert: ''
            ssl_key: ''
            ssl_port: ''
php:
    install: '1'
    version: '56'
    composer: '1'
    composer_home: ''
    modules:
        php:
            - cli
            - common
            - curl
            - fpm
            - gd
            - imagick
            - intl
            - mcrypt
            - xmlrpc
        pear: {  }
        pecl:
            - pecl_http
            - redis
    ini:
        display_errors: On
        error_reporting: '-1'
    mod_php: 0
hhvm:
    install: '0'
    nightly: 0
    composer: '1'
    composer_home: ''
    settings:
        host: '0'
        port: '0'
    ini: {  }
    timezone: null
xdebug:
    install: '1'
    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: '1'
    version: v0.17.1
drush:
    install: '0'
    version: ''
ruby:
    install: '1'
    versions: {  }
nodejs:
    install: '0'
    npm_packages: {  }
python:
    install: '1'
    packages: {  }
    versions: {  }
mysql:
    install: '1'
    settings:
        override_options: {  }
        root_password: root
    adminer: 0
    databases:
        8s8wia9jGUry:
            grant:
                - ALL
            name: gws
            host: localhost
            user: gws
            password: gws
            sql_file: ''
postgresql:
    install: '0'
    settings:
        global:
            encoding: UTF8
            version: '9.3'
        server:
            postgres_password: ''
    databases: {  }
    users: {  }
    grants: {  }
    adminer: 0
mariadb:
    install: '0'
    settings:
        override_options: {  }
        root_password: '123'
    adminer: 0
    databases: {  }
sqlite:
    install: '0'
    adminer: 0
    databases: {  }
mongodb:
    install: '0'
    settings:
        auth: 1
        port: '27017'
    databases: {  }
redis:
    install: '0'
    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: null
        java_install: true
solr:
    install: '0'
    settings:
        version: ''
        port: ''
jtreminio commented 9 years ago

Nginx was recently significantly refactored. Please regenerate your archive!

Note that your config.yaml isn't compatible with the new version :( you'll need to recreate it manually.

markjaquith commented 9 years ago

Aha! I dragged an old config.yaml onto puphpet.com. I noticed a few things didn't transfer, so I reconfigured them. But in the vhosts section, the location blocks didn't show up. There was no UI to add them. And that config.yaml was the one it spit out AFTER.

This is far from ideal. It happily imported the config.yaml I gave it, and then it gave me back a broken config. The user should be warned about this. #1444

jtreminio commented 9 years ago

Can you paste your original config.yaml?

markjaquith commented 9 years ago

FYI, there's some weird stuff in there from before you added VMware Fusion support (I added support in my Vagrantfile at one time).


---
vagrantfile-local:
    vm:
        box: ubuntu-precise1204-x32-vbox43
        box_url: 'http://files.vagrantup.com/precise32.box'
        hostname: null
        network:
            private_network: 192.168.82.126
            forwarded_port: {  }
        provider:
            virtualbox:
                modifyvm:
                    natdnshostresolver1: on
                    memory: '2048'
                setextradata:
                    VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root: 1
            vmware_fusion:
                vmx:
                    memsize: '2048'
                override:
                    vm:
                        box: 'precise64_vmware_fusion_puphpet'
                        box_url: 'http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-fusion503.box'
        provision:
            puppet:
                manifests_path: puphpet/puppet
                manifest_file: manifest.pp
                options:
                    - '--verbose'
                    - '--hiera_config /vagrant/puphpet/puppet/hiera.yaml'
                    - '--parser future'
        synced_folder:
            NaMQjbLCHwj4:
                id: vagrant-root
                source: ./example.com
                target: /var/www/example.com
                nfs: 'true'
        usable_port_range: 2200..2250
    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:
    packages:
        - memcached
        - curl
        - ack-grep
        - vim
        - sendmail
        - redis-server
    dot_files:
        -
            bash_aliases: null
    _prevent_empty: ''
nginx:
    install: '1'
    vhosts:
        6oGScH4x65VY:
            server_name: example.com
            server_aliases:
                - www.example.com
            www_root: /var/www/example.com
            listen_port: '80'
            index_files:
                - index.html
                - index.htm
                - index.php
            envvars:
                - 'APP_ENV dev'
php:
    install: '1'
    version: '54'
    composer: '1'
    modules:
        php:
            - cli
            - common
            - curl
            - fpm
            - gd
            - imagick
            - intl
            - mcrypt
            - memcache
            - xmlrpc
        pear: {  }
        pecl:
            - pecl_http
    ini:
        display_errors: On
        error_reporting: '-1'
    timezone: America/New_York
xdebug:
    install: '1'
    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: '1'
mysql:
    install: '1'
    root_password: root
    phpmyadmin: 0
    adminer: 0
    databases:
        wbA4GzB6DnxE:
            grant:
                - ALL
            name: gws
            host: localhost
            user: gws
            password: gws
            sql_file: ''