【问题标题】:How to configure the Apache Sever in ubuntu to run sites locally?如何在 ubuntu 中配置 Apache 服务器以在本地运行站点?
【发布时间】:2018-10-28 12:35:22
【问题描述】:

我是 Apache 新手,我想远程配置 example.com。我不拥有该域。我试过这个https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-14-04-lts 但它没有用。有人可以告诉我 example.conf 文件的内容应该是什么,以便 example.com 和 www.example.com 都应该指向我的本地主机。谢谢

【问题讨论】:

    标签: apache ubuntu virtualhost


    【解决方案1】:

    将此条目添加到您的 /etc/hosts 文件中

    127.0.0.1 example.com
    127.0.0.1 www.example.com
    

    然后尝试从浏览器中点击 URL。

    【讨论】:

    • 能否告诉我 example.com.conf 的代码,以便我本地计算机上的任何用户都可以访问 example.com 和 www.example.com
    猜你喜欢
    • 1970-01-01
    • 2010-11-22
    • 2018-07-19
    • 2017-07-08
    • 1970-01-01
    • 2019-09-10
    • 1970-01-01
    • 2014-11-28
    • 1970-01-01
    相关资源
    最近更新 更多