关于apache配置子域名的问题

帖子列表 发布于 2013/01/11 00:34
阅读 536
收藏 0
我的域名是在godaddy注册的,设置了子域名: test.mylittledomain.org,其他没有设置(A记录、别名什么的)

我的apache配置文件vhost.conf的内容如下:(固定IP的VPS上)

NameVirtualHost *:80

<VirtualHost *:80>
    ServerAdmin gopher.dog@gmail.com
    ServerName www.mylittledomain.org
    ServerAlias www.mylittledomain.org
    DocumentRoot /home/phoenix/public_html/gitprojects/mylittledomain/public/
    ErrorLog /home/phoenix/logs/phoenix.error.log
    CustomLog /home/phoenix/logs/phoenix.access.log combined

    <Directory "/home/phoenix/public_html/gitprojects/mylittledomain/public/">
    allow from all
    AllowOverride all
    Options +indexes
    </Directory>
</VirtualHost>


<VirtualHost *:80>
    ServerAdmin gopher.dog@gmail.com
    ServerName mylittledomain.org
    ServerAlias mylittledomain.org
    DocumentRoot /home/phoenix/public_html/gitprojects/mylittledomain/public/
    ErrorLog /home/phoenix/logs/phoenix.error.log
    CustomLog /home/phoenix/logs/phoenix.access.log combined

    <Directory "/home/phoenix/public_html/gitprojects/mylittledomain/public/">
    allow from all
    AllowOverride all
    Options +indexes
    </Directory>
</VirtualHost>

请问要如何将 test.mylittledomain.org 访问时就指向 /home/phoenix/public_html/mytest/ 这个文件夹的项目?

本人服务器小白,希望高手们回答地详细点。

加载中
0
Narky
Narky
<VirtualHost *:80>
    ServerAdmin gopher.dog@gmail.com
    ServerName test.mylittledomain.org
    ServerAlias test.mylittledomain.org
    DocumentRoot /home/phoenix/public_html/mytest
    ErrorLog /home/phoenix/logs/phoenix.test.error.log
    CustomLog /home/phoenix/logs/phoenix.test.access.log combined

    <Directory "/home/phoenix/public_html/mytest">
    allow from all
    AllowOverride all
    Options +indexes
    </Directory>
</VirtualHost>
帖子列表
帖子列表
回复 @Narky : 按你的方法试了,不行!
Narky
Narky
回复 @李马燕 : 把子域名解析过来,或者干脆解析泛域名
帖子列表
帖子列表
域名注册商那边不用配置什么吗?
返回顶部
顶部