Xampp Proftpd Mac Configure
Until I recently switched to XAMPP I had been using MAMP to provide a local server environment on my Mac. A small but none the less important feature of MAMP is an option to have the Apache and MySQL servers started when you open the application. So, by checking this option and including MAMP as a Login Item my MAMP servers were up-and-running when I logged in. Unfortunately, XAMPP has no such option. Including XAMPP as a Login Item merely opens the XAMPP Control.app and I have to start the servers manually. An extra step I’d rather not have to do.
So, how can I have my XAMPP servers running whenever I login? The answer, by using a daemon.
This tutorial shows you how to use ProFTPD that comes with XAMPP for Linux 1.7. I'm using Ubuntu 8.10 in the tutorial, but this will work the same with every version of Linux.
1. Daemons
Daemons in OS X are system-wide services that are launched at system start-up. They are managed by a program named launchd which was first introduced in OS X 10.4 Tiger. Services that are run on a per-user basis are known as agents, but are still managed by launchd. From a user’s perspective, launchd replaces the more traditional cron.
To have launchd start XAMPP’s Apache server as a service we need to create a launchd configuration file. This configuration file has a .plist extension, a format familiar to many OS X users. launchd configuration files can be placed in one of three folders determining when and for whom the service will start.
Zm400-2001-0100t. Please identify the driver version that you download is match to your OS platform.2.
- System startup [all users]: /Library/LaunchDaemons/
- User login [all users]: /Library/LaunchAgents/
- User login [this user only]: ~/Library/LaunchAgents/
2. What You’ll Need
Any text editor will allow you to create the necessary configuration file, but you’ll be asked to authenticate if saving the file in either the /Library/LaunchDaemons/ or /Library/LaunchAgents/ folders. You can use a text editor like Smultron by Peter Borg which will allow you to authenticate. I’m sure there are others. There’s also a great little app called Lingon, coincidentally by the same author, which makes the whole configuration a snap. Whilst both Smultron and Lingon are free they’re unfortunately no longer being developed. However, the latest (last?) versions of both run fine under OS X 10.5.8 Leopard 0S X 10.6.2 Snow Leopard.
3. Creating the launchd Configuration File
The configuration file I’m going to create will start XAMPP’s Apache server as a service at system startup. In Terminal I’d type /Applications/XAMPP/xamppfiles/xampp startapache to start XAMPP’s Apache server, so this is the command I’ll include in my configuration file. There are other options available, but I’m only concerned with starting Apache. A full list of parameters can be found here.
If you’re using the standard Apache port 80 in XAMPP or any non-standard port below 1024 then you’ll need to place the configuration file in the /Library/LaunchDaemons/ folder. This is because XAMPP requires authentication to use ports below 1024 and a configuration file in the /Library/LaunchDaemons/ folder will run as root. If you place the configuration file in either of the other two folders it won’t be able to authenticate and the Apache server won’t start.
To start creating the configuration file, open Lingon and click the New button at the top-left corner.
Launch daemon selection in Lingon
Lingon will ask where you want to create the configuration file. Select Users Daemons and click Create.
Launch daemon configuration in Lingon
To configure the LaunchDaemon we need to do just 4 things:
- 1. Ensure the Enabled option is checked. If later you wish to disable the LaunchDaemon simply uncheck this option.
- 2. Enter a name for the configuration. I’ve called mine apachefriends.xampp.apache.start. Lingon will add the .plist extension for you.
- 3. Enter the command, as you would in Terminal, to start Apache. This is /Applications/XAMPP/xamppfiles/xampp startapache
- 4. We’re only concerned with the Run it when it is loaded by the system (at startup or login). All other options should remain unchecked.
That’s it. Save the file and you’re done. Whenever you reboot your Mac, XAMPP’s Apache server will be up-and-runing when you log-in. If you navigate to the /Library/LaunchDaemons/ folder you’ll now see the apachefriends.xampp.apache.start.plist file.
At the bottom right-hand corner of the Lingon window there’s an Expert Mode button. If you click this button you’ll see the configuration file that Lingon’s created. It should resemble this:
4. Adding XAMPP Control.app Login Items
This step is optional and only for the terminally lazy like me. If you want the XAMPP Control.app opened when you login simply add it to the Login Items in System Preferences > Accounts > your account > Login Items and set it to Hide.
XAMPP is a free distribution package that makes it easy to install Apache Web Server, PHP, PEAR, and MySQL. Before installing XAMPP, you should turn off any other web servers and instances of MySQL you have running on your Mac.
XAMPP is a free distribution package that makes it easy to install Apache Web Server, PHP, PEAR, and MySQL. Before installing XAMPP, you should turn off any other web servers and instances of MySQL you have running on your Mac.
Installing XAMPP on a Mac
- Download XAMPP for Mac OSX - Be sure to select the proper version of PHP. For Webucator classes, any version after 5 will be fine.
- Open the downloaded file (the DMG-Image).
- Drag and drop the XAMPP folder into your Applications folder.
Starting XAMPP on OSX
To start XAMPP simply open XAMPP Control (by going to /Applications/XAMPP/manager-osx.app in Finder) and start Apache and MySQL on the Manage Servers tab.
If MySQL Does Not Start
If your MySQL server isn't starting, you may need to set the permissions for it using Terminal with this command:
Testing your OSX XAMPP Installation
In your web browser, go to http://localhost. You should see the start page of XAMPP:
Class File Permissions

- Cmd+click on the ApplicationsXAMPPxamppfileshtdocs folder and select 'Get Info'.
- If the lock symbol at the bottom indicates that this information is locked, click the lock icon to unlock, and enter your user credentials.
- Once the settings are unlocked, choose 'everyone' under 'Sharing & Permissions' and change the option to 'Read & Write'.
Class Files
- Download the class files.
- After downloading the class files, navigate to ApplicationsXAMPPxamppfileshtdocs and create a new folder named Webucator and extract your class files in that folder.
Setting the MySQL Password on Macs
- The PHP files use 'pwdpwd' for the MySQL root password, while the default password is NO password.
- Change the password to pwdpwd by opening Terminal (Applications > Utilities > Terminal) and enter:
You will be asked to enter your Mac password; enter it and press enter. Then you will be asked if you want to set a password for your XAMPP pages, then for MySQL, and then for MySQL/phpMyAdmin user..to all of these just type 'n' for no and press enter.
Then it will say:
- Enter 'y' for 'yes, let me set a password for the root user' and press Enter
- Enter the password pwdpwd. You will be asked to enter it again for confirmation.
- Quit Terminal (Cmd+Q) and restart Apache and MySQL using the XAMPP Control Panel.
Testing phpMyAdmin
- Go to http://localhost
- Click on phpMyAdmin under Tools
- Enter 'root' for username
- Enter 'pwdpwd' for password
You should be able to get in.
Installing Northwind Database using XAMPP
NOTE: you should download the class files below before following these instructions, as it contains the Northwinds Database file(s).
- To install the Northwind database used in class, click on the 'phpMyAdmin' link on the left navigation bar of the XAMPP home page. That should take you to http://localhost/phpmyadmin.
- If it asks you to login, the username is root and the password is blank (unless you have already changed it to something else, like pwdpwd).
- On that page, click on the Import link under the Localhost heading.
- Browse to the Northwind-MySQL.sql file in your class files.
- Click the Go button on the bottom right of the page.
- You should get a Success message and Northwind should be added to the Database dropdown menu on the upper left of the page.
Recommended Editor
- Visual Studio Code ( Download, Install, and Set up)
- While you may use a different editor or IDE, Visual Studio Code is an excellent IDE to learn to code on. It provides a nice balance of power and simplicity and it is available on Windows and Mac.
Designate your testing server in Dreamweaver
NOTE: The following only applies if you are using Dreamweaver. If you are not, please ignore this section.
- Go to Site > New Site.
- In the Site Setup dialog, fill in the Site Name (e.g., PHP) and browse to the Local Site Folder (e.g., ApplicationsXAMPPxamppfileshtdocs).
- Choose the Servers tab.
- At the bottom of the box on the right, click +.
- On the Basic tab, provide a Server Name, set Connect using to Local/Network, ensure the Server Folder matches the local site folder you specified in step 2, and set the Web URL to http://localhost/Webucator/ClassFiles/.
- Click the Advanced button.
- In the Server Model field, select PHP MySQL.
- Click Save. The server should appear in the table on the Servers tab.
- Make sure that both the Remote and Testing checkboxes are checked.
- Click Save.
Testing PHP Files
All your class files should be located in ApplicationsXAMPPxamppfileshtdocsWebucatorClassFiles
2 Methods for Testing Files in Browser
To test any of the class files in your browser, say ApplicationsXAMPPxamppfileshtdocsWebucatorClassFilesPHPBasicsDemosHelloWorld.php, you can use 1 of 2 methods:
Method 1:
- Go to http://localhost/Webucator/ClassFiles/PHPBasics/Demos/HelloWorld.php in your web browser.
- Follow the same pattern to view all other class files; basically the ApplicationsXAMPPxamppfileshtdocs gets changed to http://localhost/
Method 2:
- Go to http://localhost/Webucator/ClassFiles/ in your web browser.
- Bookmark that page in your browser for easy access to it from now on.
- From there, you can see all the lesson folders and drill down to any class file for testing/viewing
And that's it
Happy Mac XAMPPing!