European Union Flag
European Apple Users Information & Support
LOGIN
RSS Feed Icon
via fetchrss.com
The next event is:
CES 2018

On 9 January 2018
More events…

macOS 10.13 High Sierra
FREE
Amazon UK Mac Software Affiliate Link
My Mac doesn't need security software, right ?

How To Setup A Basic Web/Email Server with OS X 10.8/Server 2.x

Article ID = 95
Article Title = How To Setup A Basic Web/Email Server with OS X 10.8/Server 2.x
Article Author(s) = Graham Needham (BH)
Article Created On = 27th February 2013
Article Last Updated = 31st March 2015
Article URL = http://www.macstrategy.com/article.php?95

Article Brief Description:
How to setup and configure a basic internet/web/email server using OS X 10.8 Mountain Lion and Server 2.x

How To Setup A Basic Web/Email Server with OS X 10.8/Server 2.x

Go through each of the following sections in order:

Computer

Any Mac that can run OS X 10.8 Mountain Lion will do but we highly recommend the basic Mac mini - select the following model:
  • 2.3GHz quad-core Intel Core i7 > upgrade it to 2.6GHz if you can afford it
  • 4GB memory > upgrade it to 16GB
  • 256GB Solid-State Drive
Overall cost is approximately £999 including VAT.

Computer

If your computer did not come with OS X 10.8 Mountain Lion/Server 2 you will need to buy the software:

Business Internet Connection (static IP + ability to server web sites/email)

You need to host your server on a business internet connection. This usually consists of two things:
  1. Real world, internet based static IP address (see our Basic Networking 101 article)
  2. A (business) internet connection that allows you to run a server
If you can't get a static IP you could consider using a dynamic IP address service: UK business internet connections If you can't get a business internet connection you could consider colocating your server (UK providers): USA providers:

Domain Name(s)

You will need at least one domain name e.g. yourdomain.co.uk - you can purchase this from many domain providers but in the UK we recommend names.co.uk:

Click here for domain name registration and web hosting

Once you have a domain name, for each domain you need to configure the domain's DNS service to route the domain to your server:
  • An "A" name record for 'yourdomain.co.uk' should point to your static IP
  • If you are hosting a web site on that domain you should also create a "CNAME" record for 'www.yourdomain.co.uk' that points to 'yourdomain.co.uk'
  • If you are hosting email on that domain you should also create a "Mail Exchange" (MX) record that points to your static IP

Additional Hardware

If you need to rack mount your mini or Mac Pro (Silver) there are several options You should consider an extra hard disk for backing up your server:
  • mini external desktop hard disks (small)
    • G-Tech G-Drive mobile 5400rpm USB 3 + FireWire 800
      • 500GB (model number = GDMOCEA5001ADB | part code = 0G02384)
        Buy it now at Amazon UK Buy it now at Amazon USA
      • 750GB (model number = GDMOCEA7501ADB | part code = 0G02388)
      • 1TB (model number = GDMOCEA10001ADB | part code = 0G02392)
        Buy it now at Amazon UK Buy it now at Amazon USA
    • G-Tech G-Drive mini 7200rpm USB 3 + FireWire 800
      • 500GB (model number = GDRMU3EA5001BDB | part code = 0G02569)
        Buy it now at Amazon UK Buy it now at Amazon USA
      • 750GB (model number = GDRMU3EA7501BDB | part code = 0G02573)
      • 1TB (model number = GDRMU3EA10001BDB | part code = 0G02577)
        Buy it now at Amazon UK Buy it now at Amazon USA
    • LaCie Rugged Triple USB 3 + FireWire 800
    • NOTE: We do not recommend the LaCie Rugged Triple 1.5TB or 2TB models as they use two hard disks in RAID 0 mode which is catastrophic for your data if either drive fails.
      • 500GB 5400rpm (part code = 301982) Buy it now at Amazon UK Buy it now at Amazon USA
      • 500GB 7200rpm (part code = 301983) Buy it now at Amazon UK Buy it now at Amazon USA
      • 1TB 5400rpm (part code = 301984)
        Buy it now at Amazon UK Buy it now at Amazon USA
  • mini external desktop hard disks (full size)
  • NOTE: Special information on using drives that are larger than 2TB.
  • Mac Pro (Silver) internal 3.5" SATA hard disks
  • NOTE: Special information on using drives that are larger than 2TB.
    NOTE: Special information on using Advanced Format Technology (AFT) drives.
    : Large capacity hard disks (those over 4TB in size) may have differently positioned screw holes and sizes so may not fit all Apple computers - please check any products, screws, sleds and/or mounting brackets before purchasing such drives.
    • Hitachi Deskstar 7Kxxxx series bare drives 7200rpm
      • Hitachi Deskstar 7K2000 2TB (part code = HDS722020ALA330) Buy it now at Amazon UK Buy it now at Amazon USA
      • Hitachi Deskstar 7K3000 2TB (part code = HDS723020BLA642) Buy it now at Amazon UK Buy it now at Amazon USA
      • Hitachi Deskstar 7K3000 3TB (part code = HDS723030ALA640) Buy it now at Amazon UK Buy it now at Amazon USA
      • Hitachi Deskstar 7K4000 4TB (part code = HDS724040ALE640) Buy it now at Amazon UK Buy it now at Amazon USA
    • Hitachi Deskstar 5Kxxxx series bare drives 5400rpm
      • Hitachi Deskstar 5K3000 1.5TB (part code = HDS5C3015ALA632) Buy it now at Amazon UK Buy it now at Amazon USA
      • Hitachi Deskstar 5K3000 2TB (part code = HDS5C3020ALA632) Buy it now at Amazon UK Buy it now at Amazon USA
      • Hitachi Deskstar 5K3000 3TB (part code = HDS5C3030ALA630) Buy it now at Amazon UK Buy it now at Amazon USA
      • Hitachi Deskstar 5K4000 4TB (part code = HDS5C4040ALE630) Buy it now at Amazon USA
    • Hitachi Deskstar internal drive kits
      • Hitachi Deskstar 2TB 7200rpm (part code = H3IK20003272SE)
      • Hitachi Deskstar 3TB 7200rpm (part code = H3IK30003272SE)
      • Hitachi Deskstar 4TB 7200rpm (part code = H3IK40003272SE) Buy it now at Amazon UK Buy it now at Amazon USA
      • Hitachi CoolSpin 2TB (part code = H3IK20003254SE)
      • Hitachi CoolSpin 3TB (part code = H3IK30003254SE)
      • Hitachi CoolSpin 4TB (part code = H3IK40003254SE)
    • Seagate BarraCuda 7200rpm 4K sector AFT
      • Seagate BarraCuda 2016 3.5" 4TB 4K sector/AFT (part code = ST4000DM005)
      • Seagate BarraCuda 2016 3.5" 3TB 4K sector/AFT (part code = ST3000DM008) Buy it now at Amazon UK Buy it now at Amazon USA
      • Seagate BarraCuda 2016 3.5" 2TB 4K sector/AFT (part code = ST2000DM006) Buy it now at Amazon UK Buy it now at Amazon USA
      • Seagate BarraCuda 2016 3.5" 1TB 4K sector/AFT (part code = ST1000DM010)
      • Seagate BarraCuda 2016 3.5" 500GB 4K sector/AFT (part code = ST500DM009) Buy it now at Amazon UK Buy it now at Amazon USA
    • Seagate Desktop HDD.15 7200rpm 4K sector AFT version (formerly known as Barracuda)
      • Seagate Desktop HDD 3.5" 4TB 4K sector/AFT (part code = ST4000DM000) Buy it now at Amazon UK Buy it now at Amazon USA
      • Seagate Desktop HDD 3.5" 5TB 4K sector/AFT (part code = ST5000DM000) Buy it now at Amazon UK Buy it now at Amazon USA
      • Seagate Desktop HDD 3.5" 5TB 4K sector/AFT (part code = ST5000DM002) Buy it now at Amazon UK Buy it now at Amazon USA
      • Seagate Desktop HDD 3.5" 6TB 4K sector/AFT (part code = ST6000DM001) Buy it now at Amazon UK Buy it now at Amazon USA
      • Seagate Desktop HDD 3.5" 8TB 4K sector/AFT (part code = ST8000DM002) Buy it now at Amazon UK Buy it now at Amazon USA
    • Seagate Desktop HDD 7200.14 7200rpm 4K sector AFT version (formerly known as Barracuda)
      • Seagate Desktop HDD 3.5" 250GB 4K sector/AFT (part code = ST250DM000) Buy it now at Amazon UK Buy it now at Amazon USA
      • Seagate Desktop HDD 3.5" 320GB 4K sector/AFT (part code = ST320DM000) Buy it now at Amazon UK Buy it now at Amazon USA
      • Seagate Desktop HDD 3.5" 500GB 4K sector/AFT (part code = ST500DM002) Buy it now at Amazon UK Buy it now at Amazon USA
      • Seagate Desktop HDD 3.5" 1TB 4K sector/AFT (part code = ST1000DM003) Buy it now at Amazon UK Buy it now at Amazon USA
      • Seagate Desktop HDD 3.5" 2TB 4K sector/AFT (part code = ST2000DM001) Buy it now at Amazon UK Buy it now at Amazon USA
      • Seagate Desktop HDD 3.5" 3TB 4K sector/AFT (part code = ST3000DM001) Buy it now at Amazon UK Buy it now at Amazon USA
    • Seagate Desktop HDD 7200.12 7200rpm 512byte sector version (formerly known as Barracuda)
      • Seagate Desktop HDD 3.5" 160GB 7200.12 (part code = ST3160316AS) Buy it now at Amazon UK Buy it now at Amazon USA
      • Seagate Desktop HDD 3.5" 250GB 7200.12 (part code = ST3250312AS) Buy it now at Amazon UK Buy it now at Amazon USA
      • Seagate Desktop HDD 3.5" 320GB 7200.12 (part code = ST3320413AS) Buy it now at Amazon UK Buy it now at Amazon USA
      • Seagate Desktop HDD 3.5" 500GB 7200.12 (part code = ST3500413AS) Buy it now at Amazon UK Buy it now at Amazon USA
      • Seagate Desktop HDD 3.5" 750GB 7200.12 (part code = ST3750525AS) Buy it now at Amazon UK Buy it now at Amazon USA
      • Seagate Desktop HDD 3.5" 1TB 7200.12 (part code = ST31000524AS) Buy it now at Amazon UK Buy it now at Amazon USA
    • Western Digital Caviar Black 7200rpm 4K sector/AFT
      • Western Digital Caviar Black 5TB 4K sector/AFT (part code = WD5001FZWX) Buy it now at Amazon UK Buy it now at Amazon USA
      • Western Digital Caviar Black 6TB 4K sector/AFT (part code = WD6001FZWX) Buy it now at Amazon UK Buy it now at Amazon USA
    • Western Digital Caviar Black 7200rpm
      • Western Digital Caviar Black 500GB (part code = WD5003AZEX) Buy it now at Amazon UK Buy it now at Amazon USA
      • Western Digital Caviar Black 1TB (part code = WD1002FAEX) Buy it now at Amazon UK Buy it now at Amazon USA
      • Western Digital Caviar Black 1.5TB (part code = WD1502FAEX) Buy it now at Amazon USA
      • Western Digital Caviar Black 2TB (part code = WD2002FAEX) Buy it now at Amazon UK Buy it now at Amazon USA
      • Western Digital Caviar Black 3TB (part code = WD3001FAEX) Buy it now at Amazon UK Buy it now at Amazon USA
      • Western Digital Caviar Black 4TB (part code = WD4001FAEX) Buy it now at Amazon UK Buy it now at Amazon USA
    • Western Digital Caviar Green Intellipower (less platters)
      • Western Digital Caviar Green 500GB (part code = WD5000AZRX) Buy it now at Amazon UK Buy it now at Amazon USA
      • Western Digital Caviar Green 1TB (part code = WD10EZRX) Buy it now at Amazon UK Buy it now at Amazon USA
      • Western Digital Caviar Green 1.5TB (part code = WD15EZRX) Buy it now at Amazon USA
      • Western Digital Caviar Green 2TB (part code = WD20EZRX) Buy it now at Amazon UK Buy it now at Amazon USA
      • Western Digital Caviar Green 3TB (part code = WD30EZRX) Buy it now at Amazon UK Buy it now at Amazon USA
      • Western Digital Caviar Green 4TB (part code = WD40EZRX) Buy it now at Amazon UK Buy it now at Amazon USA
      • Western Digital Caviar Green 5TB (part code = WD50EZRX) Buy it now at Amazon UK Buy it now at Amazon USA
      • Western Digital Caviar Green 6TB (part code = WD60EZRX) Buy it now at Amazon UK Buy it now at Amazon USA
    • Western Digital Caviar Green Intellipower
      • Western Digital Caviar Green 1TB (part code = WD10EARX) Buy it now at Amazon UK Buy it now at Amazon USA
      • Western Digital Caviar Green 1.5TB (part code = WD15EARX) Buy it now at Amazon UK Buy it now at Amazon USA
      • Western Digital Caviar Green 2TB (part code = WD20EARX) Buy it now at Amazon UK Buy it now at Amazon USA
    • Toshiba P300 7200rpm
      • Toshiba P300 500GB (part code = HDWD105EZSTA) Buy it now at Amazon UK Buy it now at Amazon USA
      • Toshiba P300 1TB (part code = HDWD110EZSTA) Buy it now at Amazon UK Buy it now at Amazon USA
      • Toshiba P300 2TB (part code = HDWD120EZSTA) Buy it now at Amazon UK Buy it now at Amazon USA
      • Toshiba P300 3TB (part code = HDWD130EZSTA) Buy it now at Amazon UK Buy it now at Amazon USA
    • Toshiba X300 7200rpm
      • Toshiba X300 4TB 4K sector/AFT (part code = HDWE140EZSTA) Buy it now at Amazon UK Buy it now at Amazon USA
      • Toshiba X300 5TB 4K sector/AFT (part code = HDWE150EZSTA) Buy it now at Amazon UK Buy it now at Amazon USA
      • Toshiba X300 6TB 4K sector/AFT (part code = HDWE160EZSTA) Buy it now at Amazon UK Buy it now at Amazon USA
    • Toshiba E300 low-power/extended performance
      • Toshiba E300 1TB 5700rpm (part code = HDWA110XZSTA) Buy it now at Amazon USA
      • Toshiba E300 2TB 5700rpm (part code = HDWA120EZSTA) Buy it now at Amazon UK Buy it now at Amazon USA
      • Toshiba E300 3TB 5940rpm (part code = HDWA130EZSTA) Buy it now at Amazon UK Buy it now at Amazon USA
    : Large capacity hard disks (those over 4TB in size) may have differently positioned screw holes and sizes so may not fit all Apple computers - please check any products, screws, sleds and/or mounting brackets before purchasing such drives.
NOTE: If you are going to use Time Machine for backups it's worth using encrypted Time Machine backups.

Server Configuration

Initial Setup

  1. If you do not have OS X 10.8 purchase it and backup the OS X Installer
  2. If your Mac is not new erase install OS X
  3. Go through the OS X setup using a strong password
  4. Update OS X (go to Apple menu > Software Update)
  5. Login to the Apple App Store (Macintosh HD > Applications > App Store) using your Apple ID
  6. Purchase or install OS X Server 2

Initial Configuration

  1. Configure Apple menu > System Preferences > Network:
    • Wi-Fi > switch off
    • Keep ethernet, Wi-Fi and FireWire - remove all others ("-" button in bottom left)
    • Set service order (cog icon > Ser=t Service Order > drag "Ethernet" to the top of the list)
    • TCP/IP > set static IP address + DNS servers
  2. Configure Apple menu > System Preferences > Sharing:
    • Tick "Remote Sharing"
    • Change computer name to something appropriate e.g. "Internet Server"
    • Under 'Allow access for:' set to "Only these users" and add the primary admin user you created on initial setup
    • Tick all items for admin user "can access this computer to:"
  3. Configure Finder preferences (in the Finder click on the Desktop and go to Finder menu > Preferences)
    • General - tick all "Show these items on the desktop"
    • Sidebar - set as required but recommended to:
      • untick "Airdrop"
      • untick "Back to My Mac"
      • untick "Bonjour computers"
      • tick all "Devices"
  4. Setup the Dock up as required e.g. remove non-server application icons
  5. Configure Apple menu > System Preferences:
    • General:
      • Set scroll bars as required
      • Tick "Ask to keep changes when closing documents"
      • Tick "Close windows when quitting an application"
    • Screen Saver - set 'Start After' to "5 minutes"
    • CDs & DVDs - set all to ignore
    • Energy Saver:
      • Set 'Computer sleep' to "Never"
      • Set 'Display sleep' to "30 minutes"
      • Untick "Put hard disks to sleep when possible"
      • Untick "Allow power button to put the computer to sleep"
      • Tick "Wake for network access"
      • Tick "Start up automatically after a power failure"
    • Bluetooth - untick "On" and untick "Show Bluetooth in menu bar"
      • If using Mac headless/no monitor click "Advanced…" and untick all 3 open/wake items
    • Users & Groups > Login Options
      • Set 'Automatic login' to "Off"
      • Set 'Display Login' as "Name and password"
      • Untick all other items
    • Date & Time
      • Date & Time - tick "Set date and time automatically"
      • Time Zone - untick "Set time zone automatically using current location"
    • Software Update - untick all
    • Time Machine - set as required
    • Startup Disk - make sure the correct startup disk is selected/highlighted
  6. Now restart the computer and untick "Reopen windows when logging back in"

Install/Setup Additional Applications

  1. Download and install Workgroup Manager 10.8 (free)
  2. A decent text editor e.g. one of the following
  3. A launchd plist editor e.g. Lingon 3 Buy it now on the Mac App Store (£2.99)
  4. If you are going to install and use MySQL download a SQL graphical editor e.g. Sequel Pro (donationware)
  5. Add any new applications downloaded to the Dock
  6. Go to Macintosh HD > Utilities > Activity Monitor
    • Right click on Activity Monitor's icon in the Dock and select Dock Icon > Show CPU Usage
    • Right click on Activity Monitor's icon in the Dock and select Options > Keep in Dock
    • Right click on Activity Monitor's icon in the Dock and select Options > Open at Login

Enable The Root User

  1. Go to Apple menu > System Preferences > Users & Groups
  2. Click the lock icon to unlock it and enter your administrator name and password
  3. Click "Login Options" on the left and then click "Network Account Server: Join"
  4. Click "Open Directory Utility"
  5. Click the lock icon to unlock it and enter your administrator name and password
  6. Choose Edit > Enable Root User and then enter a strong root user password
  7. Logout
  8. Login as "root" with the password you have just set
  9. "Skip" the iCloud account setup
  10. Setup root's Finder preferences and Dock as required (see the initial configuration section above
  11. Logout unticking "Reopen windows when logging back in"

Secure Safari

  1. Go to Safari menu > Preferences > General
    • untick 'Open "safe" files after downloading'
    • Set 'New windows open with' to "Empty Page"
    • Set 'New tabs open with' to "Empty Page"
    • Set 'Homepage' to nothing (delete whatever is there)
  2. Go to 'Autofill' tab and untick everything
  3. Go to 'Security' tab and untick "Enable Java"

Initial Server Configuration

  1. Go to Macintosh HD > Applications > Server
  2. Enter your host name as required e.g. yourdomain.co.uk
  3. Apple Push Notifications > leave fields blank and click "Continue"
  4. Click Finish when setup is complete
  5. You will be presented with the server "Overview"
  6. Click on "Settings" and configure access as required
Alerts
  • Click on 'Alerts' on the left and then "Delivery" on the right
  • Click "Edit" to the right of "Email addresses" and add your alert notification email address(es)
  • Tick the alerts you want to receive
  • Delivery = your email address
  • Settings (recommended to turn on):
    • Certificate expiration
    • SMART status
    • Disk space
    • Software updates
Certificates
Users
  • Click on 'Users' on the left
  • Add users as required
  • NOTE: If the user is only accessing services e.g. email set 'Home Folder' to "None - Services Only".
    NOTE: If you're going to use FTP to upload files why not set up an "ftpuser" or similar for that purpose (but make sure they have a 'Home Folder' set to "Local Only" or they will not be able to use the FTP service).
    NOTE: Once a user has been created you can right click on their name in the list and set:
    • Edit Access to Services…
    • If you click "Manage Service Access" here you can set on an individual basis what services can be accessed by that user otherwise all basic services are accessible to all users by default. It is recommended to manage services manually and set the services required for each individual user as required.
    • Edit Mail Options…
    You can choose whether email for that user is stored locally or simply forwarded to a different address
    You can also set an email limit (size of individual email) here for the individual user
  • Advance Options…
  • This gives you more granular control over the users settings
    NOTE: You can add "Aliases" here which are useful for users with multiple email addresses coming to the same account e.g. joe.bloggs, joebloggs, joe and jb @yourdomain.co.uk. If you want email addresses to work for your additional, virtual domains you need to add in the FULL address e.g. joe.bloggs@youradditionaldomain.com
Groups
  • Click on 'Groups' on the left
  • Add groups as required
    • This is useful for setting group email addresses e.g. an email going to messages@yourdomain.co.uk will be received by all the users in that group
    • NOTE: Email groups only work for the primary email domain (see Mail below). It does not work for virtualised domains!
    • To create an email group, add a group, then right click on it choosing "Edit Group…"
    • Add members as required
    • Tick "Enable group mailing list"
    • NOTE: If you change the group membership at a later time it is safest to untick "Enable group mailing list" first, click done, edit the group again, change the membership as required and then tick "Enable group mailing list" followed by Done.
Mail
  • Click on 'Mail' on the left
  • Settings > Provide mail for:
    • Primary domain name e.g. yourdomain.co.uk
    • Add additional domains as virtual domains by clicking "Edit…" to the right
    • NOTE: Email groups only work for the primary domain e.g. yourdomain.co.uk.
  • Authentication: probably best to leave it on Automatic but you can customise it by clicking "Edit…" to the right - options are:
    • Automatic - will authenticate users against all accounts
    • Open Directory - open directory users only
    • Active Directory - Active Directory (AD) users only (if server is linked to one)
    • Local users - local user accounts only
    • Custom - customise the authentication options
  • Click "Edit Filtering Settings…"
    • Enable virus filtering
    • Enable blacklist filtering
    • Enable junk mail filtering
    NOTES for email clients:
    • Use any modern mail client
    • Set up accounts as POP or IMAP as required
    • Must login and add login for SMTP authentication
    • Must use SSL (see Certificates above)
Web Sites
  • Click on 'Websites' on the left
    • Enable PHP web applications if required
    • The default web site is automatically setup for the domain you entered for the original server setup e.g. yourdomain.co.uk
    NOTE: Website data/folders are found in Macintosh HD > Library > Server > Web > Data > Sites - the default website is created in a folder called "Default" in that location. it is best not to delete or alter the contents of that folder.
    NOTE: If you actually have a web site at yourdomain.co.uk you can edit it's settings and set the "Store Site Files In" to point to a different folder in the web server Sites folder location
    NOTE: Useful settings for each domain you add are:
    • To add a different domain e.g. www.yourdomain.co.uk and/or www.youradditionaldomain.com click the + button and enter the settings for your domain
    • SSL Certificates: set a certificate if required and it is installed
    • Store Site Files In: use the default "Automatically create a new folder" option as this creates a correctly named folder with the right permissions in the Sites folder
    • Additional domains: this is great for two reasons
    1. you have multiple domains pointing to the same web site e.g. www.yourdomain.com and www.yourdomain.co.uk
    2. you can add the root domain e.g. yourdomain.co.uk (without the www bit) so that accessing http://yourdomain.co.uk works
  • Index Files: you can set the required index file name or have more than one and drag them in priority order
  • Edit Advanced Settings:
    • Generally you will want all of these unticked
    • Use custom error page: this looks like a great option but we couldn't get it to work
  • Once you domain has been created a folder appears in the Sites location. You can delete any default files found in there ready for your web site files to go in it.
FTP
  • Create an FTP user if not already created (services only user)
  • Click on 'FTP' on the left
  • Select "Websites Root" from the "Share:' pop-up menu and then add (+ button) your FTP user with the "Read & Write" privilege
  • Select each web site you are sharing from "Share:' pop-up menu and then add (+ button) your FTP user with the "Read & Write" privilege - you have do this for all the web sites
  • NOTE: Or you can login as root and use the Finder to add the user at the Sites folder level and copy all permissions to files and folders in this folder.
    NOTE: The primary login directory will be the one that is currently set in the FTP settings screen - be careful what you leave it on if you have more than one FTP share point.
    NOTE: If you copy files to the FTP folder(s) using the Finder the permissions will not be set correctly on the files you copy. Once you've copied the files go to your site folder, Get Info on it, unlock it (bottom right) and select "Apply to enclosed items…" from the wheel pop-up menu just to the left of the lock icon. This will propagate the permissions down to all the files/folders you've copied within that site folder. Use FTP from then on.
    SECURITY NOTE: Because the FTP user has to have a local share point to access the FTP service the FTP user will have the ability to physically login to the computer at the login screen and access the Finder (they can't access the server admin tools as they are not allowed to "administrate" the server but access to the Finder is bad enough - this is a major security risk if the server is not in a secure location e.g. server room/house. If it's not consider using a different method/software to get web site files on to the server.

Install And Configure MySQL

If you need to run MySQL:
  1. Download MySQL (Community Server "Mac OS X ver. 10.7 (x86, 64-bit), DMG Archive")
  2. Install all three items:
    • mysql5.x.xxx.pkg
    • MySQLstartupitem.pkg
    • MySQLPrefPane (install for all users of this computer)
    NOTE: The first is the MySQL software. The second item allows MySQL to start when the Mac is booted up and the third is a System Preference that allows start/stop operation with a preference to enable it to start on boot.
  3. Go to Apple menu > System Prefernces > MySQL
    • Tick "Automatically Start MySQL Server on Startup" (if not already ticked)
    • Click "Start MySQL Server"
Set The MySQL Root Password
NOTE: This is not the same as the OS X root or admin password - this is a unique password to the MySQL root user, set a secure password and make sure you can remember what it is.
Login to OS X as root, go to Macintosh HD > Applications > Utilities > Terminal and issue this command: /usr/local/mysql/bin/mysqladmin -u root password 'yourpasswordhere' NOTE: Make sure you use the single 'quotes' surrounding the password!
Automate MySQL Dump Backups
  1. Login as root
  2. Create a "Backups" folder (in a relevant location usually the root of the primary hard disk will do)
  3. Use a text editor to create a MySQL dump backup command file e.g.

  4. #!/bin/bash

    # —
    # MySQL Back-up Script
    # —

    # Back-up All Databases
    /usr/local/mysql/bin/mysqldump --user=root --password=yourmysqlrootpassword -hlocalhost --all-databases --lock-tables | gzip > /Backups/sqlbackup_monday.sql.gz
    NOTE: Name it something like "mysql_backup_monday.command". NOTE: You can test the final command line works by pasting it directly into the Terminal and seeing if a backup file is produced.
  5. Use something like Lingon 3 to produce a launchd .plist (e.g. run a backup command file on the 1st of every month at a given time)
    • Click "+ New Job"
    • Name it appropriately e.g. "com.yourdomain.sqlbackupmonday.plist"
    • NOTE: plists are saved to Macintosh HD > private > var > root > Lirbary > LaunchAgents.
    NOTE: Rather than keep creating multiple plists in Lingon which is a little awkward, duplicate the file in the Finder, rename them and then use your text editor to edit the files (see example file below) - edit:
    • line 6 filename (must match the Finder name)
    • line 9 the command
    • lines 14, 16, 18 timing (day, hour and minute as required)
    • or lines 14, 16, 18 timing (hour, minute and weekday as required)
  6. Move the plist file(s) to Macintosh HD > System > Library > LaunchDaemons
  7. Restart the server
  8. Login as root
  9. In the Terminal run "launchctl list" to check your plist(s) have loaded (should show in the list with a status of "0" - zero)
Example launchd plist file: Example launchd plist file

Article Keywords: OS X OSX 108 Mountain Lion Server 2 3 internet web email SMTP POP PO3 IMAP secure SSL certificate apache php mysql ftp multiple virtual host hosts domain domains name names mail exchange A NAME CNAME DNS static IP colocate colocation co-locate co-location groups aliases alias backup time machine rack mount rackmount dump plist cron job cronjob launchd automate automatic regular

This article is © MacStrategy » a trading name of Burning Helix. Apple, the Apple logo, and Mac are trademarks of Apple Inc., registered in the U.S. and other countries. App Store is a service mark of Apple Inc.


If this information helped you or saved you time and/or money why not donate a little to us via PayPal?
All proceeds go directly to MacStrategy / Burning Helix Limited to help fund this web site.
If this information helped you or saved you time and/or money why not donate a little to us via PayPal?
All proceeds go directly to MacStrategy / Burning Helix Limited to help fund this web site.

Go to this
web page
to donate to us.