MAMP

From DigitalBlacksmith

Jump to: navigation, search

Contents

[edit] OS and Processor Checks

> sw_vers
OS Version 10.4.10
> uname -a
8.10.0 Darwin Kernel Version 8.10.0: Wed May 23 16:50:59 PDT 2007; root:xnu-792.21.3~1/RELEASE_PPC Power Macintosh powerpc
Paladin:/usr/local steve$

[edit] MySQL

Followed this excellent tutorial by Apple Dev --Steve 00:20, 8 September 2007 (EDT)

  • Grabbed source: MySql-5.0.45.tar.gz
  • Installed from source:
sudo ./configure --prefix=/usr/local/mysql 
--with-unix-socket-path=/usr/local/mysql/run/mysql_socket 
--with-mysqld-user=mysql --with-comment --with-debug

sudo make

sudo make install

</pre?

NOTE: Tutorial worked very well...ensure you kill any running mysqld processes before trying to start new build use:

Use:

<pre>
ps -A | grep mysqld

To find and use kill to stop.


Started the mysqld server:

/usr/local/mysql/bin/mysqld_multi start

NOTE: We need to ensure this gets mapped to the default cron job. Tried to do this but sudo doesn't like me!' For now leave it running as a process while I am logged in..

Update: logged out, logged back in..sudo likes me again..

Will come back to this...for now runnning as a process in user space. --Steve 02:16, 8 September 2007 (EDT)

Check out:

To start mysqld at boot time you have to copy support-files/mysql.server to the right place for your system

[edit] Apache

Following this tutorial

  • Grabbed httpd-2.2.4 source from here

Made an alias for wget in the process...

>alias wget='sudo /usr/local/bin/wget'
>wget http://download.nextag.com/apache/httpd/httpd-2.2.4.tar.bz2
  • Installed from source
bunzip2 httpd-2.2.4.tar.bz2
tar -xvf httpd-2.2.4.tar.bz2
cd httpd-2.2.4
sudo ./configure --enable-mods-shared=ALL
sudo make
sudo make install


It installed apache in /usr/local/apache2

Checked version and httpd apachectl links:

>sudo httpd -v
Server version: Apache/1.3.33 (Darwin)
Server built:   Mar 20 2005 15:08:27


Need to update httpd and apache2 command in path..


//Shut down current (old) version of apache
sudo apachectl stop

//Save old apachectl script
sudo cp /usr/sbin/apachectl /usr/sbin/apachectl.default

//Backup apachectl scripts in case I blow them away (which I did)

sudo cp /usr/sbin/apachectl /usr/sbin/apachectl.oldinstall
sudo cp /usr/local/apache2/bin/apachectl /usr/local/apache2/bin/apachectl.good

//Update symbolic link to new apachectl

cd /usr/local/apache2/bin
sudo ln -f ./apachectl /usr/sbin/apachectl

//Backup httpd executables
sudo cp /usr/sbin/httpd  /usr/sbin/httpd.oldinstall
sudo cp /usr/local/apache2/bin/httpd  /usr/local/apache2/bin/httpd.install

//Update symbolic link to new httpd
sudo ln -f ./httpd /usr/sbin/httpd

//Checked new command line -- looks like we have good commands now

httpd -v
Server version: Apache/2.2.4 (Unix)
Server built:   Sep  8 2007 01:25:37

apachectl -v
Server version: Apache/2.2.4 (Unix)
Server built:   Sep  8 2007 01:25:37

Edit httpd.conf:

</pre> cd /usr/local/apache2/conf

//Backup sudo cp httpd.conf httpd.conf.orig

//Edit sudo vi httpd.conf

</pre>


Major Edits:

   * Listen to Listen *:80
   * User and Group to www
   * server admin to good email address
   * server name to paladin.deepbondi.net:80
   * DocumentRoot to "/Library/Webserver/Documents"
   * Make the following edit in the second directory tag: 

</pre>

  1. This should be changed to whatever you set DocumentRoot to.

<Directory "/Library/Webserver/Documents">

   #
   # Possible values for the Options directive are "None", "All",
   # or any combination of:
   #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
   #
   # Note that "MultiViews" must be named *explicitly* --- "Options All"
   # doesn't give it to you.
   #
   # The Options directive is both complicated and important.  Please see
   # http://httpd.apache.org/docs/2.2/mod/core.html#options
   # for more information.
   #
   Options Indexes FollowSymLinks
   #
   # AllowOverride controls what directives may be placed in .htaccess files.
   # It can be "All", "None", or any combination of the keywords:
   #   Options FileInfo AuthConfig Limit
   #
   #STEVE NOTE:  THIS ALLOWS DIRECTORY SECURITY
   AllowOverride AuthConfig
   #
   # Controls who can get stuff from this server.
   #
   Order allow,deny
   Allow from all

</Directory> </pre>


   * Add this at bottom of file: 
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

Need to come back and add the phpMyAdmin http directory restrictions

Restarted apache and we are in business!! Hit the index test page OK! --Steve 01:24, 8 September 2007 (EDT)


[edit] PHP 5

Followed this turorial

Note: I had to modify the config procedure because php was choking on some extensions (.gz for one). So php is configure command I used is

sudo './configure' '--with-apxs2=/usr/local/apache2/bin/apxs' 
'--with-mysql=/usr/local/mysql' '--prefix=/usr/local/php5' 
'--with-config-file-path=/usr/local/php5' '--enable-force-cgi-redirect' '--disable-cgi' '--with-zlib'

Works!!

http://paladin.deepbondi.net/phptest.php --Steve 02:40, 8 September 2007 (EDT)


[edit] eAccelerator

Following this tutorial

Grabbed source:

wget http://bart.eaccelerator.net/source/0.9.5.2/eaccelerator-0.9.5.2.tar.bz2


Extracted:

bunzip2 eaccelerator-0.9.5.2.tar.bz2
tar -xvf eaccelerator-0.9.5.2.tar.bz2


Install from source:

export PHP_PREFIX="/usr/local/php5"
sudo $PHP_PREFIX/bin/phpize
sudo ./configure --enable-eaccelerator=shared --with-eaccelerator-userid=70 --with-php-config=$PHP_PREFIX/bin/php-config
sudo make

Note: I had to add the --with-eaccelersator-userid tag to Compile on OS X.

Edit php.ini

Note: for some reason this is parked at root

sudo vi /php.ini

Add this at end:

zend_extension="/usr/local/php5/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so"
eaccelerator.shm_size="16"
eaccelerator.cache_dir="/tmp/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"

Set up the eaccelerator cache:

sudo mkdir /tmp/eaccelerator
Paladin:~/eaccelerator-0.9.5.2 steve$ chown www:www /tmp/eaccelerator

Hit the phpinfo() page and confirmed all was well!

Personal tools