<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Little Fox is Learning &#187; Apache</title>
	<atom:link href="http://corababy.net/tech/category/lamp/apache/feed/" rel="self" type="application/rss+xml" />
	<link>http://corababy.net/tech</link>
	<description>People are designed for lots of things, but loneliness isn&#039;t one of them.</description>
	<lastBuildDate>Wed, 24 Mar 2010 16:53:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>在wamp下利用httpd-vhosts.conf设置multiple domain</title>
		<link>http://corababy.net/tech/2009/08/07/%e5%9c%a8wamp%e4%b8%8b%e5%88%a9%e7%94%a8httpd-vhosts-conf%e8%ae%be%e7%bd%aemultiple-domain/</link>
		<comments>http://corababy.net/tech/2009/08/07/%e5%9c%a8wamp%e4%b8%8b%e5%88%a9%e7%94%a8httpd-vhosts-conf%e8%ae%be%e7%bd%aemultiple-domain/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 23:59:21 +0000</pubDate>
		<dc:creator>little fox</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[config]]></category>
		<category><![CDATA[host]]></category>
		<category><![CDATA[virtualhost]]></category>
		<category><![CDATA[wamp]]></category>

		<guid isPermaLink="false">http://corababy.net/tech/?p=21</guid>
		<description><![CDATA[在网路上找到很多文字来教大家设置multiple domain, 很多都是在httpd.conf里面实现的. 但最近的开发一直是利用httpd-vhosts.conf, 却一直郁闷在无法设置multiple domain的问题上.
问过X老师之后, 几分钟搞定=.=b, 这家伙一眼就指出了我滴错误&#8230;万恶的粗心大意啊.
所以利用httpd-vhosts.conf其实没有想象中那么纠结.
1)httpd-vhosts.conf文件的设置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
&#60;Directory D:/Wamp2/www&#62;
Order Deny,Allow
Allow from all
Options All
AllowOverride All
&#60;/Directory&#62;
&#160;
&#60;VirtualHost *:80&#62;
    ServerAdmin cora@cora.subsite1.com
    DocumentRoot &#34;D:/Wamp2/www/sub1&#34;
    ServerName cora.subsite1.com
&#60;/VirtualHost&#62;
&#160;
&#60;VirtualHost *:80&#62;
    ServerAdmin cora@cora.subsite1.com
    DocumentRoot &#34;D:/Wamp2/www/sub2&#34;
    ServerName cora.subsite2.com
&#60;/VirtualHost&#62;

2)在apache的httpd.conf设置
在httpd.conf里面, 一定要uncomment

1
2
# Virtual hosts
Include conf/extra/httpd-vhosts.conf

其他都不需要修改, 尤其是documentroot, 如果是在用wamp, 就默认为[FilePath]/www
3)hosts老师
另外, 在 hosts [...]]]></description>
			<content:encoded><![CDATA[<p>在网路上找到很多文字来教大家设置multiple domain, 很多都是在httpd.conf里面实现的. 但最近的开发一直是利用httpd-vhosts.conf, 却一直郁闷在无法设置multiple domain的问题上.<br />
问过X老师之后, 几分钟搞定=.=b, 这家伙一眼就指出了我滴错误&#8230;万恶的粗心大意啊.</p>
<p>所以利用httpd-vhosts.conf其实没有想象中那么纠结.</p>
<p><span style="color: #99ccff;">1)httpd-vhosts.conf文件的设置</span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td class="code"><pre class="language" style="font-family:monospace;">&lt;Directory D:/Wamp2/www&gt;
Order Deny,Allow
Allow from all
Options All
AllowOverride All
&lt;/Directory&gt;
&nbsp;
&lt;VirtualHost *:80&gt;
    ServerAdmin cora@cora.subsite1.com
    DocumentRoot &quot;D:/Wamp2/www/sub1&quot;
    ServerName cora.subsite1.com
&lt;/VirtualHost&gt;
&nbsp;
&lt;VirtualHost *:80&gt;
    ServerAdmin cora@cora.subsite1.com
    DocumentRoot &quot;D:/Wamp2/www/sub2&quot;
    ServerName cora.subsite2.com
&lt;/VirtualHost&gt;</pre></td></tr></table></div>

<p><span style="color: #99ccff;">2)在apache的httpd.conf设置</span></p>
<p>在httpd.conf里面, 一定要uncomment</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="language" style="font-family:monospace;"># Virtual hosts
Include conf/extra/httpd-vhosts.conf</pre></td></tr></table></div>

<p>其他都不需要修改, 尤其是documentroot, 如果是在用wamp, 就默认为[FilePath]/www</p>
<p><span style="color: #99ccff;">3)hosts老师</span></p>
<p>另外, 在 hosts 里面要记得加入子域名的指向IP</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="language" style="font-family:monospace;">127.0.0.1       cora.subsite1.com
127.0.0.1       cora.subsite2.com</pre></td></tr></table></div>

<p><span style="color: #99ccff;">4)什么是conf文件呢?</span></p>
<p>熊熊说, conf文件就是xml. 其实也不完全是, xml是conf文件的一种流行的格式.</p>
<p>conf常常用ASCII编码, 也有少部分用UTF-8的. 怪不得conf文件默认打开的程序总是notepad涅.</p>
<p>WIKI上时绛紫解释的: <a href="http://en.wikipedia.org/wiki/Configuration_file" target="_blank">http://en.wikipedia.org/wiki/Configuration_file</a></p>
<p><span style="color: #ffcc99;">++好孩子珊瑚++</span></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fcorababy.net%2Ftech%2F2009%2F08%2F07%2F%25e5%259c%25a8wamp%25e4%25b8%258b%25e5%2588%25a9%25e7%2594%25a8httpd-vhosts-conf%25e8%25ae%25be%25e7%25bd%25aemultiple-domain%2F&amp;linkname=%E5%9C%A8wamp%E4%B8%8B%E5%88%A9%E7%94%A8httpd-vhosts.conf%E8%AE%BE%E7%BD%AEmultiple%20domain"><img src="http://corababy.net/tech/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://corababy.net/tech/2009/08/07/%e5%9c%a8wamp%e4%b8%8b%e5%88%a9%e7%94%a8httpd-vhosts-conf%e8%ae%be%e7%bd%aemultiple-domain/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
