OS X Local Server Setup

Ruby RVM

$ bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
Cloning into rvm...
remote: Counting objects: 5933, done.
remote: Compressing objects: 100% (2843/2843), done.
remote: Total 5933 (delta 3896), reused 4178 (delta 2323)
Receiving objects: 100% (5933/5933), 1.96 MiB | 1.91 MiB/s, done.
Resolving deltas: 100% (3896/3896), done.

  RVM:  Shell scripts enabling management of multiple ruby environments.
  RTFM: https://rvm.beginrescueend.com/
  HELP: http://webchat.freenode.net/?channels=rvm (#rvm on irc.freenode.net)

Installing RVM to /Users/mgardner/.rvm/
    Correct permissions for base binaries in /Users/mgardner/.rvm/bin...
    Copying manpages into place.
    Recording config files for rubies.

mgardner,

If you have any questions, issues and/or ideas for improvement please
fork the project and issue a pull request.

If you wish to disable the project .rvmrc file functionality, set
rvm_project_rvmrc=0 in either /etc/rvmrc or ~/.rvmrc.

NOTE: To Multi-User installers, please do NOT forget to add your users to the 'rvm' group.
  The installer no longer auto-adds root or users to the rvm group. Admins must do this.
  Also, please note that group memberships are ONLY evaluated at login time.
  This means that users must log out then back in before group membership takes effect!

Thank you for using RVM!

I sincerely hope that RVM helps to make your life easier and more enjoyable!!!

  ~Wayne

SYSTEM NOTES:

If you do not wish to enable reading of per-project .rvmrc files, simply set:
        export rvm_project_rvmrc=0
within either your /etc/rvmrc or $HOME/.rvmrc file, then log out and back in.

In case your shell exits on entering directory with freshly checked out sources
you should update .rvmrc file, and replace any `exit ` with `return `.

You _must_ read 'rvm requirements' for additional OS specific requirements for
various rubies, and native-extension gems. Expect failures until those are met!

For screen users, please do not forget to read https://rvm.beginrescueend.com/workflow/screen/.
You will need to add 'shell -/bin/bash' to your $HOME/.screenrc to properly load RVM.

  You must now complete the install by loading RVM in new shells.

  If you wish to use RVM in an interactive fashion in your shells then
  Place the following line at the end of your shell's loading files
  (.bashrc or .bash_profile for bash and .zshrc for zsh),
  after all PATH/variable settings:

  [[ -s "/Users/mgardner/.rvm/scripts/rvm" ]] && source "/Users/mgardner/.rvm/scripts/rvm"  # This loads RVM into a shell session.

  You only need to add this line the first time you install RVM.

  If you are choosing to source RVM into your environment to switch current
  shell environments, be sure to close this shell and open a new one so that
  the RVM functions load.

Installation of RVM to /Users/mgardner/.rvm/ is complete.

  Notes for Darwin ( Mac OS X )
    For Snow Leopard: Xcode Version 3.2.1 (1613) or later, such as 3.2.6 or Xcode 4.1.
    [ Please note that Xcode 3.x will *not* work on OS X Lion. The 'cross-over' is Xcode 4.1. ]

    You should download the Xcode tools from developer.apple.com, since the Snow Leopard dvd install contained bugs.
    You can find Xcode 4.1 for OS X Lion at:
    https://developer.apple.com/downloads/download.action?path=Developer_Tools/xcode_4.1_for_lion/xcode_4.1_for_lion.dmg

    ** Lion Users: Xcode Version 4.2.x for OS X Lion works only for ruby 1.9.3-p0 (or higher).
                   It currently fails to build several other rubies and gems, as well as several Homebrew and
                   Macports packages. Xcode Version 4.1 (4B110) works.
    ** NOTE: Currently, Node.js is having issues building with osx-gcc-installer. This is _not_ an RVM issue. This is
       because Node.js depends on the Carbon headers. ox-gcc-installer does not install these to the system.
       This issue only affects users using osx-gcc-installer, and not Xcode. The only fix is to install Xcode over osx-gcc-installer.

    For MacRuby: Install LLVM first.
    For JRuby:  Install the JDK. See http://developer.apple.com/java/download/  # Current Java version 1.6.0_26
    For IronRuby: Install Mono >= 2.6
		For Ruby 1.9.3: Install libksba # If using Homebrew, 'brew install libksba'

    To use an RVM installed Ruby as default, instead of the system ruby:
      rvm install 1.8.7 # installs patch 352: closest supported version
      rvm system ; rvm gemset export system.gems ; rvm 1.8.7 ; rvm gemset import system.gems # migrate your gems
      rvm --default 1.8.7

PHP Info

php.ini

/private/etc/php.ini

PHP Extensions

/usr/lib/php/extensions/no-debug-non-zts-20090626

Compiling mcrypt

DIY Mac Server Article

$ CFLAGS="-arch x86_64" CXXFLAGS="-arch x86_64" ./configure --disable-posix-threads
$ make
$ sudo make install

export MACOSX_DEPLOYMENT_TARGET=10.6
CFLAGS="-arch x86_64" \
CXXFLAGS="-arch x86_64"
./configure --prefix=/usr \
	--mandir=/usr/share/man \
	--infodir=/usr/share/info \
	--disable-dependency-tracking \
	--sysconfdir=/private/etc \
	--with-apxs2=/usr/sbin/apxs \
	--enable-cli \
	--with-config-file-path=/etc \
	--with-libxml-dir=/usr \
	--with-openssl=/usr \
	--with-kerberos=/usr \
	--with-zlib=/usr \
	--enable-bcmath \
	--with-bz2=/usr \
	--enable-calendar \
	--with-curl=/usr \
	--enable-exif \
	--enable-ftp \
	--with-gd \
	--with-jpeg-dir=/BinaryCache/apache_mod_php/apache_mod_php-53.4~2/Root/usr/local \
	--with-png-dir=/BinaryCache/apache_mod_php/apache_mod_php-53.4~2/Root/usr/local \
	--enable-gd-native-ttf \
	--with-ldap=/usr \
	--with-ldap-sasl=/usr \
	--enable-mbstring \
	--enable-mbregex \
	--with-mysql=mysqlnd \
	--with-mysqli=mysqlnd \
	--with-pdo-mysql=mysqlnd \
	--with-mysql-sock=/tmp/mysql.sock \
	--with-iodbc=/usr \
	--enable-shmop \
	--with-snmp=/usr \
	--enable-soap \
	--enable-sockets \
	--enable-sysvmsg \
	--enable-sysvsem \
	--enable-sysvshm \
	--enable-wddx \
	--with-xmlrpc \
	--with-iconv-dir=/usr \
	--with-xsl=/usr \
	--enable-zend-multibyte \
	--enable-zip \
	--with-pcre-regex=/usr \
	–with-mcrypt

Need to add PCRE lib with pcre.a and pcre.so files.
Need to add OpenSSL, JPEG and PNG libs.

MySQL Info

Resetting the MySQL root password

  1. Shutdown mysqld
  2. mysqld_safe —skip-grant-tables
  3. mysql

mysql> UPDATE mysql.user SET Password=PASSWORD WHERE User=‘root’;
mysql> FLUSH PRIVILEGES;