使用PuPHET失败设置Vagrant

I'm using PuPHET tool to setup Vagrant so that a combo vagrant+puppet should just easily boot a VM with vagrant up. Im using a Centos64 setup - php 5.4, and some minor standard debug mode. Im running this on a Mac OSX Maverick.

Here is the configuration:

vagrantfile-local:
    vm:
        box: centos64-x64-vbox43-1383512148
        box_url: 'http://box.puphpet.com/centos64-x64-vbox43.box'
        hostname: null
        network:
            private_network: 192.168.56.101
            forwarded_port:
                OhyIDGb9LuDg:
                    host: '7943'
                    guest: '22'
        provider:
            virtualbox:
                modifyvm:
                    natdnshostresolver1: on
                    memory: '1024'
                setextradata:
                    VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root: 1
        provision:
            puppet:
                manifests_path: puphpet/puppet
                manifest_file: manifest.pp
                options:
                    - '--verbose'
                    - '--hiera_config /vagrant/puphpet/puppet/hiera.yaml'
                    - '--parser future'
        synced_folder:
            ppWP2lt1BsDi:
                id: vagrant-root
                source: '/Users/Documents/vagrant/www/'
                target: /var/www
                nfs: 'false'
        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:
        - vim-common
        - git
    dot_files:
        -
            bash_aliases: null
    _prevent_empty: ''
mailcatcher:
    install: 0
    settings:
        smtp_ip: 0.0.0.0
        smtp_port: 1025
        http_ip: 0.0.0.0
        http_port: '1080'
        path: /usr/local/bin
        log: /var/log/mailcatcher/mailcatcher.log
apache:
    modules:
        - php
        - rewrite
    vhosts:
        geXjvySSeKG4:
            servername: test.dev
            docroot: /var/www/public_html
            port: '80'
            setenv:
                - 'APP_ENV dev'
            override:
                - All
    user: www-data
    group: www-data
    default_vhost: true
    mpm_module: prefork
    mod_pagespeed: 0
    mod_spdy: 0
php:
    version: '54'
    composer: '1'
    modules:
        php:
            - cli
            - intl
            - mcrypt
            - cgi
            - memcache
            - pspell
            - tidy
        pear: {  }
        pecl:
            - pecl_http
    ini:
        display_errors: On
        error_reporting: '-1'
        session.save_path: /var/lib/php/session
        allow_url_fopen: '1'
        allow_url_include: '1'
        error_log: syslog
        apc.enabled: '1'
    timezone: America/Chicago
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'
drush:
    install: 0
    settings:
        drush.tag_branch: 6.x
mysql:
    root_password: ***
    phpmyadmin: '1'
    adminer: 0
    databases:
        kqca9cVkAol1:
            grant:
                - ALL
            name: ***
            host: localhost
            user: ***
            password: ***
            sql_file: ''
mongodb:
    install: 0
    auth: 1
    port: '27017'
    databases: {  }
beanstalkd:
    install: '1'
    settings:
        listenaddress: 10.0.1.5
        listenport: '13000'
        maxjobsize: '65535'
        maxconnections: '1024'
        binlogdir: /var/lib/beanstalkd/binlog
        binlogfsync: null
        binlogsize: '10485760'
    beanstalk_console: '1'
    binlogdir: /var/lib/beanstalkd/binlog
rabbitmq:
    install: 0
    port: '5672'

Now I have also modified the host file found in /etc/hosts and added 192.168.56.101 test.dev

I can ping by IP, I can ping by domain name, I can even vagrant ssh into the VM..

Problem? I cant access it on the browser (which defeats the purpose of the setup). I've dumped a simple php hello world script inside the share folder. I have SSH into the VM to see if its there and it is. But im so lost as to why its not working out of the box? I have also tried to access both on 7943 or 22 port. No avail.

douweida2878
douweida2878 Ansible不需要云(尽管它提供了许多支持云解决方案的模块)。它也是完全免费的(你一定是在看AnsibleTower)。这只是一个建议:)
6 年多之前 回复
dongyimeng3764
dongyimeng3764 但它适用于本地开发者。乍一看Ansible-我需要在云上使用它。请注意,尽管你可以免费获得10分-它会破坏流浪汉+木偶试图实现的配置目的(VM取代MAMP环境))
6 年多之前 回复
dsshsta97935
dsshsta97935 我建议你不要使用PuPHET,因为使用vagrant+provisioner的整个想法是尽可能地模仿生产服务器。PuPHET只是创建了另一个开发环境。我建议你尝试使用Ansible的普通游民(Ansible比Puppet更容易学习)。
6 年多之前 回复

1个回答



我设法让这个工作。 使用Vagrant时,我通常选择专用网络或端口转发,但绝不选择两者。</ p>

如果在转发端口部分更改yaml配置并添加</ p>

< pre> forwarded_port:
OhyIDGb9LuDg:
host:'7943'
guest:'22'
GET0RirwFFW:
host:'8080'
guest:'80'
</ code> < / pre>

然后,您可以通过 http://awesome.dev:8080</访问虚拟主机 一>。 注意端口上的端口8080,这意味着主机上的端口8080正被转发到guest虚拟机上的端口80。 </ p>

以下是它工作的截图。 http://cdn.imghack.se/images/e38b9d2debc888588581c46b4aebb2c0.png </ p>

</ div>

展开原文

原文

I managed to get this working. When working with Vagrant I generally choose either private network or port forwarding but never both.

If you change your yaml configuration in the forwarded ports section and add

forwarded_port:
    OhyIDGb9LuDg:
        host: '7943'
        guest: '22'
    GET0RirwFFW:
        host: '8080'
        guest: '80'

You can then access the virtual host at http://awesome.dev:8080. Note the port 8080 on the end, this means that port 8080 on the host machine is being forwarded to port 80 on the guest.

Here is a screenshot of it working. http://cdn.imghack.se/images/e38b9d2debc888588581c46b4aebb2c0.png

dongxin8709
dongxin8709 注意 - 出于某种原因,我认为因为CentOs,我必须删除memcache和cli才能使配置工作。
6 年多之前 回复
dongwen9975
dongwen9975 嗨 - 我已切换到您的配置版本。 它半工作。 我可以访问它作为awesome.dev - 但我需要SLASH并且它不响应8080.有什么理由吗?
6 年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问