Mac OS X Mountain Lionã«ã·ã¹ãã ç°å¢è¨å®ã®ãå ±æãããã«ã« Web å ±æã®ãªãã·ã§ã³ãå ¥ã£ã¦ããªã件ã«ã¤ãã¦
æè¿Macã®OS ãMountain Lionã«ã¢ãããã¼ããããã¾ãããæã åºã¾ã£ã¦ãã¾ãï¼ï¼^Ï^ï¼
ä»æ¥ã¯èªåã®ãã¼ã«ã«ç°å¢ã«ãµã¼ãã¼ãæºåãããã¨æã£ãã®ã§ããããWebå
±æãã¨ãããªãã·ã§ã³ã
è¦ä»ããã¾ããã§ããã
âããã®å·¦å´ã®ãªãã·ã§ã³ã«ä»¥åã¯ãã£ãã¯ã
http://support.apple.com/kb/HT5230?viewlocale=ja_JP
ãã¡ãã«ããã¨ã
ãOS X Mountain Lion ã§ã¯ãã·ã¹ãã ç°å¢è¨å®ã®ãå
±æãããã«ã« Web å
±æã®ãªãã·ã§ã³ãå«ã¾ãã¦ãã¾ãããMountain Lion ã«ã¯ããªã¼ãã³ã½ã¼ã¹ã® Web ãµã¼ããApache HTTP Serverããå«ã¾ãã¦ãã¾ããApache ãæå¹ã«ããæ¹æ³ããã³ä½¿ãæ¹ã«ã¤ãã¦ã¯ãhttp://httpd.apache.org ãåç
§ãã¦ãã ãããã
ã ããã§ãã
ãOS X Server ã«ã¯ãå°ç¨ã® Wiki ãµã¼ãããã¡ã¤ã«å
±æãããã¤ã¹ç®¡çãTime Machine ããã¯ã¢ããã®ãã¹ãã£ã³ã°ãªã©ãå¤æ°ã®ãµã¼ãã¹ãåãããWeb ãµã¤ã管çã®ããã®ã¤ã³ã¿ã¼ãã§ã¤ã¹ãå«ã¾ãã¦ãã¾ããOS X Server ã¯ãMac App Storeããå
¥æã§ãã¾ããã
ã¨ãæ¸ãã¦ãã£ã¦ããããããããã©ã©ã£ã¡ã使ãã°ããã®ããªã
ä»ã¾ã§ãMac OS Xã«ã¯æ¨æºã§Apache HTTP Serverãã¤ã³ã¹ãã¼ã«æ¸ã§Webå
±æãªãã·ã§ã³ãã
ãµã¼ãã¼ãONã«ãã¦ããã¯ãã
ã¨ãããã¨ã¯ä¸ã«æ¸ãã¦ããããæ¹ãããã°ããã®ã ããã
ã¨ãããã¨ã§ãhttp://httpd.apache.org/
ãèªããã¨æã£ããã ãã©åä¸è¶³ã§ããããããã
ããã§http://coolestguyplanettech.com/downtown/install-and-configure-apache-mysql-php-and-phpmyadmin-osx-108-mountain-lionãåèã«ããã¦ããã ãã¾ããã
ï¼ï¼ã¾ããã¿ã¼ããã«ãèµ·åãã¦Apacheãã¼ã¸ã§ã³ã確èªãã¦ã¡ããã¨Macã«å ¥ã£ã¦ããã確ããã
$httpd -v
Server version: Apache/2.2.22 (Unix)
Server built: Jun 20 2012 13:57:09
âãããªæãã§è¡¨ç¤ºããã¾ããã
ï¼ï¼ãµã¼ãã¼ãã¹ã¿ã¼ãããã
$sudo apachectl start
ãã¹ã¯ã¼ããä¿ãããã®ã§å ¥åãã¾ãã
ï¼ï¼ãã©ã¦ã¶ã§ãã¹ããã
ãã©ã¦ã¶ã§ä»¥ä¸ã®ãªã³ã¯ãè¸ãã§ã¿ã¦ä¸ãã
"It Works!" ã¨ããæåã表示ãããã°OKã§ãã
ï¼ï¼ãã¼ã ã«ããµã¤ã (Sites)ããã©ã«ããä½æãã
Siteãã©ã«ãã¯ãµã¼ãã¼ã«ãã£ã¦å
¬éããããã©ã«ãã§ãã
http://support.apple.com/kb/HT2549?viewlocale=ja_JP
Finder ãªã©ã§ã¦ã¼ã¶ã¼ã®ãã¼ã ãã£ã¬ã¯ããªç´ä¸ã«ä½æããã¨ããã§ãããã
ï¼ï¼ãusername.confãï¼usernameã«ã¯èªåã®ã¦ã¼ã¶ã¼ãã¼ã ãå
¥ããï¼ãããã確èªãã
/etc/apache2/users ãã©ã«ããè¦ã
ï¼ï¼ï¼ã§ãã¡ã¤ã«ãç¡ãã£ãæã¯ä»¥ä¸ã®æé ã§ä½æãã
ï¼âï¼ï¼
$cd /etc/apache2/users
ï¼âï¼ï¼
$sudo nano username.conf ï¼âusernameã«ã¯èªåã®ã¦ã¼ã¶ã¼ãã¼ã ãå ¥ããï¼
ï¼âï¼ï¼ã¨ãã£ã¿ã¼ãèµ·åãããã以ä¸ã®ããã«ç·¨éãã¦ä¿åããï¼usernameã¯èªåã®ã¦ã¼ã¶ã¼ãã¼ã ãå ¥ããï¼
Options Indexes MultiViews
AllowOverride All
Order allow,deny
Allow from all
ãä¿åã¨çµäºã®æ¹æ³ã¯
ããå¤æ´ãä¿åããããªããCtrl+Oãæ¼ãã¾ãã
ããnanoãçµäºããã«ã¯ãCtrl+Xã¨å
¥åãã¾ãã
ããããå¤æ´ãããã¡ã¤ã«ãçµäºããããnanoã«æ示ããã®ãªãã
ããä¿åãããèãããã§ãããã
ããä¿åãããªãå ´åã¯Nããä¿åãããå ´åã¯Yãæ¼ãã ãã§ãã
ããããã¨ãã¡ã¤ã«åãèãããã§ãããã
ãã ãã¡ã¤ã«åãå
¥åãã¦Enterãæ¼ãã¾ããã
ããåèãµã¤ããã¾ï¼http://www.gentoo.org/doc/ja/nano-basics-guide.xml
ããç·¨éããusername.confã®ãã¼ããã·ã§ã³ã¯-rw-r--r-- ã®ããã«ãªã£ã¦ããã¯ãã§ãã
ãã(ls- l ã³ãã³ãã§ç¢ºèªã§ãã¾ã)
ãã
ï¼ï¼Apacheãåèµ·åãã
$sudo apachectl restart
ï¼ï¼ããã§ãSitesãã©ã«ãã¯ä»¥ä¸ã®URLã§è¦ããã¨ãã§ããï¼usernameã¯èªåã®ã¦ã¼ã¶ã¼ãã¼ã ãå ¥ããï¼
ãã©ã¦ã¶ã§è¦ãå ´å
ãããªãããã§ãã
ãã£ã¨ããæ¹æ³ããã£ããæãã¦ãããã¨å¬ããã§ãã
ï¼ã¡ã¢ï¼Apacheãæ¢ããã³ãã³ãã¯
sudo apachectl stop