<?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>tech2web &#187; Webサーバー</title>
	<atom:link href="http://tech2web.sideb.jp/archives/categories/server/feed" rel="self" type="application/rss+xml" />
	<link>http://tech2web.sideb.jp</link>
	<description>ウェブに関する面白いこと書きます！（嘘）　xhtml, css, javascript などのウェブ標準技術に関するブログです。</description>
	<lastBuildDate>Tue, 30 Dec 2008 12:59:10 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>Apache2.0でポート毎にサイト環境を作る方法（※要するに仮想環境）</title>
		<link>http://tech2web.sideb.jp/archives/2007/06/15-063801.html</link>
		<comments>http://tech2web.sideb.jp/archives/2007/06/15-063801.html#comments</comments>
		<pubDate>Thu, 14 Jun 2007 21:38:01 +0000</pubDate>
		<dc:creator>pavlovdog</dc:creator>
				<category><![CDATA[Webサーバー]]></category>

		<guid isPermaLink="false">http://sideb.jp/wordpress/?p=14</guid>
		<description><![CDATA[サーバで「ルートから辿る」記述をしているHTMLソースを、そっくりそのまま自分のマシン上で動かす必要があったので調べてみました。 【要件】 ・Apache2.0 ・同一のIP、複数ポートをリスン ・ポート毎に異なるDoc [...]]]></description>
			<content:encoded><![CDATA[<p>サーバで「ルートから辿る」記述をしているHTMLソースを、そっくりそのまま自分のマシン上で動かす必要があったので調べてみました。</p>
<p>【要件】<br />
・Apache2.0<br />
・同一のIP、複数ポートをリスン<br />
・ポート毎に異なるDocumentRoot</p>
<p>要は、やりたい事はこれ。</p>
<p>http://httpd.apache.org/docs/2.2/ja/vhosts/examples.html#port</p>
<p>でもこのドキュメント、Apache2.2系の解説なんだよなー。。。</p>
<p>とか思いながらApache2.0のhttpd.confを見てたらこんなくだりを発見。（httpd.confの一番最後）</p>
<p><引用><br />
#<br />
# VirtualHost example:<br />
# Almost any Apache directive may go into a VirtualHost container.<br />
# The first VirtualHost section is used for requests without a known<br />
# server name.<br />
#<br />
#<VirtualHost *:80><br />
#    ServerAdmin webmaster@dummy-host.example.com<br />
#    DocumentRoot /www/docs/dummy-host.example.com<br />
#    ServerName dummy-host.example.com<br />
#    ErrorLog logs/dummy-host.example.com-error_log<br />
#    CustomLog logs/dummy-host.example.com-access_log common<br />
#</VirtualHost><br />
</引用></p>
<p>意外と簡単そうじゃないかと。<br />
早速、Example通りに追記してみる。</p>
<p>//////////<br />
<VirtualHost *:81><br />
ServerAdmin webmaster@dummy-host.example.com<br />
DocumentRoot &#8220;D:\www\tr-lab\itshindan&#8221;<br />
ServerName itshindan.jp:81<br />
ErrorLog logs/itshindan-error_log<br />
CustomLog logs/itshindan-access_log common<br />
</VirtualHost><br />
//////////</p>
<p>あとはリスンポートの設定にポート81を追記。<br />
オイラのマシンでは元々ポート80をリスンしていたので下のようになる。</p>
<p>//////////<br />
#<br />
# Listen: Allows you to bind Apache to specific IP addresses and/or<br />
# ports, instead of the default. See also the <VirtualHost><br />
# directive.<br />
#<br />
# Change this to Listen on specific IP addresses as shown below to<br />
# prevent Apache from glomming onto all bound IP addresses (0.0.0.0)<br />
#<br />
#Listen 12.34.56.78:80<br />
Listen 80<br />
Listen 81 （←今回追記した部分）<br />
//////////</p>
<p>この２つの追記を行ってApacheをリスタート。<br />
無事に各ポートでリスンしてくれました。</p>
<p>ちなみにポート82を追加しても動きました。<br />
どこまで増やして大丈夫かはマシンパワーに依存するのかな。。。？</p>
]]></content:encoded>
			<wfw:commentRss>http://tech2web.sideb.jp/archives/2007/06/15-063801.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

