【发布时间】:2015-09-26 23:37:36
【问题描述】:
我正在尝试让我的pic.localhost 虚拟主机可访问公共网络(所有互联网)
现在的问题是它只能在地址pic.localhost 的同一台机器上工作,但即使lan 网络也无法访问它,只能由运行它的机器访问。我该怎么办?
我添加并编辑了这些文件以使我的图片成为子域站点:
1 - 我将httpd-vhosts 文件包含在我的httpd.conf 文件中。
2 - 我在httpd-vhosts 文件中添加了这一行:
<VirtualHost *:80>
ServerAdmin admin@domain
DocumentRoot "/opt/lampp/htdocs/"
ServerName pic.localhost
# ServerAlias www.pic.localhost
ErrorLog "logs/picture-error_log"
CustomLog "logs/picture-access_log" common
</VirtualHost>
3 - 我将此行添加到/etc/hosts
127.0.0.1 pic.localhost
4 - 我重新启动了 xampp 服务器
我正在Centos 7 机器上运行xampp 5.6.8。
【问题讨论】:
标签: linux apache centos xampp virtualhost