<?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>james young &#187; configuration</title>
	<atom:link href="http://psyjinx.com/jyoung/category/configuration/feed/" rel="self" type="application/rss+xml" />
	<link>http://psyjinx.com/jyoung</link>
	<description>web application developer</description>
	<lastBuildDate>Fri, 05 Mar 2010 18:55:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Your HOSTNAME not staying?</title>
		<link>http://psyjinx.com/jyoung/2009/08/your-hostname-not-staying/</link>
		<comments>http://psyjinx.com/jyoung/2009/08/your-hostname-not-staying/#comments</comments>
		<pubDate>Sun, 30 Aug 2009 23:05:08 +0000</pubDate>
		<dc:creator>James Young</dc:creator>
				<category><![CDATA[configuration]]></category>
		<category><![CDATA[hostname]]></category>
		<category><![CDATA[macosx]]></category>

		<guid isPermaLink="false">http://psyjinx.com/jyoung/?p=160</guid>
		<description><![CDATA[<p>Ran into this recently.  Not sure if it is a new &#8220;feature&#8221; of Mac OS X 10.5.7, or just the way my new AT&#038;T U-verse router works.</p>
<p>Say you happen to do a clean install of Mac OS X (or any OS really), then connect to your wireless network, then do all the system updates, [...]]]></description>
			<content:encoded><![CDATA[<p>Ran into this recently.  Not sure if it is a new &#8220;feature&#8221; of Mac OS X 10.5.7, or just the way my new AT&#038;T U-verse router works.</p>
<p>Say you happen to do a clean install of Mac OS X (or any OS really), then connect to your wireless network, then do all the system updates, then finally get around to doing your custom settings.</p>
<p>One of the first things I change is the host name.  I prefer themed names around something cool, vs. generic names like admins-mac-mini.local.</p>
<p>I fired up the System Preferences, went to the Sharing preference pane and changed the Computer Name from Admin&#8217;s Mac Mini to meimi.  Did a few other things, restarted, fired up terminal and got this beautiful prompt:</p>
<p><code>admins-mac-mini:~ admin$</code></p>
<p>Hrm&#8230;.</p>
<p>Come to find out the DHCP on my network has cached the initial name of the computer and just doesn&#8217;t want to let it go.  I am sure there is some way to force it to update, but here is another way.</p>
<ol>
<li>Open up Terminal</li>
<li><code>$ sudo vim /etc/hostsconfig</code></li>
<li>make sure you have the following line: <code>HOSTNAME="meimi.local"</code> &#8211; change it to your hostname of choice and add .local to the end of  it</li>
]]></content:encoded>
			<wfw:commentRss>http://psyjinx.com/jyoung/2009/08/your-hostname-not-staying/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Protecting Apache Served Directories</title>
		<link>http://psyjinx.com/jyoung/2009/07/protecting-apache-served-directories/</link>
		<comments>http://psyjinx.com/jyoung/2009/07/protecting-apache-served-directories/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 22:22:05 +0000</pubDate>
		<dc:creator>James Young</dc:creator>
				<category><![CDATA[configuration]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[cli]]></category>

		<guid isPermaLink="false">http://psyjinx.com/jyoung/?p=141</guid>
		<description><![CDATA[<p>Surprised I haven&#8217;t written this up before now.  It is very simple to do.</p>
<p>This assumes you are using apache on a unix based system.  This should work on any OS running apache though.</p>

In the directory you want to restrict create a file named .htaccess that contains the following:

AuthType Basic
AuthName &#34;RESTRICTED ACCESS&#34;
AuthUserFile /home3/speedtow/.htpasswd
Require valid-user


Note: [...]]]></description>
			<content:encoded><![CDATA[<p>Surprised I haven&#8217;t written this up before now.  It is very simple to do.</p>
<p>This assumes you are using apache on a unix based system.  This should work on any OS running apache though.</p>
<ol>
<li>In the directory you want to restrict create a file named .htaccess that contains the following:

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;"><span style="color: #00007f;">AuthType</span> Basic
<span style="color: #00007f;">AuthName</span> <span style="color: #7f007f;">&quot;RESTRICTED ACCESS&quot;</span>
<span style="color: #00007f;">AuthUserFile</span> /home3/speedtow/.htpasswd
<span style="color: #00007f;">Require</span> valid-<span style="color: #00007f;">user</span></pre></div></div>

<ul>
<li>Note: AuthName can be anything you want it to say and AuthUserFile must be an absolute path to the .htpasswd file.  It can be anywhere, I wouldn&#8217;t recommend putting it in the directory you are restricting though, or any apache served directory for that matter.</li>
</ul>
</li>
<li>Create the .htpasswd file by running htpasswd in the location you want it to live.  It will go something like this:

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ htpasswd <span style="color: #660033;">-c</span> .htpasswd username
New password:
Re-type new password:
Adding password <span style="color: #000000; font-weight: bold;">for</span> user username</pre></div></div>

</li>
</ol>
<p>Thats it,  your done.</p>
]]></content:encoded>
			<wfw:commentRss>http://psyjinx.com/jyoung/2009/07/protecting-apache-served-directories/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to setup a Mac OS X MAMP based Web Server</title>
		<link>http://psyjinx.com/jyoung/2009/01/how-to-setup-a-mac-os-x-mamp-based-web-server/</link>
		<comments>http://psyjinx.com/jyoung/2009/01/how-to-setup-a-mac-os-x-mamp-based-web-server/#comments</comments>
		<pubDate>Wed, 07 Jan 2009 20:32:53 +0000</pubDate>
		<dc:creator>James Young</dc:creator>
				<category><![CDATA[configuration]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[cronolog]]></category>
		<category><![CDATA[dbd]]></category>
		<category><![CDATA[dbi]]></category>
		<category><![CDATA[macosx]]></category>
		<category><![CDATA[mamp]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[phpmyadmin]]></category>

		<guid isPermaLink="false">http://psyjinx.com/wp/?p=33</guid>
		<description><![CDATA[

In the past I had a mediawiki setup on my local MBP that I would use to keep notes.  This is a copy/paste of this article.  The ToC links do not work, but the rest of the links should work.   If you need to setup MAMP on a Mac, keep on reading after the break.</p>






Contents
<p>(these [...]]]></description>
			<content:encoded><![CDATA[<div id="globalWrapper">
<div id="column-content">
<div id="content">In the past I had a mediawiki setup on my local MBP that I would use to keep notes.  This is a copy/paste of this article.  The ToC links do not work, but the rest of the links should work.   If you need to setup MAMP on a Mac, keep on reading after the break.</p>
<div id="bodyContent">
<table id="toc" border="0" summary="Contents">
<tbody>
<tr>
<td>
<div id="toctitle">
<h2>Contents</h2>
<p>(these links don&#8217;t work in wordpress)
</p></div>
<ul>
<li><a href="../../wiki/index.php?title=Setup_a_Mac_OS_X_MAMP_Based_Web_Server&amp;printable=yes#Download_Required_Software"><span>1</span> <span>Download Required Software</span></a></li>
<li><a href="../../wiki/index.php?title=Setup_a_Mac_OS_X_MAMP_Based_Web_Server&amp;printable=yes#Base_Setup"><span>2</span> <span>Base Setup</span></a></li>
<li><a href="../../wiki/index.php?title=Setup_a_Mac_OS_X_MAMP_Based_Web_Server&amp;printable=yes#Configure_Mac_OS_X"><span>3</span> <span>Configure Mac OS X</span></a></li>
<li><a href="../../wiki/index.php?title=Setup_a_Mac_OS_X_MAMP_Based_Web_Server&amp;printable=yes#Install_MAMP"><span>4</span> <span>Install MAMP</span></a></li>
<li><a href="../../wiki/index.php?title=Setup_a_Mac_OS_X_MAMP_Based_Web_Server&amp;printable=yes#Configure_MAMP_and_Apache"><span>5</span> <span>Configure MAMP and Apache</span></a>
<ul>
<li><a href="../../wiki/index.php?title=Setup_a_Mac_OS_X_MAMP_Based_Web_Server&amp;printable=yes#The_MAMP_Application"><span>5.1</span> <span>The MAMP Application</span></a></li>
<li><a href="../../wiki/index.php?title=Setup_a_Mac_OS_X_MAMP_Based_Web_Server&amp;printable=yes#Mac_OS_X_Settings"><span>5.2</span> <span>Mac OS X Settings</span></a></li>
<li><a href="../../wiki/index.php?title=Setup_a_Mac_OS_X_MAMP_Based_Web_Server&amp;printable=yes#Symlinks_and_New_Directories"><span>5.3</span> <span>Symlinks and New Directories</span></a></li>
<li><a href="../../wiki/index.php?title=Setup_a_Mac_OS_X_MAMP_Based_Web_Server&amp;printable=yes#Apache_httpd.conf"><span>5.4</span> <span>Apache httpd.conf</span></a></li>
<li><a href="../../wiki/index.php?title=Setup_a_Mac_OS_X_MAMP_Based_Web_Server&amp;printable=yes#Create_htpasswd_file_for_Authentication"><span>5.5</span> <span>Create htpasswd file for Authentication</span></a></li>
<li><a href="../../wiki/index.php?title=Setup_a_Mac_OS_X_MAMP_Based_Web_Server&amp;printable=yes#vhost_.conf_file"><span>5.6</span> <span>vhost .conf file</span></a></li>
<li><a href="../../wiki/index.php?title=Setup_a_Mac_OS_X_MAMP_Based_Web_Server&amp;printable=yes#.profile_or_.bash_profile_or_.bashrc"><span>5.7</span> <span>.profile or .bash_profile or .bashrc</span></a></li>
<li><a href="../../wiki/index.php?title=Setup_a_Mac_OS_X_MAMP_Based_Web_Server&amp;printable=yes#Configure_MAMP_to_Start_Silently_on_Boot"><span>5.8</span> <span>Configure MAMP to Start Silently on Boot</span></a>
<ul>
<li><a href="../../wiki/index.php?title=Setup_a_Mac_OS_X_MAMP_Based_Web_Server&amp;printable=yes#info.mamp.start.apache.plist"><span>5.8.1</span> <span>info.mamp.start.apache.plist</span></a></li>
<li><a href="../../wiki/index.php?title=Setup_a_Mac_OS_X_MAMP_Based_Web_Server&amp;printable=yes#info.mamp.start.mysql.plist"><span>5.8.2</span> <span>info.mamp.start.mysql.plist</span></a></li>
</ul>
</li>
</ul>
</li>
<li><a href="../../wiki/index.php?title=Setup_a_Mac_OS_X_MAMP_Based_Web_Server&amp;printable=yes#Install_Cronolog"><span>6</span> <span>Install Cronolog</span></a></li>
<li><a href="../../wiki/index.php?title=Setup_a_Mac_OS_X_MAMP_Based_Web_Server&amp;printable=yes#Confirming_It_Works"><span>7</span> <span>Confirming It Works</span></a></li>
<li><a href="../../wiki/index.php?title=Setup_a_Mac_OS_X_MAMP_Based_Web_Server&amp;printable=yes#Configure_PHPMyAdmin"><span>8</span> <span>Configure PHPMyAdmin</span></a>
<ul>
<li><a href="../../wiki/index.php?title=Setup_a_Mac_OS_X_MAMP_Based_Web_Server&amp;printable=yes#Consequences_of_Changing_the_root_Password_.28which_you_should_do.29"><span>8.1</span> <span>Consequences of Changing the root Password (which you should do)</span></a></li>
</ul>
</li>
<li><a href="../../wiki/index.php?title=Setup_a_Mac_OS_X_MAMP_Based_Web_Server&amp;printable=yes#Install_DBI_and_DBD::MySQL"><span>9</span> <span>Install DBI and DBD::MySQL</span></a></li>
<li><a href="../../wiki/index.php?title=Setup_a_Mac_OS_X_MAMP_Based_Web_Server&amp;printable=yes#Install_PERL_CGI"><span>10</span> <span>Install PERL CGI</span></a></li>
<li><a href="../../wiki/index.php?title=Setup_a_Mac_OS_X_MAMP_Based_Web_Server&amp;printable=yes#Available_Tools"><span>11</span> <span>Available Tools</span></a></li>
<li><a href="../../wiki/index.php?title=Setup_a_Mac_OS_X_MAMP_Based_Web_Server&amp;printable=yes#FAQ"><span>12</span> <span>FAQ</span></a>
<ul>
<li><a href="../../wiki/index.php?title=Setup_a_Mac_OS_X_MAMP_Based_Web_Server&amp;printable=yes#Why_do_you_do_all_these_settings_and_not_just_use_the_defaults_setup_by_MAMP"><span>12.1</span> <span>Why do you do all these settings and not just use the defaults setup by MAMP</span></a></li>
</ul>
</li>
<li><a href="../../wiki/index.php?title=Setup_a_Mac_OS_X_MAMP_Based_Web_Server&amp;printable=yes#References"><span>13</span> <span>References</span></a></li>
</ul>
</td>
</tr>
</tbody>
</table>
<p><script type="text/javascript">// <![CDATA[
    if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); }
// ]]&gt;</script></p>
<p><span id="more-33"></span></p>
<h2><span>Download Required Software </span></h2>
<ul>
<li> MAMP &#8211; <a title="http://download.living-e.com/MAMP/releases/1.7.2/MAMP_1.7.2.dmg" rel="nofollow" href="http://download.living-e.com/MAMP/releases/1.7.2/MAMP_1.7.2.dmg">http://download.living-e.com/MAMP/releases/1.7.2/MAMP_1.7.2.dmg</a></li>
<li> cronolog &#8211; <a title="http://cronolog.org/download/cronolog-1.6.2.tar.gz" rel="nofollow" href="http://cronolog.org/download/cronolog-1.6.2.tar.gz">http://cronolog.org/download/cronolog-1.6.2.tar.gz</a></li>
</ul>
<h2><span>Base Setup </span></h2>
<p>This article assumes you have a clean Mac OS X 10.5.x install on a mac and have installed the XCode Developer Tools.</p>
<h2><span>Configure Mac OS X </span></h2>
<p>There are a variety of things I do when I configure a new Mac. Most of it is personal preferences, some of it is for performance (like setting a solid color desktop background on a machine I know I will only see via Screen Sharing), other things for configuring a work environment. All of that is out of scope for what we are doing here, so just do the following as a the minimum. I will create a page for configuring a Mac dev box in the future that will go into all the details of how I configure my system, .profile, .vimrc, .screenrc, etc.</p>
<ul>
<li> Open Software Update and make sure that you are up to date on everything.</li>
<li> Open System Preferences -&gt; Sharing and make sure that the following are on and everything else is off
<ul>
<li> Screen Sharing</li>
<li> File Sharing &#8211; Click Options and make sure &#8216;Share files and folders using FTP&#8217; is checked</li>
<li> Remote Login</li>
</ul>
</li>
<li> Make sure the Computer Name is one word without spaces or apostrophes. Something like kimiko is good, something like Jamie&#8217;s MacBook Pro is bad</li>
</ul>
<h2><span> Install MAMP </span></h2>
<p>MAMP is a .dmg so if you have direct control on the machine or remote access that is ideal. Download the .dmg, mount it, drag MAMP to the Applications folder and you are done with the install.</p>
<h2><span> </span><span>Configure MAMP and Apache </span></h2>
<p>These steps are too interlaced to separate configuring MAMP and configuring Apache into separate sections.</p>
<h3><span>The MAMP Application </span></h3>
<ul>
<li> Launch up MAMP. The first time it launches it will start up your default web browser (probably Safari if you haven&#8217;t already installed Firefox) and turn everything on.</li>
<li> Click the Stop Servers button to stop everything</li>
<li> Click the Preferences and do the following:
<ul>
<li> on Start/Stop, uncheck everything</li>
<li> on Ports, Set to default Apache and MySQL ports</li>
<li> on PHP, use PHP5, uncheck Zend Optimizer, and use APC for the Cache</li>
<li> on Apache, set the document root to /Library/WebServer/Documents</li>
</ul>
</li>
<li> Quit the MAMP application</li>
</ul>
<h3><span>Mac OS X Settings </span></h3>
<ul>
<li> In Finder, open <code>/Applications/MAMP/</code> and delete all the readme files that are in a language that you can&#8217;t read and delete the htdocs folder</li>
</ul>
<h3><span>Symlinks and New Directories </span></h3>
<p>In Terminal, go to your MAMP directory, create a symlink named <code>htdocs</code> to <code>/Library/WebServer/Documents/</code>, go to <code>/etc</code> and create a symlink for <code>mamp</code> to <code>/Applications/MAMP/conf</code>, move apache2 to apache2.d (I don&#8217;t like deleting things), create a symlink for apache2 to <code>/Applications/MAMP/conf/apache</code>,  go to <code>/etc/mamp/apache</code> and create a <code>vhosts</code> folder, and go to <code>/var/log</code> and create a symlink for <code>mamp</code> to <code>/Applications/MAMP/logs</code>.  If you aren&#8217;t positive how to do all that, here is a transcript:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>Applications<span style="color: #000000; font-weight: bold;">/</span>MAMP
$ <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>WebServer<span style="color: #000000; font-weight: bold;">/</span>Documents htdocs
$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>etc
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>Applications<span style="color: #000000; font-weight: bold;">/</span>MAMP<span style="color: #000000; font-weight: bold;">/</span>conf mamp
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mv</span> apache2 apache2.d
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>Applications<span style="color: #000000; font-weight: bold;">/</span>MAMP<span style="color: #000000; font-weight: bold;">/</span>conf<span style="color: #000000; font-weight: bold;">/</span>apache apache2
$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>mamp<span style="color: #000000; font-weight: bold;">/</span>apache
$ <span style="color: #c20cb9; font-weight: bold;">mkdir</span> vhosts
$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>Applications<span style="color: #000000; font-weight: bold;">/</span>MAMP<span style="color: #000000; font-weight: bold;">/</span>logs mamp</pre></div></div>

<h3><span>Apache httpd.conf </span></h3>
<p>There are some changes you will want to make to the httpd.conf file. <code>$ sudo vim /etc/mamp/apache/httpd.conf</code>. All line numbers referenced below are from MAMP 1.7.2 and the higher the number gets, the more chance they are of being wrong cause I didn&#8217;t really pay attention to what all I edited that added lines as I went.</p>
<ul>
<li> Turn on ExtendedStatus (for non-production servers only).  This is on line 295.  Change <code>#ExtendedStatus On</code> to <code>ExtendedStatus On</code> (remove the hash (#))</li>
<li> Make sure User on line 326 has administrative privileges on the mac.</li>
<li> ServerAdmin on line 336 should an email address that you can be contacted at (this is not all that important to change if you are going to setup vhosts)</li>
<li> ServerName on line 351 should be the domain name you are using (this is also not all that important if you are going to setup vhosts)</li>
<li> IMPORTANT, on line 639 you will notice that /Applications/MAMP/bin/SQLiteManger and /Applications/MAMP/bin/mamp are shared and publically available. While convenient for administrators, this is not good for the public to see, so you will want to set a password on these directories. We will insure that phpmyadmin asks for a password later as well. Change that section to look like this:</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;"><span style="color: #00007f;">Alias</span> /SQLiteManager <span style="color: #7f007f;">&quot;/Applications/MAMP/bin/SQLiteManager&quot;</span>
&nbsp;
&lt;<span style="color: #000000; font-weight:bold;">Directory</span> <span style="color: #7f007f;">&quot;/Applications/MAMP/bin/SQLiteManager&quot;</span>&gt;
    <span style="color: #00007f;">Options</span> <span style="color: #0000ff;">Indexes</span> MultiViews
    <span style="color: #00007f;">AllowOverride</span> <span style="color: #0000ff;">None</span>
    <span style="color: #00007f;">AuthType</span> Basic
    <span style="color: #00007f;">AuthName</span> <span style="color: #7f007f;">&quot;YOUR_SERVER_HOSTNAME&quot;</span>
    <span style="color: #00007f;">AuthUserFile</span> /Library/WebServer/passwords/password
    <span style="color: #00007f;">Require</span> valid-<span style="color: #00007f;">user</span>
&lt;/<span style="color: #000000; font-weight:bold;">Directory</span>&gt;
&nbsp;
<span style="color: #00007f;">Alias</span> /MAMP <span style="color: #7f007f;">&quot;/Applications/MAMP/bin/mamp&quot;</span>
&nbsp;
&lt;<span style="color: #000000; font-weight:bold;">Directory</span> <span style="color: #7f007f;">&quot;/Applications/MAMP/bin/mamp&quot;</span>&gt;
    <span style="color: #00007f;">Options</span> <span style="color: #0000ff;">Indexes</span> MultiViews
    <span style="color: #00007f;">AllowOverride</span> <span style="color: #0000ff;">None</span>
    <span style="color: #00007f;">AuthType</span> Basic
    <span style="color: #00007f;">AuthName</span> <span style="color: #7f007f;">&quot;YOUR_SERVER_HOSTNAME&quot;</span>
    <span style="color: #00007f;">AuthUserFile</span> /Library/WebServer/passwords/password
    <span style="color: #00007f;">Require</span> valid-<span style="color: #00007f;">user</span>
&lt;/<span style="color: #000000; font-weight:bold;">Directory</span>&gt;</pre></div></div>

<ul>
<li> Uncomment relevant lines 1087 &#8211; 1092, this will turn on server-status (only do this on non-production boxes).  Either leave <code>Allow from .example.com</code> commented out and add <code>Allow from all</code> or put in a valid domain name in place of .example.com</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;">&lt;<span style="color: #000000; font-weight:bold;">Location</span> /server-status&gt;
    <span style="color: #00007f;">SetHandler</span> server-status
    <span style="color: #00007f;">Order</span> <span style="color: #00007f;">deny</span>,<span style="color: #00007f;">allow</span>
    <span style="color: #00007f;">Deny</span> <span style="color: #00007f;">from</span> <span style="color: #00007f;">all</span>
    <span style="color: #00007f;">Allow</span> <span style="color: #00007f;">from</span> <span style="color: #00007f;">all</span>
&lt;/<span style="color: #000000; font-weight:bold;">Location</span>&gt;</pre></div></div>

<ul>
<li> Uncomment line 1133 for the <code>NameVirtualHost</code> and add lines so it looks like this:</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;"><span style="color: #00007f;">NameVirtualHost</span> *:<span style="color: #ff0000;">80</span>
&nbsp;
&lt;<span style="color: #000000; font-weight:bold;">VirtualHost</span> *:<span style="color: #ff0000;">80</span>&gt;
    <span style="color: #00007f;">DocumentRoot</span> /Library/WebServer/Documents/
&lt;/<span style="color: #000000; font-weight:bold;">VirtualHost</span>&gt;
&nbsp;
<span style="color: #00007f;">Include</span> /Applications/MAMP/conf/apache/vhosts/*.conf</pre></div></div>

<h3><span>Create htpasswd file for Authentication </span></h3>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>WebServer<span style="color: #000000; font-weight: bold;">/</span>passwords
$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>WebServer<span style="color: #000000; font-weight: bold;">/</span>passwords
$ htpasswd <span style="color: #660033;">-cs</span> password username</pre></div></div>

<h3><span> vhost .conf file </span></h3>
<p>A typical vhost file should be in /etc/mamp/apache/vhosts and look something like the following. Don&#8217;t worry about the cronolog line yet, we will install that later down in this article.</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;">&lt;<span style="color: #000000; font-weight:bold;">VirtualHost</span> *:<span style="color: #ff0000;">80</span>&gt;
    <span style="color: #00007f;">ServerName</span> psyjinx.com
    <span style="color: #00007f;">ServerAdmin</span> jyoung@psyjinx.com
    <span style="color: #00007f;">ServerAlias</span> *.psyjinx.com
    <span style="color: #00007f;">DocumentRoot</span> /Library/WebServer/Documents/psyjinx/
    <span style="color: #00007f;">ErrorLog</span> <span style="color: #7f007f;">&quot;|/usr/sbin/cronolog /var/log/mamp/psyjinx_error_log-%Y%m%d&quot;</span>
    <span style="color: #00007f;">CustomLog</span> <span style="color: #7f007f;">&quot;|/usr/sbin/cronolog /var/log/mamp/psyjinx_access_log-%Y%m%d&quot;</span> combined
&lt;/<span style="color: #000000; font-weight:bold;">VirtualHost</span>&gt;</pre></div></div>

<h3><span> </span><span> .profile or .bash_profile or .bashrc </span></h3>
<p>You will need to make the following changes to your .bash_profile or .profile (or .bashrc). I recommend just using a .profile. Again, there will be a different article on all the changes I typically put in my .profile. At a minimum you should add the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PATH</span>=<span style="color: #000000; font-weight: bold;">/</span>Applications<span style="color: #000000; font-weight: bold;">/</span>MAMP<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>Applications<span style="color: #000000; font-weight: bold;">/</span>MAMP<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #007800;">$PATH</span></pre></div></div>

<h3><span> </span><span> Configure MAMP to Start Silently on Boot </span></h3>
<p>MAMP by default only starts the servers when you boot the computer, sign in as a user, and launch the application. This is not acceptable if your server is being used for anything other than personal use. Ideally you want MAMP to start on boot, so when the power goes out in the middle of the night and comes back on, the computer will boot up automatically and everything will just work without you needing to drive to the office, login in and launch an application.</p>
<p>This involves created 2 files and placing them in /Library/LaunchDaemons/. You need to have root privledges to do this, so you must use the terminal. I use vim.</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;">touch</span> <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>LaunchDaemons<span style="color: #000000; font-weight: bold;">/</span>info.mamp.start.apache.plist
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">touch</span> <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>LaunchDaemons<span style="color: #000000; font-weight: bold;">/</span>info.mamp.start.mysql.plist</pre></div></div>

<p><strong>UPDATE:</strong> At some point in the 10.5.x life this changed.  I haven&#8217;t narrowed it down to what update breaks this, but something does.  If you have the most current 10.5.x, you will want to put the apache startup file in LaunchDaemons and you will want to put the mysql startup file in LaunchAgents and chown it to admin and NOT chown the db and tmp directories.</p>
<p>The two files should look like this:</p>
<h4><span> </span> <span>info.mamp.start.apache.plist </span></h4>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #00bbdd;">&lt;!DOCTYPE plist PUBLIC &quot;-//Apple/DTD PLIST 1.0//EN&quot; &quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;&gt;</span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;plist</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dict<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Label<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>info.mamp.start.apache<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>ProgramArguments<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;array<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/Applications/MAMP/Library/bin/apachectl<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>start<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/array<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>RunAtLoad<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;true</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dict<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/plist<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<h4><span> </span><span> info.mamp.start.mysql.plist </span></h4>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #00bbdd;">&lt;!DOCTYPE plist PUBLIC &quot;-//Apple Computer//DTD PLIST 1.0//EN&quot; &quot;http:// www.apple.com/DTDs/PropertyList-1.0.dtd&quot;&gt;</span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;plist</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dict<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Label<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>info.mamp.start.mysql<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>ProgramArguments<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;array<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/Applications/MAMP/Library/bin/mysqld_safe<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>--port=3306<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>--socket=/Applications/MAMP/tmp/mysql/mysql.sock<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>--lower_case_table_names=0<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>--pid-file=/Applications/MAMP/tmp/mysql/mysql.pid<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>--log-error=/Applications/MAMP/logs/mysql_error_log<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/array<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>RunAtLoad<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;true</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dict<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/plist<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Before this can do it&#8217;s magic you need to change some permissions for mysql.<br />
NOTE: I have noticed some inconsistent results with this.  Try everything without changing permissions first.  If something doesn&#8217;t work, give the following a shot.</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;">chown</span> <span style="color: #660033;">-R</span> mysql:admin <span style="color: #000000; font-weight: bold;">/</span>Applications<span style="color: #000000; font-weight: bold;">/</span>MAMP<span style="color: #000000; font-weight: bold;">/</span>db<span style="color: #000000; font-weight: bold;">/</span>mysql
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> mysql:admin <span style="color: #000000; font-weight: bold;">/</span>Applications<span style="color: #000000; font-weight: bold;">/</span>MAMP<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>mysql</pre></div></div>

<h2><span> </span><span>Install Cronolog </span></h2>
<p>Cronolog is what I last used to do log rotation. I can&#8217;t say it works exactly the way I want it to, or more likely I haven&#8217;t configured it correctly. Once you download it, un tar.gz it, compile it and move it to the proper place.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> to<span style="color: #000000; font-weight: bold;">/</span>whereever<span style="color: #000000; font-weight: bold;">/</span>you<span style="color: #000000; font-weight: bold;">/</span>saved<span style="color: #000000; font-weight: bold;">/</span>cronolog-1.6.2.tar.gz
$ <span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xvzf</span> cronolog-1.6.2.tar.gz
$ <span style="color: #7a0874; font-weight: bold;">cd</span> cronolog-1.6.2
$ .<span style="color: #000000; font-weight: bold;">/</span>configure
$ <span style="color: #c20cb9; font-weight: bold;">make</span>
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">cp</span> src<span style="color: #000000; font-weight: bold;">/</span>cronolog <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<h2><span> </span><span> Confirming It Works </span></h2>
<p>Ok, you should be done. Restart your computer and on boot Apache and MySQL should startup on boot. You can confirm this by trying to hit your machine from a different machine on your network with a web browser or log in and start up the MAMP application and make sure it shows Apache and MySQL as running.</p>
<h2><span> </span><span> Configure PHPMyAdmin </span></h2>
<p>There isn&#8217;t much to do here, but you want to make sure it asks for a password, so you want to edit the <code>config.inc.php</code> file in <code>/Applications/MAMP/bin/phpMyAdmin</code> and make sure <code>$cfg['Servers'][$i]['auth_type']</code> is set to <code>http</code>.  It is on line 84 (or thereabouts) and should look like this when you are done:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$cfg</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Servers'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'auth_type'</span><span style="color: #009900;">&#93;</span>     <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http'</span><span style="color: #339933;">;</span>    <span style="color: #666666; font-style: italic;">// Authentication method (config, http or cookie based)?</span></pre></div></div>

<p>Go to <a title="http://localhost/phpMyAdmin" rel="nofollow" href="http://localhost/phpMyAdmin">http://localhost/phpMyAdmin</a> to make sure it is working.  The default user/pass for MAMP is <code>root</code> / <code>root</code>.  You will want to change this.  In phpmyadmin, click on <code>Privileges</code>. You should see a page w/ 3 users listed. Only one of which will have Grant privilegs, the User should be root. In the last column on that row, click the edit icon, scroll down to the &#8216;Change Password&#8217; section and change the password to something you will never forget.</p>
<h3><span> Consequences of Changing the root Password (which you should do) </span></h3>
<ul>
<li> <code>/Applications/MAMP/bin/stopMysql.sh</code> will need to be updated.  Just edit it with vim (or something), change -proot to -p[yournewpassword]</li>
<li><code>/Applications/MAMP/bin/mamp/index.php</code> will need to be updated.  At a minimum you need to change the <code>$link</code>, otherwise this page will only show a mysql error when loaded.  change the 2nd &#8216;root&#8217; to be your new password.</li>
</ul>
<h2> <span>Install DBI and DBD::MySQL</span></h2>
<p>It is unfortunate that this does not work out of the box, cause it was a pain to figure out. The MAMP pre-compiled .dmg does not have the mysql include and lib folders with it. You need to get the MAMP source, configure and build mysql from there, then move the include and lib folders in place. Unfortunately the lib folder has synlinks pointing all over the place so I took the overkill approach and just put the entire mysql folder where the libs should be and modified the mysql_config file to point to the new place.</p>
<p>Good news is installing DBD is easy &#8211; If this is your first time installing anything from CPAN, you will go though a CPAN setup, just take all the defaults (there are a lot of questions) the ones that don&#8217;t have defaults, just take the obvious answers (like country to download files from)</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;">perl</span> <span style="color: #660033;">-MCPAN</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'install DBI'</span></pre></div></div>

<p>Installing DBD::mysql is the problem &#8211; go ahead and try to install it anyway</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;">perl</span> <span style="color: #660033;">-MCPAN</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'install DBD::mysql'</span></pre></div></div>

<p>Do the following to fix it.</p>
<ul>
<li> get the MAMP source &#8211; Source forge link is &#8211; <a title="http://sourceforge.net/project/showfiles.php?group_id=121134&amp;package_id=132117" rel="nofollow" href="http://sourceforge.net/project/showfiles.php?group_id=121134&amp;package_id=132117">http://sourceforge.net/project/showfiles.php?group_id=121134&amp;package_id=132117</a></li>
<li> For MAMP 1.7.2 you need MySQL 5.0.41</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ curl <span style="color: #660033;">-O</span> http:<span style="color: #000000; font-weight: bold;">//</span>internap.dl.sourceforge.net<span style="color: #000000; font-weight: bold;">/</span>sourceforge<span style="color: #000000; font-weight: bold;">/</span>mamp<span style="color: #000000; font-weight: bold;">/</span>MAMP_1.7.2_src.zip</pre></div></div>

<ul>
<li> Once you have it downloaded, unzip it, then find mysql and un-tar.gz it, go in it, get the include and lib files and copy them out</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">unzip</span> MAMP_1.7.2_src.zip
$ <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> __MACOSX
$ <span style="color: #7a0874; font-weight: bold;">cd</span> MAMP_1.7.2_src
$ <span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xvzf</span> mysql-5.0.41.tar.gz
$ <span style="color: #7a0874; font-weight: bold;">cd</span> mysql-5.0.41
$ <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">/</span>Applications<span style="color: #000000; font-weight: bold;">/</span>MAMP<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>include<span style="color: #000000; font-weight: bold;">/</span>mysql
$ .<span style="color: #000000; font-weight: bold;">/</span>configure
$ <span style="color: #c20cb9; font-weight: bold;">make</span>
$ <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-r</span> include<span style="color: #000000; font-weight: bold;">/*</span> <span style="color: #000000; font-weight: bold;">/</span>Applications<span style="color: #000000; font-weight: bold;">/</span>MAMP<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>include<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>
$ <span style="color: #7a0874; font-weight: bold;">cd</span> ..
$ <span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000; font-weight: bold;">/</span>Applications<span style="color: #000000; font-weight: bold;">/</span>MAMP<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>mysql <span style="color: #000000; font-weight: bold;">/</span>Applications<span style="color: #000000; font-weight: bold;">/</span>MAMP<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>mysql.disabled
$ <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-r</span> mysql-5.0.41 <span style="color: #000000; font-weight: bold;">/</span>Applications<span style="color: #000000; font-weight: bold;">/</span>MAMP<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>lib
$ <span style="color: #c20cb9; font-weight: bold;">vim</span> <span style="color: #000000; font-weight: bold;">/</span>Applications<span style="color: #000000; font-weight: bold;">/</span>MAMP<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>mysql_config
&nbsp;
... <span style="color: #000000; font-weight: bold;">set</span> pkglibdir around line <span style="color: #000000;">86</span> to be <span style="color: #000000; font-weight: bold;">/</span>Applications<span style="color: #000000; font-weight: bold;">/</span>MAMP<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>mysql-5.0.41<span style="color: #000000; font-weight: bold;">/</span>libmysql ...
&nbsp;
$ <span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>.cpan<span style="color: #000000; font-weight: bold;">/</span>build<span style="color: #000000; font-weight: bold;">/</span>DBD-mysql-<span style="color: #000000;">4.010</span>
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">rm</span> mysql.xsi
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">perl</span> Makefile.PL <span style="color: #660033;">--testuser</span>=<span style="color: #7a0874; font-weight: bold;">test</span> --mysql_config=<span style="color: #000000; font-weight: bold;">/</span>Applications<span style="color: #000000; font-weight: bold;">/</span>MAMP<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>mysql_config
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span>
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span>
$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>tmp
$ <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>Applications<span style="color: #000000; font-weight: bold;">/</span>MAMP<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>mysql.sock</pre></div></div>

<p>I don&#8217;t think that symlink will survive a restart though since mysql.sock is destroyed UPDATE: it doesn&#8217;t&#8230;</p>
<h2><span> </span><span> Install PERL CGI </span></h2>
<p>is easy</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;">perl</span> <span style="color: #660033;">-MCPAN</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'install CGI'</span></pre></div></div>

<h2><span> </span><span>Available Tools </span></h2>
<p>MAMP comes with all sorts of goodies, just look in <code>/Applications/MAMP/bin</code> and <code>/Applications/MAMP/Library/bin</code> to see them all.  Here are some of the ones I use most commonly:</p>
<ul>
<li> To start Apache: <code>$ sudo apachectl start</code></li>
<li> To stop Apache: <code>$ sudo apachectl stop</code></li>
<li> To restart Apache: <code>$ sudo apachectl restart</code></li>
<li> To view all Apache vhosts: <code>$ apachectl -t -D DUMP_VHOSTS</code></li>
<li> To start MySQL: <code>$ startMysql.sh &amp;</code></li>
<li> To stop MySQL: <code>$ stopMysql.sh</code></li>
<li> To view domain names in a log file:</li>
<li> There are two ways to do this, and it is a two step process both ways
<ul>
<li> Method 1: This is the typical way to view one log file</li>
</ul>
</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ logresolve <span style="color: #660033;">-s</span> ~<span style="color: #000000; font-weight: bold;">/</span>resolvedlog.txt <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>mamp<span style="color: #000000; font-weight: bold;">/</span>log_filename
$ <span style="color: #c20cb9; font-weight: bold;">cat</span> ~<span style="color: #000000; font-weight: bold;">/</span>resolvedlog.txt</pre></div></div>

<ul>
<li>
<ul>
<li> Method 2: This is the only way to view multiple logs since using a wildcard in the above syntax will generate an error</li>
</ul>
</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>mamp<span style="color: #000000; font-weight: bold;">/</span>log_<span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">|</span> logresolve <span style="color: #660033;">-s</span> ~<span style="color: #000000; font-weight: bold;">/</span>resolvedlog.txt<span style="color: #000000; font-weight: bold;">&lt;/</span>code<span style="color: #000000; font-weight: bold;">&gt;</span>
$ <span style="color: #c20cb9; font-weight: bold;">cat</span> ~<span style="color: #000000; font-weight: bold;">/</span>resolvedlog.txt</pre></div></div>

<ul>
<li> MAMP Admin Page: <a title="http://localhost/MAMP/" rel="nofollow" href="http://localhost/MAMP/">http://localhost/MAMP/</a> (should work w/ any vhost you have configured)</li>
<li> APC: <a title="http://localhost/MAMP/frame.php?src=apc.php" rel="nofollow" href="http://localhost/MAMP/frame.php?src=apc.php">http://localhost/MAMP/frame.php?src=apc.php</a></li>
<li> PHPMyAdmin: <a title="http://localhost/PhpMyAdmin/" rel="nofollow" href="http://localhost/PhpMyAdmin/">http://localhost/PhpMyAdmin/</a> or <a title="http://localhost/MAMP/frame.php?src=%2FphpMyAdmin%2F%3Flang%3Den-iso-8859-1" rel="nofollow" href="http://localhost/MAMP/frame.php?src=%2FphpMyAdmin%2F%3Flang%3Den-iso-8859-1">http://localhost/MAMP/frame.php?src=%2FphpMyAdmin%2F%3Flang%3Den-iso-8859-1</a></li>
<li> PHPInfo: <a title="http://localhost/MAMP/frame.php?src=info.php" rel="nofollow" href="http://localhost/MAMP/frame.php?src=info.php">http://localhost/MAMP/frame.php?src=info.php</a></li>
<li> SQLiteManager: <a title="http://localhost/MAMP/frame.php?src=%2FSQLiteManager%2F" rel="nofollow" href="http://localhost/MAMP/frame.php?src=%2FSQLiteManager%2F">http://localhost/MAMP/frame.php?src=%2FSQLiteManager%2F</a></li>
</ul>
<h2><span> </span><span> FAQ </span></h2>
<h3><span> </span><span>Why do you do all these settings and not just use the defaults setup by MAMP </span></h3>
<p>You could, well some of them. You don&#8217;t want to use the non-standard ports and you want everything to startup on boot, not on login of a user, and you want to have some command line access to control the servers. Much of the other settings, like all the symlinks, I mainly just do it be more &#8216;standard&#8217; so that things are where I expect them to be in the unix filesytem, not all tucked away inside of /Applications/MAMP/</p>
<h2><span> </span><span> References </span></h2>
<p>I wish I could say that I just knew all this but I didn&#8217;t.</p>
<p>I found two articles that combined together gave me the solution to get MAMP to start silently on boot.</p>
<ul>
<li> <a title="http://stringfoo.com/2008/08/25/tutorial-launching-mamp-silently-on-startup/" rel="nofollow" href="http://stringfoo.com/2008/08/25/tutorial-launching-mamp-silently-on-startup/">http://stringfoo.com/2008/08/25/tutorial-launching-mamp-silently-on-startup/</a></li>
<li> <a title="http://linsec.ca/blog/2006/11/22/mamp-and-php-development-on-the-mac/" rel="nofollow" href="http://linsec.ca/blog/2006/11/22/mamp-and-php-development-on-the-mac/">http://linsec.ca/blog/2006/11/22/mamp-and-php-development-on-the-mac/</a></li>
</ul>
<p>I found a couple of posts on getting DBD::MySQL working, these were the most helpful</p>
<ul>
<li> <a title="http://forum.webedition.de/phpBB/viewtopic.php?t=1204&amp;highlight=dbd#p10223" rel="nofollow" href="http://forum.webedition.de/phpBB/viewtopic.php?t=1204&amp;highlight=dbd#p10223">http://forum.webedition.de/phpBB/viewtopic.php?t=1204&amp;highlight=dbd#p10223</a></li>
<li> <a title="http://bugs.mysql.com/bug.php?id=30121" rel="nofollow" href="http://bugs.mysql.com/bug.php?id=30121">http://bugs.mysql.com/bug.php?id=30121</a></li>
</ul>
<p><!--  NewPP limit report Preprocessor node count: 118/1000000 Post-expand include size: 0/2097152 bytes Template argument size: 0/2097152 bytes Expensive parser function count: 0/100 --> <!-- Saved in parser cache with key psyjinx_mediawiki:pcache:idhash:4-0!1!0!!en!2 and timestamp 20090729042018 --></div>
</div>
</div>
</div>
<p><script type="text/javascript">// <![CDATA[
   if (window.runOnloadHook) runOnloadHook();
// ]]&gt;</script></p>
<p><!-- Served in 0.128 secs. --></p>
]]></content:encoded>
			<wfw:commentRss>http://psyjinx.com/jyoung/2009/01/how-to-setup-a-mac-os-x-mamp-based-web-server/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Install MySQL on Mac OS X 10.4.x</title>
		<link>http://psyjinx.com/jyoung/2007/05/install-mysql-on-mac-os-x-10-4-x/</link>
		<comments>http://psyjinx.com/jyoung/2007/05/install-mysql-on-mac-os-x-10-4-x/#comments</comments>
		<pubDate>Sat, 12 May 2007 20:06:50 +0000</pubDate>
		<dc:creator>James Young</dc:creator>
				<category><![CDATA[configuration]]></category>
		<category><![CDATA[macosx]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://psyjinx.com/wp/?p=61</guid>
		<description><![CDATA[<p>10.4.9 Intel / MySQL 5.0.41</p>

Get MySQL from http://dev.mysql.com/downloads/mysql/5.0.html, download this Mac OS X 10.4 (x86) (package format) version
Open the .dmg and install the two package files and one prefPane included:

mysql-5.0.41-osx10.4-i686.pkg
MySQLStartupItem.pkg
MySQL.prefPane


go into yoru System Preferences and start up MySQL (in the MySQL preference pane you just installed)
make sure /usr/local/mysql/bin/ is in your path, if not edit [...]]]></description>
			<content:encoded><![CDATA[<p><strong>10.4.9 Intel / MySQL 5.0.41</strong></p>
<ol>
<li>Get MySQL from http://dev.mysql.com/downloads/mysql/5.0.html, download this Mac OS X 10.4 (x86) (package format) version</li>
<li>Open the .dmg and install the two package files and one prefPane included:
<ul>
<li>mysql-5.0.41-osx10.4-i686.pkg</li>
<li>MySQLStartupItem.pkg</li>
<li>MySQL.prefPane</li>
</ul>
</li>
<li>go into yoru System Preferences and start up MySQL (in the MySQL preference pane you just installed)</li>
<li>make sure <code>/usr/local/mysql/bin/</code> is in your path, if not edit your .bash_profile</li>
<li>verify it is running: <code>$ mysql -u root mysql</code></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://psyjinx.com/jyoung/2007/05/install-mysql-on-mac-os-x-10-4-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install PHP5 on Mac OS X 10.4.x</title>
		<link>http://psyjinx.com/jyoung/2007/05/install-php5-on-mac-os-x-10-4-x/</link>
		<comments>http://psyjinx.com/jyoung/2007/05/install-php5-on-mac-os-x-10-4-x/#comments</comments>
		<pubDate>Sat, 12 May 2007 19:47:23 +0000</pubDate>
		<dc:creator>James Young</dc:creator>
				<category><![CDATA[configuration]]></category>
		<category><![CDATA[macosx]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://psyjinx.com/wp/?p=58</guid>
		<description><![CDATA[
Install MySQL on Mac OS X if you haven&#8217;t already
Install XCode if you haven&#8217;t already
Do either this:

Open NetInfo Manager
Modify /groups/wheel/users, add a new value for your login id, this will come into play later

<p>or this:</p>

$ niutil -appendprop / /groups/wheel users yourloginid


Get PHP Complete Source Code from php.net &#8211; http://php.net/get/php-5.2.2.tar.gz/from/a/mirror (more current versions are out now)
Open [...]]]></description>
			<content:encoded><![CDATA[<ol>
<li><a href="http://psyjinx.com/jyoung/2007/05/install-mysql-on-mac-os-x-10-4-x/">Install MySQL on Mac OS X</a> if you haven&#8217;t already</li>
<li>Install XCode if you haven&#8217;t already</li>
<li>Do either this:
<ul>
<li>Open NetInfo Manager</li>
<li>Modify /groups/wheel/users, add a new value for your login id, this will come into play later</li>
</ul>
<p>or this:</p>
<ul>
<li><code>$ niutil -appendprop / /groups/wheel users yourloginid</code></li>
</ul>
</li>
<li>Get PHP Complete Source Code from php.net &#8211; <a href="http://php.net/get/php-5.2.2.tar.gz/from/a/mirror">http://php.net/get/php-5.2.2.tar.gz/from/a/mirror</a> (more current versions are out now)</li>
<li>Open it up on your desktop, leaving a php-[version] folder:<br />
<code>$ tar xvzf /path/to/php-[version].tar.gz</code></li>
<li>Look at your phpinfo.php file (details in Enable PHP on Mac OS X 10.4.x)</li>
<li>Copy the Configure Command</li>
<li>Paste it into a vim buffer and strip out the &#8216;
<ul>
<li>:%s/&#8217;//g</li>
<li>NOTE: <code>/SourceCache/apache_mod_php/apache_mod_php-18.8/php/configure</code> is not part of what we need</li>
<li>Remove the <code>--without-pear</code> and change <code>--with-mysql=/usr</code> to be <code>--with-mysql=/usr/local/mysql</code></li>
<li>Configure from my Mac OS X 10.4.9 Intel MBP Core Duo looks like this:

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--mandir</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">man</span> <span style="color: #660033;">--infodir</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>info <span style="color: #660033;">--disable-dependency-tracking</span> <span style="color: #660033;">--with-apxs</span> <span style="color: #660033;">--with-ldap</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--with-kerberos</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--enable-cli</span> <span style="color: #660033;">--with-zlib-dir</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--enable-trans-sid</span> <span style="color: #660033;">--with-xml</span> <span style="color: #660033;">--enable-exif</span> <span style="color: #660033;">--enable-ftp</span> <span style="color: #660033;">--enable-mbstring</span> <span style="color: #660033;">--enable-mbregex</span> <span style="color: #660033;">--enable-dbx</span> <span style="color: #660033;">--enable-sockets</span> <span style="color: #660033;">--with-iodbc</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--with-curl</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--with-config-file-path</span>=<span style="color: #000000; font-weight: bold;">/</span>etc <span style="color: #660033;">--sysconfdir</span>=<span style="color: #000000; font-weight: bold;">/</span>private<span style="color: #000000; font-weight: bold;">/</span>etc <span style="color: #660033;">--with-mysql</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--with-mysql-sock</span>=<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>mysql.sock <span style="color: #660033;">--without-pear</span></pre></div></div>

</li>
</ul>
</li>
<li>Configure, make, make install, and setup the rest in terminal

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>lib
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> . mysql
$ <span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>Desktop<span style="color: #000000; font-weight: bold;">/</span>php-<span style="color: #7a0874; font-weight: bold;">&#91;</span>version<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #000000; font-weight: bold;">/</span>
$ .<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--mandir</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">man</span> <span style="color: #660033;">--infodir</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>info <span style="color: #660033;">--disable-dependency-tracking</span> <span style="color: #660033;">--with-apxs</span> <span style="color: #660033;">--with-ldap</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--with-kerberos</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--enable-cli</span> <span style="color: #660033;">--with-zlib-dir</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--enable-trans-sid</span> <span style="color: #660033;">--with-xml</span> <span style="color: #660033;">--enable-exif</span> <span style="color: #660033;">--enable-ftp</span> <span style="color: #660033;">--enable-mbstring</span> <span style="color: #660033;">--enable-mbregex</span> <span style="color: #660033;">--enable-dbx</span> <span style="color: #660033;">--enable-sockets</span> <span style="color: #660033;">--with-iodbc</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--with-curl</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--with-config-file-path</span>=<span style="color: #000000; font-weight: bold;">/</span>etc <span style="color: #660033;">--sysconfdir</span>=<span style="color: #000000; font-weight: bold;">/</span>private<span style="color: #000000; font-weight: bold;">/</span>etc <span style="color: #660033;">--with-mysql</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--with-mysql-sock</span>=<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>mysql.sock <span style="color: #660033;">--without-pear</span>
$ <span style="color: #c20cb9; font-weight: bold;">make</span>
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span>
$ <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>etc<span style="color: #000000; font-weight: bold;">/</span>php.ini.default <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;">vim</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>php.ini</pre></div></div>

</li>
<li>Edit the php.ini to have the include_path line match the following:

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;"><span style="color: #000099;">include_path</span> <span style="color: #000066; font-weight:bold;">=</span> <span style="color: #933;">&quot;.:/php/includes:/usr/lib/php&quot;</span></pre></div></div>

</li>
<li>Edit httpd.conf to use PHP5, not PHP4 (as it does by default), basically change all instances of php4 to php5

<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;">vim</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>httpd<span style="color: #000000; font-weight: bold;">/</span>httpd.conf</pre></div></div>

</li>
<li>Restart apahce: $ sudo apachectl restart</li>
<li>Verify PHP, MySQL, and Apache are playing nice.  Create a file with the following contents and confirm you get data back, not an error.  Name it something like mysqlphptest.php.  If you place it directly in your document root (/Library/WebServer/Documents) you can access it by going to http://localhost/mysqlphptest.php

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #990000;">mysql_pconnect</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'localhost'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'root'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span> or <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Error: &quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">mysql_error</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">mysql_select_db</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'mysql'</span><span style="color: #009900;">&#41;</span> or <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Error: &quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">mysql_error</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">print_r</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">mysql_fetch_array</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'SELECT * FROM user LIMIT 1'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

</li>
<li>Get PEAR working &#8211; <a href="http://psyjinx.com/jyoung/2007/05/enable-pear-on-mac-os-x-10-4-x/">Enable PEAR on Mac OS X 10.4.x</a></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://psyjinx.com/jyoung/2007/05/install-php5-on-mac-os-x-10-4-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enable PHP on Mac OS X 10.4.x</title>
		<link>http://psyjinx.com/jyoung/2007/05/enable-php-on-mac-os-x-10-4-x/</link>
		<comments>http://psyjinx.com/jyoung/2007/05/enable-php-on-mac-os-x-10-4-x/#comments</comments>
		<pubDate>Sat, 12 May 2007 19:41:07 +0000</pubDate>
		<dc:creator>James Young</dc:creator>
				<category><![CDATA[configuration]]></category>
		<category><![CDATA[macosx]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://psyjinx.com/wp/?p=54</guid>
		<description><![CDATA[<p>10.4.9
</p>

Edit the httpd.conf file
Uncomment the lines that contain php
Restart apache
Confirm it works via phpinfo.php
fix PEAR &#8211; see Enable PEAR on Mac OS X 10.4.x

<p>command summary of the above (assuming you know what to do in vim)</p>

$ sudo vim /etc/httpd/httpd.conf
$ sudo apachectl restart
$ vim /Library/WebServer/Documents/phpinfo.php

<p>phpinfo.php contents</p>

&#60;?php phpinfo&#40;&#41;; ?&#62;

]]></description>
			<content:encoded><![CDATA[<p><strong>10.4.9<br />
</strong></p>
<ol>
<li>Edit the httpd.conf file</li>
<li>Uncomment the lines that contain php</li>
<li>Restart apache</li>
<li>Confirm it works via phpinfo.php</li>
<li>fix PEAR &#8211; see <a href="http://psyjinx.com/jyoung/2007/05/enable-pear-on-mac-os-x-10-4-x/">Enable PEAR on Mac OS X 10.4.x</a></li>
</ol>
<p>command summary of the above (assuming you know what to do in vim)</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;">vim</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>httpd<span style="color: #000000; font-weight: bold;">/</span>httpd.conf
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> apachectl restart
$ <span style="color: #c20cb9; font-weight: bold;">vim</span> <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>WebServer<span style="color: #000000; font-weight: bold;">/</span>Documents<span style="color: #000000; font-weight: bold;">/</span>phpinfo.php</pre></div></div>

<p>phpinfo.php contents</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #990000;">phpinfo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://psyjinx.com/jyoung/2007/05/enable-php-on-mac-os-x-10-4-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enable PEAR on Mac OS X 10.4.x</title>
		<link>http://psyjinx.com/jyoung/2007/05/enable-pear-on-mac-os-x-10-4-x/</link>
		<comments>http://psyjinx.com/jyoung/2007/05/enable-pear-on-mac-os-x-10-4-x/#comments</comments>
		<pubDate>Sat, 12 May 2007 19:32:41 +0000</pubDate>
		<dc:creator>James Young</dc:creator>
				<category><![CDATA[configuration]]></category>

		<guid isPermaLink="false">http://psyjinx.com/wp/?p=52</guid>
		<description><![CDATA[<p>10.4.9
There are two ways to do this:</p>
<p>Most Secure - but not tested</p>

Open NetInfo Manager
Modify /groups/wheel/users, add a new value for your login id
Verify it works:

$ pear list



<p>Less Secure &#8211; but tested</p>

give full access to /usr/lib/php

$ sudo chmod -R 7777 /usr/lib/php/



<p>NOTE: This makes PEAR work, still need to verify that PHP and PEAR are working together</p>
<p>10.4.10 [...]]]></description>
			<content:encoded><![CDATA[<p><strong>10.4.9<br />
</strong>There are two ways to do this:</p>
<p><strong>Most Secure </strong>- but not tested</p>
<ol>
<li>Open NetInfo Manager</li>
<li>Modify /groups/wheel/users, add a new value for your login id</li>
<li>Verify it works:

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ pear list</pre></div></div>

</li>
</ol>
<p><strong>Less Secure</strong> &#8211; but tested</p>
<ol>
<li>give full access to /usr/lib/php

<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: #660033;">-R</span> <span style="color: #000000;">7777</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>php<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

</li>
</ol>
<p>NOTE: This makes PEAR work, still need to verify that PHP and PEAR are working together</p>
<p><strong>10.4.10 and PHP 5.2.3<br />
</strong>Noticed that PEAR just worked, didn&#8217;t need to do anything</p>
]]></content:encoded>
			<wfw:commentRss>http://psyjinx.com/jyoung/2007/05/enable-pear-on-mac-os-x-10-4-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
