设置PuPHET失败的流浪汉 [英] Setting up Vagrant with PuPHET failure

查看:114
本文介绍了设置PuPHET失败的流浪汉的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用PuPHET工具来设置Vagrant,以便组合vagrant + puppet可以轻松启动具有vagrant的VM.我使用的是Centos64设置-php 5.4,以及一些次要的标准调试模式. 我在Mac OSX Maverick上运行它.

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.

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'

现在我还修改了在/etc/hosts中找到的主机文件 并添加了192.168.56.101 test.dev

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

我可以通过IP进行ping操作,可以通过域名ping进行操作,甚至可以将ssh流浪到虚拟机中..

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

有问题吗?我无法在浏览器中访问它(这违背了设置的目的). 我已经在共享文件夹中转储了一个简单的php hello world脚本.我将SSH连接到VM,以查看其是否存在.但是我迷失了为什么它不能开箱即用?我也尝试同时访问7943或22端口.无济于事.

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.

推荐答案

我设法使它正常工作.在与Vagrant一​​起工作时,我通常选择专用网络还是端口转发,而不是两者.

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

如果您在转发端口部分中更改了yaml配置并添加

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'

然后您可以通过 http://awesome.dev:8080 访问虚拟主机.请注意最后的端口8080,这意味着主机上的端口8080已转发到来宾上的端口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.

以下是其工作的屏幕截图. http://cdn.imghack.se/images/e38b9d2debc888588581c46b4aebb2c0.png

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

这篇关于设置PuPHET失败的流浪汉的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆