<?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>Minimizr.com &#187; Apache</title>
	<atom:link href="http://minimizr.com/blog/category/apache/feed/" rel="self" type="application/rss+xml" />
	<link>http://minimizr.com</link>
	<description>More With Less</description>
	<lastBuildDate>Sat, 05 Jun 2010 21:29:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Setup MAMP (Mac, Apache, MySQL And PHP) on Mac OS X 10.5 Leopard</title>
		<link>http://minimizr.com/blog/2007/10/setup-mamp-mac-apache-mysql-and-php-on-mac-os-x-105-leopard/</link>
		<comments>http://minimizr.com/blog/2007/10/setup-mamp-mac-apache-mysql-and-php-on-mac-os-x-105-leopard/#comments</comments>
		<pubDate>Sun, 28 Oct 2007 13:39:14 +0000</pubDate>
		<dc:creator>kristian</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Server]]></category>

		<guid isPermaLink="false">http://www.minimizr.com/blog/2007/10/setup-mamp-mac-apache-mysql-and-php-on-mac-os-x-105-leopard/</guid>
		<description><![CDATA[New Mac OS X 10.5 Leopard comes with new versions of Apache and PHP (Apache/2.2.6 (Unix) mod_ssl/2.2.6 OpenSSL/0.9.7l DAV/2 PHP/5.2.4), so it is quite easy to setup a MAMP server. Sure there are other ways to do the setup: You can build Apache, MySQL and PHP from sources, you can use MacPorts or you can [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>New Mac <a href="http://www.apple.com/macosx/leopard/">OS X 10.5 Leopard</a> comes with new versions of Apache and PHP (<code>Apache/2.2.6 (Unix) mod_ssl/2.2.6 OpenSSL/0.9.7l DAV/2 PHP/5.2.4</code>), so it is quite easy to setup a <a href="http://en.wikipedia.org/wiki/MAMP">MAMP</a> server. Sure there are other ways to do the setup: You can build <a href="http://httpd.apache.org/">Apache</a>, <a href="http://dev.mysql.com/">MySQL</a> and <a href="http://www.php.net/">PHP</a> from sources, you can use <a href="http://www.macports.org/">MacPorts</a> or you can use pre-build packages like <a href="http://www.mamp.info/">MAMP</a> or <a href="http://www.apachefriends.org/en/xampp.html">XAMPP</a>. But in my opinion, because Apache and PHP are already installed, they are easy way to go and will minimize you work.</p>
<h2>Apache</h2>
<p>To enable pre-installed PHP, you have to edit httpd.conf file:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">vi</span> <span style="color: #000000; font-weight: bold;">/</span>private<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>httpd.conf</pre></div></div>

<p>And uncomment next line:</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;"><span style="color: #00007f;">LoadModule</span> php5_module libexec/apache2/libphp5.so</pre></div></div>

<p>If you want to make other configuration changes, for example define virtual hosts, it&#8217;s better to use user&#8217;s configuration file:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">vi</span> <span style="color: #000000; font-weight: bold;">/</span>private<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>users<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>username<span style="color: #7a0874; font-weight: bold;">&#93;</span>.conf</pre></div></div>

<p>After making changes, restart Apache aka Web Sharing. Go to System Preferences > Sharing and unselect and select again Web Sharing. That&#8217;s it. Now you have the Apache and PHP running. If there are any problems, you can examine the Apache error_log. Go to Console > /var/log > apache2 > error_log.</p>
<h2>PHP</h2>
<p>If you want to make changes to php.ini, do the following. Copy php.ini.default to php.ini:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>private<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>php.ini.default <span style="color: #000000; font-weight: bold;">/</span>private<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>php.ini</pre></div></div>

<p>And to make changes:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">644</span> <span style="color: #000000; font-weight: bold;">/</span>private<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>php.ini
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">vi</span> <span style="color: #000000; font-weight: bold;">/</span>private<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>php.ini
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">444</span> <span style="color: #000000; font-weight: bold;">/</span>private<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>php.ini</pre></div></div>

<p>After making changes don&#8217;t forget to restart Apache.</p>
<h2>MySQL</h2>
<p>MySQL is a little trickier. It is not pre installed in OS X and in my opinion easiest way is to use binary from MySQL.com. So, <a href="http://dev.mysql.com/downloads/mysql/5.0.html#macosx-dmg">download</a> the current version, which is mysql-5.0.45-osx10.4-i686.pkg at the moment and install it. Then install MySQLStartupItem.pkg and copy MySQL.prefPane to OSX/Library/PreferencePanes. It seems to be that current versions preference pane is not quite compatible with OS X 10.5. It shows if the server is running or stopped, but you can&#8217;t star or stop with it. MySQL starts when the OS starts, but you can start or stop it manually from console:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>StartupItems<span style="color: #000000; font-weight: bold;">/</span>MySQLCOM<span style="color: #000000; font-weight: bold;">/</span>MySQLCOM start
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>StartupItems<span style="color: #000000; font-weight: bold;">/</span>MySQLCOM<span style="color: #000000; font-weight: bold;">/</span>MySQLCOM stop</pre></div></div>

<p>MySQL with default settings use socket in /tmp and pre-installed PHP presumes it to be in /var/mysql, so you have to update the location in php.ini:</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">mysql.default_socket <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> /tmp/mysql.sock</span></pre></div></div>

<p>Perhaps you could also use a symbolic link from /var/mysql/mysql.sock to tmp/mysql.soc. <a href="http://dev.mysql.com/downloads/gui-tools/5.0.html">MySQL GUI Tools</a> are also working nicely with new OS X 10.5.</p>
<h2>Mac OS X 10.5</h2>
<p>No you should have a MAMP server running nicely. If you want to make host name changes &#8211; for example you can use different names for localhost to take advantage Apache&#8217;s virtual hosting &#8211; edit hosts file:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">vi</span> <span style="color: #000000; font-weight: bold;">/</span>private<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>hosts</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://minimizr.com/blog/2007/10/setup-mamp-mac-apache-mysql-and-php-on-mac-os-x-105-leopard/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

