我在让它开始工作时遇到了一些麻烦。现在,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
这只是000-default.conf
Apache默认使用的文件副本,其中删除了注释并更改了一些信息。
我已经运行了命令sudo a2ensite git.conf
并重新启动了Apache服务器。
此处的目标是为虚拟主机提供服务,该虚拟主机具有一个Web客户端,用于在子域为时管理Git存储库git
。
我在配置文件中犯了任何错误吗?为了实现此功能,我是否缺少一个步骤?
我认为您可能需要在apache conf文件中更改该行
ServerName git.localhost
至
ServerName git.mydomain.com
我还要看看这个https://httpd.apache.org/docs/2.4/vhosts/examples.html
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句