Posts Tagged ‘ tutorial ’

Tutorial: Launching MAMP Silently on Startup

Monday, August 25th, 2008

MAMP Web ServerMAMP is a great tool for running and managing a development server when you require more than the basic PHP configuration included with Leopard. However, getting the web server to run typically involves launching MAMP, entering your root password, and quitting MAMP.

This tutorial walks through the simple steps needed to launch MAMP silently on startup so that you do not have to enter your root password every time.

The issue with MAMP is that launching Apache must be done as root, so there’s no way to simply add MAMP to your startup items via the system’s Accounts Preferences in a way that will launch the app silently. But you don’t need to. Here’s the deal: MAMP’s launcher is just a pretty UI that opens a shell script that, in turn, launches MAMP’s Apache and MySQL servers.

You can set up launch daemons that do the exact same thing without the need to launch MAMP or enter a password.

Step 1: Create the Start-up Items

Open up your favorite text editor and paste the following into an empty document:

Create another for the MySQL start-up item:

Be sure to replace “YOUR_USERNAME” with the username for your account.

Step 2: Save the Files

Save this file as (or move the file to) /Library/LaunchDaemons/info.mamp.start.apache.plist and /Library/LaunchDaemons/info.mamp.start.mysql.plist, respectively.

Step 3: Set Permissions

If you try to launch the daemons at the moment, you’ll get a “dubious permissions” error. To correct this problem, you’ll need to change your permissions.

In your terminal, type:

You’re done! Reboot your computer and test that your development server is running as expected by opening a served page in your browser.

Sphere: Related Content

Adding a $PATH environment variable in OS X 10.5 (Leopard) Terminal

Sunday, August 24th, 2008

One thing that will inevitably come up when setting up a web server using MAMP on OS X Leopard is the need to add the PHP and PEAR binary paths to the Terminal $PATH variable. Fortunately, this is dead-simple.

Open a Terminal window and type the following (assuming you’ve installed MAMP in /Applications):

export PATH=/Applications/MAMP/bin/php5/bin:$PATH

If you’re using PHP4 instead, you’ll want to specify that path instead.

Now type the following to see your newly edited $PATH environment variable:

echo $PATH

You should see your MAMP PHP binary path tacked onto your $PATH string.

Now type the following:

pear upgrade-all

If everything went according to plan, you should see the output from Pear updating itself.

Sphere: Related Content

Tutorial: Starting Subversion on Startup

Wednesday, November 28th, 2007

Subversion Version Control SystemHonestly, I can’t remember if Subversion came pre-installed on Tiger or not, but I know for a fact that it does come as a standard component on Leopard. This is great news.

One small issue, though, is that there is not a way in the OS X UI to have Subversion start up when your computer boots up. This tutorial will help you set up a launch daemon that will fire up Subversion silently when your computer boots up.

Before we begin, you’ll need to make sure you have enabled root access on your machine. In Tiger, follow these instructions. In Leopard, follow these instructions instead.

Step 1: Create a Start-up Item

Open up your favorite text editor and paste the following into an empty document:

Step 2: Locate your repository

On line 16 of the plist file, you’ll find the string “/usr/local/svn” which points to the default repository location. If you have installed your repository in a different location, change the contents of this line to point to your repository. For instance, mine is on a separate drive, so my line looks like:

/Volumes/Max/SVN_Repository

Step 3: Save the File

Save this file as (or move the file to) /Library/LaunchDaemons/org.tigris.Subversion.plist.

Step 4: Set Permissions

If you try to launch the daemon at the moment, you’ll get a “dubious permissions” error. To correct this problem, you’ll need to change your permissions.

In your terminal, type:

cd /Library/LaunchDaemons/
sudo chown root:wheel org.tigris.Subversion.plist

You’re done! Reboot your computer and test that your SVN server is running as expected.

Sphere: Related Content

Tutorial: Enabling Root Access in OS X (Leopard)

Wednesday, November 28th, 2007

By default, the root account is disabled in OS X. If you are a developer new to the platform, you will be needing to access many things that are available only with root access. This tutorial walks you through the process of enabling the root account in Leopard (OS X 10.5).

NOTE: This guide is specific to enabling root access on Leopard, (10.5). To learn how to enable root access on Snow Leopard (10.6), follow these instructions. To learn how to enable root access on Tiger (10.4), follow these instructions instead.

Enabling Root in Leopard:

  1. Open the Directory Utility: In the Finder, navigate to the Utilities folder (tip: click on the desktop, hit Cmd+Shift+U).
  2. Click on the padlock to allow edits.
  3. Go Edit > Enable Root Password
  4. Enter and re-enter your password.

Now, you are set to access protected areas of the system via the terminal.

Sphere: Related Content

Tutorial: Enabling Root Access in OS X (Tiger)

Friday, March 30th, 2007

By default, the root account is disabled in OS X. If you are a developer new to the platform, you will be needing to access many things that are available only with root access. This tutorial walks you through the process of enabling the root account in OS X.

NOTE: This guide is specific to enabling root access on Tiger, (10.4). To learn how to enable root access on Snow Leopard (10.6), follow these instructions. To learn how to enable root access on Leopard (10.5), follow these instructions instead.

Enabling Root in Tiger:

  1. From within an account with administrative privilegs, open NetInfo Manager (found in the Utilities folder)
  2. If it is locked, click the Padlock icon in the lower portion of the window to allow changes
  3. Go to the tools menu and select “Enable Root User”
  4. Enter the password for your administrative account when prompted
  5. Now select Users from the “/” list, and select “root” from the users list
  6. Select the “passwd” row and double-click the password value
  7. Change the password one that is secure
  8. Click the padlock icon again to lock out further changes, and you’re done

Alternatively, you can simply type “sudo passwd root” in a terminal window, and you’re off to the races.

To change the root password once root access has been turned on, simply do the same and type “sudo passwd root” in a terminal window. Enter the new password, and you’re done.

Sphere: Related Content