【发布时间】:2016-09-10 23:15:32
【问题描述】:
我在让它工作时遇到了一点麻烦。现在 DNS 正在为我的域传播,所以我一直在使用常规 IP 地址,如果这会有所不同的话。
在我的/etc/hosts 文件中,我有以下内容...
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
127.0.0.1 localhost.localdomain localhost
# Auto-generated hostname. Please do not remove this comment.
111.111.111.11 main.mydomain.com main
111.111.111.11 git.mydomain.com
::1 localhost ip6-localhost ip6-loopback
我只在这个文件中添加了一行,那一行是111.111.111.11 git.mydomain.com。当我得到这个 VPS 时,其余的都在那里。
我还创建了这个 Apache 配置文件 git.conf 并将其添加到 /etc/apache2/sites-available/...
<VirtualHost *:80>
ServerName git.localhost
ServerAdmin allen@localhost
DocumentRoot /home/allen/Sites/Git
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
这只是 Apache 默认使用的 000-default.conf 文件的副本,删除了 cmets 并更改了一些信息。
我已经运行了命令sudo a2ensite git.conf 并重新启动了 Apache 服务器。
这里的目标是在子域为git 时为具有用于管理 Git 存储库的 Web 客户端的虚拟主机提供服务。
我是否在配置文件中犯了任何错误?为了实现此功能,我是否缺少步骤?
【问题讨论】:
标签: apache dns apache2 subdomain virtualhost