Wednesday, January 28, 2009

MAMP on Leopard part III

The final part to MAMP is PHP. PHP is already installed but not configured. 

Apache needs to be told how to handle .php files (otherwise they are shown as plain text source in the browser). This handler needs to be added to /etc/apache2/httpd.conf, add near similar commands towards the end of the file.

AddType application/x-httpd-php .php

Also check whether the PHP module line is not commented, remove a # if present.

LoadModule php5_module libexec/apache2/libphp5.so

The PHP config file is not active by default, you will want to do this:

sudo cp /etc/php.ini.default /etc/php.ini

As you have installed MySQL, you will want PHP to be able to talk to it you need to edit two lines to ensure it actually works:

mysql.default_socket = /tmp/mysql.sock
mysqli.default_socket = /tmp/mysql.sock


(Add the bold values) Then restart apache for the changes to take affect.

That completes this 3 part installation guide for MAMP on Leopard. P can also be Perl or Python, if you need those languages.

Tuesday, January 20, 2009

MAMP on Leopard part II

MySQL is the hugely popular SQL database server. It is the only part of MAMP that isn't installed by default with Leopard. No problem, a quick visit to mysql.com will let you download it, select Mac OS X package format. (N.B. Pick the 32-bit version, the 64-bit will cause a headache later if you plan to use Perl's MySQL DBI, see my previous post).

Run all 3 applications within the download: mysql-5.1.X-osx10.5-x86.pkg, MySQLStartupItem.pkg and MySQL.prefPane.

MySQL can be started/stopped via the the MySQL panel in System preferences, or via the command-line:

sudo /Library/StartupItems/MySQLCOM/MySQLCOM {start|stop|restart}

Now it is installed you should remove the anonymous login accounts and add a password to the root account. There is plenty of information on securing MySQL available here.

Configure PHP in part III.

Monday, January 12, 2009

MAMP on Leopard part I

In this three part tutorial I'll detail how to take Mac OS X 10.5 Leopard (client version) from no MAMP to MAMP.

MAMP being a twist on the more common LAMP.
  • Mac OS X
  • Apache
  • MySQL
  • PHP (or Python or Perl)
MAMP is key for using modern web services and software, e.g. phpMyAdmin, MediaWiki, the list is almost endless. Each part of this tutorial will address one element. I assume you have Mac OS X Leopard installed, if not go buy yourself a Mac!

Apache2 comes with Leopard (and is periodically updated too). All you need to do is switch it on. Jump to System Preferences > Sharing, tick "Web sharing" from the list and apache is now running!

Find your configuration file at /etc/apache2/httpd.conf. Files for the default location can be found in /Library/WebServer/Documents and CGI scripts in /Library/WebServer/CGI-Executables. User websites (http://localhost/~username) can be found in the Sites folder of the specified user. Note the location of any of these can be altered using your httpd.conf. I recommend reading up on the manual before editing your .conf files first.

You can also stop/start apache via the command-line using:

sudo apachectl {start|stop|restart}

MySQL will be covered in part II.

Friday, January 9, 2009

Condor 7.2.0

After not much luck with 7.1.x, I've successfully compiled 7.2.0 on Mac/PPC, openSUSE 10.3 64-bit & openSUSE 11.0 32-bit.

All using the following configure options:

./configure --disable-glibc-version-check --disable-gcc-version-check --disable-full-port --without-classads --without-gsoap

All I need to do now is test it on my pool, but looks promising so far!