<?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>バーチャルホスト | ウダ2Blog</title>
	<atom:link href="https://uda2.com/blog/tag/%e3%83%90%e3%83%bc%e3%83%81%e3%83%a3%e3%83%ab%e3%83%9b%e3%82%b9%e3%83%88/feed/" rel="self" type="application/rss+xml" />
	<link>https://uda2.com/blog</link>
	<description>大阪でフリーランスとしてWEB制作している管理人が気になった技術をメモったり、作ったツールの紹介などを綴っているブログです。</description>
	<lastBuildDate>Mon, 01 Jun 2015 20:14:26 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>
	<item>
		<title>Mac miniをWEBサーバに</title>
		<link>https://uda2.com/blog/macmini2webserver/</link>
					<comments>https://uda2.com/blog/macmini2webserver/#respond</comments>
		
		<dc:creator><![CDATA[uda2]]></dc:creator>
		<pubDate>Mon, 01 Jun 2015 20:14:26 +0000</pubDate>
				<category><![CDATA[うだうだ]]></category>
		<category><![CDATA[Mac mini]]></category>
		<category><![CDATA[XAMPP]]></category>
		<category><![CDATA[バーチャルホスト]]></category>
		<guid isPermaLink="false">http://uda2.com/blog/?p=1965</guid>

					<description><![CDATA[<p>先日、NAS化したMac miniですが実はWindows側から「濁点の入った文字を検索出来ない」という問題があります。 理由はWindowsやLinuxは普通に濁点・半濁点がくっついた文字を使ってるのに対し、MacはN</p>
The post <a href="https://uda2.com/blog/macmini2webserver/">Mac miniをWEBサーバに</a> first appeared on <a href="https://uda2.com/blog">ウダ2Blog</a>.]]></description>
										<content:encoded><![CDATA[<p>先日、<a href="http://uda2.com/blog/macmini2nas/" target="_blank">NAS化したMac mini</a>ですが実はWindows側から「濁点の入った文字を検索出来ない」という問題があります。<br />
理由はWindowsやLinuxは普通に濁点・半濁点がくっついた文字を使ってるのに対し、MacはNFDという濁点・半濁点を分離して1文字とする方式でファイル名を管理してる為だ。<br />
そんな訳でMac miniにWEBサーバを立てて検索するツールを作る事にした。<br />
<span id="more-1965"></span><br />
Macの場合2400円の<a href="https://www.apple.com/jp/osx/server/" target="_blank">OS X Server</a>を買えば簡単にサーバー化出来るけど、Windowsで使い慣れてる無料のXAMPPで構築します。</p>
<p>インストールは<a href="https://www.apachefriends.org/jp/index.html" target="_blank">XAMPPの公式サイト</a>からMac版をダウンロードして普通にインストールするだけです。</p>
<p>まず、WEBサーバーの設定です。今回はバーチャルホストをつかって「http://mac.mini/」でアクセスしたいので、設定ファイルを有効にします。（linuxとパスが違ってて気持ち悪いです。）<br />
パーミッションが面倒なのでUserとGroupの設定をしておきます。（hogeはmacのログインIDに書き換えて下さい）<br />
一般公開するならセキュリティ的に弄らない方がいいです。<br />
<strong>#vi /Applications/XAMPP/xamppfiles/etc/httpd.conf</strong></p>
<pre><code>Include /Applications/XAMPP/etc/extra/httpd-vhosts.conf
User hoge
Group staff</code></pre>
<p>次に、バーチャルホストの設定です。<br />
今回はmacがすぐ寝るのでDropboxにフォルダ「www」を作ってここをWEBルートにしました。<br />
後先日NAS化したフォルダを参照出来るように外付けHDDの共有フォルダへのエイリアスを設定しました。<br />
（Directoryの設定は不要な気もするがウチでは無くすと403になるので設定してます）<br />
<strong>#vi /Applications/XAMPP/xamppfiles/etc/extra/httpd-vhosts.conf</strong></p>
<pre><code>&lt;VirtualHost *:80&gt;
    DocumentRoot &quot;/Users/hoge/DropBox/www&quot;
    ServerName mac.mini
    Alias /nas &quot;/Volumes/NAS/SHARE/&quot;
&lt;/VirtualHost&gt;
&lt;Directory &quot;/Users/hoge/DropBox/www&quot;&gt;
    AllowOverride All
    Require all granted
&lt;/Directory&gt;</code></pre>
<p>別にいらないけど一応PHPの設定をしておきます。<br />
<strong>#vi /Applications/XAMPP/xamppfiles/etc/php.ini</strong></p>
<pre><code>data.timezone = Asia/Tokyo
mbstring.language = Japanese
mbstring.internal_encoding = UTF-8
mbstring.http_input = pass
mbstring.http_output = pass</code></pre>
<p>一通り設定が終わったらXAMPPの再起動<br />
<strong>#/Applications/XAMPP/xamppfiles/xampp restart</strong></p>
<p>次にhostsの設定（macのローカルIPアドレスを192.168.24.109に固定してる場合です。）<br />
<strong>#vi /etc/hosts</strong></p>
<pre><code>192.168.24.109 mac.mini
127.0.0.1 mac.mini</code></pre>
<p>#sudo dscacheutil -flushcache</p>
<p>閲覧側のパソコンのhostsも同様に設定。<br />
<strong>C:\Windows\System32\drivers\etc\hosts</strong></p>
<pre><code>192.168.24.109 mac.mini</code></pre>
<p>とりあえず確認用のページを作って<br />
<strong>$ vi /Users/hoge/DropBox/www/phpinfo.php</strong><br />
&lt;?php phpinfo(); ?&gt;</p>
<p>ブラウザで見れたらOK<br />
http://mac.mini/phpinfo.php</p>
<p>大した作業はしてないけど長くなりすぎたので、今回はWEBサーバー構築までとします。</p>The post <a href="https://uda2.com/blog/macmini2webserver/">Mac miniをWEBサーバに</a> first appeared on <a href="https://uda2.com/blog">ウダ2Blog</a>.]]></content:encoded>
					
					<wfw:commentRss>https://uda2.com/blog/macmini2webserver/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
