如何在本地配置 ubuntu 到 运行 站点中的 Apache 服务器?

How to configure the Apache Sever in ubuntu to run sites locally?

我是 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 都应该指向我的本地主机。谢谢

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

127.0.0.1 example.com
127.0.0.1 www.example.com

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