title: MAMP changes to Apache 'document root' are ineffective
body: <p>I seek help finding why MAMP fails to effect changes to the Apache 'document root', and fixing this problem.  This second edit of the original filing includes substantial additional information that may assist in recognition of solutions.     </p>
  
  <p>Apache recently stopped responding to changes in the 'DocumentRoot' directive in the 'main' server configuration section of the Apache httpd.conf.  Apache continues to work well, except that it remains stuck on one prior setting of 'DocumentRoot'.  I would value your help finding this problem's source, and fixing it.  </p>
  
  <p>I run Apache 2.0.64 on an early 2011 MacBookPro with Lion.  For convenience, I work within MAMP 2.0.5, which includes Apache 2.0.64.  I've been developing multiple websites, located in different directories under different paths.  To switch localhost between these paths and directories, I routinely used the MAMP (not MAMP Pro) GUI sequence of actions<br>
       'Preferences...' > 'Apache' > 'Document Root' > 'Select...'<br>
  to switch between two paths.</p>
  
  <p>A bit over a week ago, some setting or process behind this GUI switch became stuck on one of the paths ("path p", for simplicity).  The GUI itself is not stuck; it displays 'Document Root' as if it switches back and forth between path p and path q. However, only sites under path p will run on localhost/path.  If I switch the MAMP setting for 'document root' to path q and then try to run localhost site q, q will not run, even though it ran fine before the problem first occurred; but any site accessible through path p will still run.  </p>
  
  <p>Looking behind the MAMP GUI, 'phpinfo' reports 'DOCUMENT_ROOT' as being changed to 'path q' in phpinfo's 'Apache Environment' section, and also in '_SERVER("DOCUMENT_ROOT")' in the 'PHP Variables' section.  When I change the MAMP 'Document_Root" setting, I can, in real time using TextWrangler, watch the setting be updated in 'httpd.conf'.  </p>
  
  <p>The Mac 'Activity Monitor' shows seven 'httpd' processes running.  Using 'Inspect' shows all of them are running within MAMP.  A Mac 'Spotlight' search for httpd.conf reveals only the one 'httpd.conf' file discussed above.  </p>
  
  <p>Relevant error messages accessed through MAMP/logs/apache_error.log are always (except for the timestamp): </p>
  
  <p>-- resuming normal operations
  [Sun Apr 22 12:34:22 2012] [notice] caught SIGTERM, shutting down
  [Sun Apr 22 12:34:24 2012] [notice] Digest: generating secret for digest authentication ...
  [Sun Apr 22 12:34:24 2012] [notice] Digest: done
  [Sun Apr 22 12:34:24 2012] [notice] Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/0.9.8r DAV/2 PHP/5.3.6 configured -- resuming normal operations</p>
  
  <p>If I understand this correctly, the running version of Apache is 2.2.21, rather than Apache 2.0.64, which MAMP's FAQ page (displayed as a tab accessed the web screen opened from the GUI's 'Open start page' button) says is the installed version.  </p>
  
  <p>Corresponding error messages in the Console general error log are:</p>
  
  <p>4/21/12 9:40:27.746 PM [0x0-0xcd0cd].de.appsolute.MAMP: 120421 21:40:27 mysqld_safe mysqld from pid file /Applications/MAMP/tmp/mysql/mysql.pid ended
  4/21/12 9:40:28.653 PM [0x0-0xcd0cd].de.appsolute.MAMP: Warning: DocumentRoot [/Applications/MAMP/Library/docs/dummy-host2.example.com] does not exist
  4/21/12 9:40:28.721 PM [0x0-0xcd0cd].de.appsolute.MAMP: 120421 21:40:28 mysqld_safe Logging to '/Applications/MAMP/logs/mysql_error_log.err'.
  4/21/12 9:40:28.871 PM [0x0-0xcd0cd].de.appsolute.MAMP: 120421 21:40:28 mysqld_safe Starting mysqld daemon with databases from /Applications/MAMP/db/mysql
  4/21/12 9:40:29.799 PM [0x0-0xcd0cd].de.appsolute.MAMP: Warning: DocumentRoot [/Applications/MAMP/Library/docs/dummy-host2.example.com] does not exist</p>
  
  <p>Except for date and time, these messages remain the same for any changes through MAMP to 'DocumentRoot'. I cannot recognize any useful information in these messages.  </p>
  
  <p>Shortly before this problem occurred, I reinstalled MAMP in order to fix a problem with the MySQL server.  While trying to debug the MySQL server in MAMP, I and a more skilled computer scientist also installed MacPorts. </p>
  
  <p>It seems possible that MAMP is actually opening a version of Apache, 2.2.21, that might have been installed by MacPorts, rather than the version, 2.0.64, which presumably came with MAMP 2.0.5; but that part of MAMP still acts as if Apache 2.0.64 is the operational version.  If this is true, it might lead quickly to a solution, though I don't know enough about how MAMP or Apache works to follow through on this.  </p>
  
  <p>I've searched broadly for online advice, tested a suggestion to format WordPress for multiple users, and toyed with changing 'etc/hosts', which is now restored to default values.  Most of the concerned web sites are hard-coded in XHTML, PHP and CSS; a few use WordPress.  </p>
  
  <p>A day after I posted this problem to 'Stack Overflow', as question #10252067,not yet receiving a response, I appended an earlier version this query to a MAMP Forum thread about PHP not working.  That post has not yet been published, and may be under review.  As I look more closely at the problem, it appears to me that the part of the MAMP interface that interacts with httpd.conf may be working as it should, and that the problem might relate either to how httpd reads and interprets settings in httpd.conf, or to how MAMP recognizes and interacts among several possible versions of Apache.  </p>
  
  <p>I would appreciate your guidance to solve this failure to implement the Apache 'DocumentRoot' setting.</p>