好吧,我先问我的问题,以下是我迄今试图解决的事情的细节:阿帕奇在localhost:给虚拟主机指定的服务器名称
在本地主机上运行的Apache,我想有不同的虚拟主机,这将是通过访问网址: http://name-of-the-virtual-host.name-of-the-machine/
详情:
所以,我有我的笔记本电脑的8080端口运行Apache。 Linux Mint,Debian发行版。一切都在本地进行测试,因此不涉及DNS!我使用的IP地址是127.0.1.1,它具有我的计算机的域,名为fabjoa。在文件/etc/apache2/apache2.conf
,我已经把:
ServerName fabjoa
在文件/etc/hosts
,确实是有行
127.0.1.1 fabjoa
在文件现在/etc/apache2/ports.conf
NameVirtualHost *:8080
Listen 8080
,conf文件我的虚拟主机。该文件被称为goyahkla,位于/etc/apache2/sites-available/
,并在/etc/apache2/sites-enabled
有一个符号链接。在这个文件中,我有以下几点:
<VirtualHost *:8080>
ServerName goyakhla.fabjoa
ServerAdmin [email protected]
DocumentRoot /var/sites/goyahkla
....
<Directory /var/sites/goyahkla/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
...
</VirtualHost>
运行apache2ctl configtest
给我的语法确定。现在,在浏览器上,开放http://fabjoa:8080/
确实指向虚拟主机goyahkla(因为这是我唯一的),但找不到http://goyahkla.fabjoa:8080
。其他调试:
telnet goyahkla.fabjoa:8080
telnet: could not resolve goyahkla.fabjoa:8080/telnet: Name or service not known
lynx goyahkla.fabjoa:8080
Looking up 'goyahkla.fabjoa' first
Looking up 'www.goyahkla.fabjoa.com', guessing...
Looking up goyahkla.fabjoa first
Looking up www.goyahkla.fabjoa.com, guessing...
Looking up www.goyahkla.fabjoa.com:8080
Making HTTP connection to www.goyahkla.fabjoa.com:8080
Alert!: Unable to connect to remote host.
lynx: Can't access startfile http://www.goyahkla.fabjoa.com:8080/
关于如何达到目的的任何想法?
谢谢
好了,我把它移到服务器故障 – fabjoa 2010-10-10 11:03:24