<?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>绑定 &#8211; LPC影子技术分享</title>
	<atom:link href="https://www.mudbest.com/tag/%E7%BB%91%E5%AE%9A/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.mudbest.com</link>
	<description>行影不离,忘之却步.</description>
	<lastBuildDate>Mon, 01 Oct 2012 14:05:34 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.1</generator>
	<item>
		<title>Debian下 Apache2 绑定域名</title>
		<link>https://www.mudbest.com/debian%e4%b8%8b-apache2-%e7%bb%91%e5%ae%9a%e5%9f%9f%e5%90%8d/</link>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Mon, 24 Jan 2011 01:51:06 +0000</pubDate>
				<category><![CDATA[分享]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[域名绑定]]></category>
		<category><![CDATA[绑定]]></category>
		<guid isPermaLink="false">http://blog.mudbest.com/?p=335</guid>

					<description><![CDATA[apche2文件介绍： /etc/apache2/apache2.conf 主配置文件，不精通apache不要 ... <a title="Debian下 Apache2 绑定域名" class="read-more" href="https://www.mudbest.com/debian%e4%b8%8b-apache2-%e7%bb%91%e5%ae%9a%e5%9f%9f%e5%90%8d/" aria-label="阅读 Debian下 Apache2 绑定域名">阅读更多</a>]]></description>
										<content:encoded><![CDATA[<p>apche2文件介绍：</p>
<p><strong>/etc/apache2/apache2.conf</strong><br />
    主配置文件，不精通apache不要修改此文件</p>
<p><strong>/etc/apache2/httpd.conf</strong><br />
    这个文件的存在是为了保持兼容性，即使你精通apache，我也建议不要修改此文件</p>
<p><strong>/etc/apache2/ports.conf</strong><br />
    这个文件用来配置apache的监听的端口，不精通者请不要修改</p>
<p>/etc/apache2下面的几个目录解释如下：<span id="more-335"></span></p>
<p><strong>/etc/apache2/conf.d</strong><br />
    apache会读取这个目录下的任何文件，这些文件的内容都是配置文件的一部分，不建议修改此目录下的任何内容</p>
<p><strong>/etc/apache2/mods-available</strong><br />
    这个目录下是一些零碎的配置文件，不建议修改，apache不会读取此目录下的文件。该目录下的文件一般都是某个apache模块的配置文件</p>
<p><strong>/etc/apache2/mods-enabled</strong><br />
    apache会读取这个目录下的任何文件，这些文件的内容都是配置文件的一部分，不建议修改此目录下的任何内容。该目录下的文件一般都是某个apache模块的配置文件</p>
<p><strong>/etc/apache2/sites-available</strong><br />
    这个目录下是一些零碎的配置文件，不建议修改，apache不会读取此目录下的文件，该目录下的文件一般都是某个站点的配置文件</p>
<p><strong>/etc/apache2/sites-enabled</strong><br />
    apache会读取这个目录下的任何文件，这些文件的内容都是配置文件的一部分，不建议修改此目录下的任何内容，该目录下的文件一般都是某个站点的配置文件</p>
<p>从上面的列表可以看出，mods-available和mods-enabled这两个目录的区别是apache是否去读取这个目录。有个疑问：如 果apache从来不读取mods-available目录，那要它何用？答案是mods-available下存放所有apache模块的配置文件，但 这些模块不一定是激活的，激活的模块的配置文件链接到mods-enabled下面，如果没有链接到mods-enabled下面，那肯定是一些没有激活 的模块。a2enmod命令可以列出mods-available下面的所有模块，管理员可以选择激活哪个模块，激活之后的模块就会在mods- enabled下面添加一个链接。</p>
<p>同理，sites-available和sites-enabled这两个目录也是这样的原理，a2ensite命令可以列出sites-available下存在的站点文件，可以创建站点文件的链接到sites-enabled目录下。</p>
<pre class="brush: plain; title: ; notranslate">
# 前后是相同的效果，可以看出是英文的缩写
a2enmod == Apache2 ENable MODule
a2ensite == Apache2 ENable SITE
</pre>
<p>缺省情况下，sites-available下只有一个文件default，sites-available/default链接到sites- enabled目录下的链接名为000-default。apache的习惯是一个站点一个配置文件，但我们为了方便管理，把所有的站点的配置都保存到 default这个文件里面。</p>
<p>在httpd.conf 里面添加：</p>
<pre class="brush: plain; title: ; notranslate">
NameVirtualHost *
ServerName 192.168.1.99
</pre>
<p>在sites-enabled 目录下添加 www.t1.com 文件</p>
<p>内容：</p>
<pre class="brush: plain; title: ; notranslate">
&lt;VirtualHost * &gt;
ServerName www.t1.com
DocumentRoot /var/www/www.t1.com/
&lt;/VirtualHost&gt;
</pre>
<p>重启apache即可</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
