【问题标题】:how to fix the Apache2 Ubuntu Default Page in vagrant that uses ubuntu/trusty32如何修复使用 ubuntu/trusty32 的 vagrant 中的 Apache2 Ubuntu 默认页面
【发布时间】:2015-06-10 09:56:41
【问题描述】:

有没有人在带有virtualbox的windows 7环境中使用ubuntu/trusty32和vagrant,我是vagrant的新手,我安装了它所需的所有东西,即apache2、php5、mysql和mysql workbench。当我运行服务器并访问它时浏览器我得到默认的 Apache2 Ubuntu 默认页面 说我可以编辑 index.html ** **(位于 /var/www/html/index.html) 我试图在 windows bunt 中寻找这个文件夹,但无法得到它,任何人都可以帮忙

【问题讨论】:

  • 该文件应该在您的虚拟机中,而不是在您的 Windows 系统中。使用vagrant ssh,您可以连接到您的 ubuntu 并在那里您可以编辑此文件。 Vagrant 还支持同步文件夹:docs.vagrantup.com/v2/getting-started/synced_folders.html
  • 你的意思是我应该检查 vagrant>.vagrant>machines>default 还是 ?
  • 那么你应该像我之前提到的那样尝试连接它。在 youtube 上搜索“vagrant apache”或更通用的“vagrant tutorial”,有很多很棒的教程在等着你;)
  • vagrant>.vagrant>machines>default 听起来像你的 Windows 7 文件系统,对吧?那么这就是错误的搜索位置。你在你的 virtualbox 中运行一个虚拟 Ubuntu,你的 /var/www/html 目录就在那里。
  • @PKeidel 我在 vagrant 中使用 git bash 安装了 ubuntu/trusty32。你是说我应该运行 Vbox。我正在尝试但没有 GUI,或者我应该从 vagrant ssh 终端运行它?跨度>

标签: mysql apache ubuntu vagrant


【解决方案1】:

我解决了这个问题: 运行

vagrant up

然后

vagrant ssh

然后

 cd /var/www/html

最后

ls 

index.html会在那里找到。删除它运行

sudo rm index.html

【讨论】:

    【解决方案2】:
    1. 使用vagrant up 启动您的虚拟机
    2. 通过 ssh 与vagrant ssh 连接
    3. (现在你在你的 ubuntu 中运行在 virtualbox 中)
    4. 编辑您的文件 (/var/www/html/index.html)
    5. 学习(也许是 youtube 教程)更多关于 VirtualBox、Linux、SSH、命令行、vi 或 nano(命令行文本编辑器)的信息

    【讨论】:

      【解决方案3】:

      我通过运行此评论解决了这个问题:

      流浪者的规定

      【讨论】:

        猜你喜欢
        • 2013-10-28
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-05-11
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多