douxi3977 2014-03-10 11:12
浏览 85

Vagrant没有安装Apache2也没有安装php

I just created a configuration file (it's a zip actually) for my vm on puphpet.com, downloaded the zip, extracted it. Then I run vagrant up in the folder where is located the vagrantfile. The vm is correctly setup under virtualbox, it runs well and the shared folders are working.

However when I access my vm from the host, using 127.0.0.1:7893 it displays : SSH-2.0-OpenSSH_6.0p1 Debian-4. Which is weired since I checked both install php and install apache on puphpet. I decided to verify their existance on the vm : which apache2, whereis php etc.

Nothing was returned.

So appearently php and apache2 have not been installed, even though the config.yaml file (that I created on puphpet) did specify to install both php and apache2.

At this point, I don't really know what to do (I'm new to php/vagrant/puphpet) :

  • should I install them myself on the vm with apt-get ?
  • ??

EDIT: during the installation process (vagrant up), I get errors like :

Err http://http.us.debian.org/debian/ wheezy/main linux-headers-3.2.0-4-amd64 am
d64 3.2.51-1
  404  Not Found [IP: 64.50.233.100 80]
Fetched 238 kB in 1s (167 kB/s)
Failed to fetch http://http.us.debian.org/debian/pool/main/l/linux/linux-headers
-3.2.0-4-common_3.2.51-1_amd64.deb  404  Not Found [IP: 64.50.233.100 80]

EDIT2: I 'solved' the problem by using a differents virtual machine.

  • 写回答

3条回答 默认 最新

  • dslijian2015 2014-03-10 13:28
    关注

    I just ran the default config:

    [01:26 PM]-[vagrant@packer-virtualbox]-[~]
    $ php -v
    PHP 5.5.10-1~dotdeb.1 (cli) (built: Mar  6 2014 18:55:59)
    Copyright (c) 1997-2014 The PHP Group
    Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
        with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
    

    Everything looks to be fine on my end.

    A couple of things:

    • You can access the VM from your browser using the IP address you chose during initial config.
    • Looks like your main issue is that you couldn't connection to the Debian repos. Are you behind a firewall?

    To try again, do:

    $ vagrant destroy
    $ rm -rf .vagrant
    $ vagrant up
    
    评论

报告相同问题?

悬赏问题

  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?