Apache, MySQL, & PHP on OS X
Setting up AMP for OS X Server
Luckily for OS X Server 10.4 users, setting up the mighty triumvirate of Apache, MySQL, and PHP is quick and easy since everything is already installed.
- Launch MySQL Manager located in the Server folder.

- Click on the lock, supply your admin password and press the Install button to install MySQL. Provide a root password and verify it.

- Press Start to start MySQL service.

- Open Server Admin and log in for your server. Make sure Apache web server is running. Select Settings, then press the Modules tab.
- Scroll down until you see the php4_module. Check the box to enable it and save your settings. Apache will need to restart for PHP to load.

And that’s all she wrote.
Setting up AMP for OS X Client
To transform your ordinary OS X Client into a server to run Apache, MySQL, and PHP, follow these easy steps.
- Open Sharing Preference and turn on Personal Web Sharing. This will start Apache web server.

- Open Energy Saver Preference and set sleep to Never if you want your server to be accessible at all times. For the display settings, you can set however you’d like.

If you’re planning to host a web site with a domain name that’s accessible from the Internet, you may want to take a look at Lesson 2 of the OS X Server 10.4 tutorial since similar concepts apply.
Now that Apache is up and running, let’s go download MySQL Database Server and install it.
- At the time of this writing, version 5 is the official release ready for production. You can download the package here.
- Go through the painless install process. You should also install the MySQL preference panel included in the package so you can easily start and stop your MySQL server. It also has an option for MySQL server to start up automatically after rebooting.
Now that you have MySQL running, let’s give it a root user and password. Open the Terminal and type the following. Where it says yourpassword, provide your own password:
- /usr/local/mysql/bin/mysqladmin -u root password yourpassword
Once that’s done, you can exit out of the terminal.
Last but not least, let’s activate PHP which is already installed on OS X. The file we’ll be editing to do so is called http.conf, which Apache uses for it’s configuration upon start up.
- Open the Terminal and type: sudo pico /etc/httpd/httpd.conf. (without the period at the end)
- Provide your admin password and you’ll see the httpd.conf file open in pico, the built in text editor. Now you’ll make the necessary changes.
- Press control+w to search the document. Type in LoadModule php4_module and press enter.
- Your blinking box should be on the L of LoadModule php4_module. Press delete to erase the # in front of LoadModule php4_module.
- Press control+w again and seach for AddModule mod_php4.c. (without the period at the end)
- Again, delete the # in front of AddModule mod_php4.c.
- Press control+x to exit, confirm the changes and save the file.
By deleting the # in front of the 2 line in the http.conf file, Apache will add and load the module for PHP4. Now you have to restart Apache for it to recognize the change.
- In the terminal, type: sudo apachectl graceful.
- Or you can open Sharing Preference and press the Stop button for Personal Web Sharing. Press Start again to restart Apache.
And you’re done. Now you can install some great open source programs like WordPress for blogging, bbPress for creating your own forum, or Gallery for creating online photo albums.
Good luck!
No responses yet
Leave a Reply
You must be logged in to post a comment.
