这是一个菜鸟问题。
我在我的Ubuntu主机中安装了Apache( apache2 )。 现在我想configuration它来执行以下操作:
http://localhost/my-app映射到~/dev/my-app http://localhost/api-1映射到http://apisrv/api-1 http://localhost/api-2映射到http://apisrv/api-2 据我所知,我应该configurationDirectory和Proxy 。 我的问题是:
我应该编辑哪个configuration文件来添加Directory和Proxy定义? /etc/apache2/httpd.conf或/etc/apache2/sites-enabled/000-default
如何为上面的映射configurationDirectory和Proxy ?
看看httpd文件。
如果你仔细观察,你会看到1个目录,有很多评论。 只需将其复制粘贴到每个目录并在需要的地方进行调整(删除注释以获得更多概述)
对于较新的Apache安装,您希望将自定义指令放在Sites.Enabled中。 您的常规Apacheconfiguration位于http.conf中。 Sites.enabled指令在启动时覆盖httpd.conf。 另外,根据上面所述,我没有看到有代理的理由。