Category Archives: osx / sls

snow leopard / snow leopard server articles

Time Capsule Time Machine Debugging – Tips to Curb Your Frustration

The Apple Time Capsule is a great device.  I have the 500GB model, Lis bought it for me a few years ago for the holidays.  It provides wifi/wired connectivity to a few devices in my home, my imac, mba, iPhone, Canon mx860 wireless printer, my Boxee Box, and my Windows 7 machine. I have a 500GB WDD external HDD attached to my TC for movies via my Boxee Box and a extra backups.  I also recently moved my itunes library to my Time Capsule so I can share it between devices in my home.

The Time Capsule (TC) provides automated incremental backup for my imac and my mba without fuss and provides a nice UI for restoring files which I rarely use but I like the peace of mind of not having to worry about backups outside watching a circle spin near my clock once in awhile.

While this is a great Apple multifunction device, it does have problems at times.  Most of our Apple products work flawlessly and we are spoiled by the convenience of a stable, intuitive, and refined operating systems and devices.  The Time Capsule is a great device but when it has problem, it can be a real pain in the ass to resolve.  If you use a few tools that I will highlight in this post and use resources available in the wild I assure you that you can overcome any problem with this device in a matter of hours.

Backups are full or you do not have enough space left on your TC to complete a new backup.  Exclude files.  Time Machine Preferences -> Options.  You do not need to backup your Archive directory of every app or discography you downloaded.  Backup your important files with Time Machine.  Take your heavy weight GBs of mp3s or videos and back them up elsewhere.  Start fresh, wipe the TC disk and start a new backup if you are still having issues.  Let it run overnight.

Backups fail and I don’t know why

Very helpful error!  So now you must check logs for more details.  There is a handy dashboard widget that sorts through the TM logs called Time Machine Buddy, this widget reads the Time Machine logs and lets you know what may causing the error.  In this case I had a permissions or file error from files copied from a Windows machine:

So I went ahead and excluded this directory as its not completely important that its backed up, its backed up elsewhere as well.

I tried to run backups again and they failed , so I excluded a the entire /Pictures/Archive directory.  The files in this directory had odd paths and were copied from a Windows machine so they are on warning and instead of checking each dir/file for now I just excluded this entire directory since its backed up in another place as well.   Turned TM on/off and tried to backup again.  It worked, backup finished.

Backup speeds are slow, take days, randomly fail, I cant copy files over 2GB over wireless.  Open airport utility.  Disconnect other devices.  Stop all other devices connected to the Time Capsule.  They may be effecting the network. 9 out of 10 times when I’ve tried to copy a 6GB bluray to my TC and they have failed, I’ve stopped all other network activity and let the copy go, it will complete quickly and shred the previous copy time by 3/4ths.  I’ve come to the conclusion that the Time Capsule just cant balance multiple bandwidth intensive threads very well.

If you are still having problems with Time Machine check these resources as most likely someone else has experienced the same problem and the solutions is out there.  Check Airport Utility, restart the Time Capsule, and search your error message on one of these sites.
http://discussions.apple.com/forum.jspa?forumID=1253&start=0
http://forums.macrumors.com/

Time Machine Editor
http://timesoftware.free.fr/timemachineeditor/
Lets you edit the Time Machines backup interval

Time Machine Buddy

http://www.bluedog.com.au/default/Time_Machine_Buddy.html
Dashboard widget that reads your system logs and lets you provides data on what could be causing your TM issues

So learn your device, have patience with it, and most of all put forward effort into working with it.  It works with you so give it the courtesy of debugging, checking logs, and working through its quirks before condemning at it.  Please post you solutions, thoughts or questions in the comments if you have problems comment and I’ll try my best to help.

Btw happy world backup day!

Setting up Apache / MySQL / PHP on Snow Leopard Server

Apache
Turn on the Web service in Server Admin
Server Admin -> Select your server -> Settings -> Services
Select the Web checkbox
Click Save
Web should now appear on your Server Admin side pane
Start Web Service

or via terminal
[code lang=”bash”] sudo serveradmin start web
sudo serveradmin fullstatus web

[/code]

MySQL
Turn on the MySQL service in Server Admin

Server Admin -> Select your server -> Settings -> Services
Select the MySQL checkbox
Click Save
MySQL should now appear on your Server Admin side pane
Start MySQL service

or via terminal
[code lang=”bash”] sudo serveradmin start mysql
sudo serveradmin fullstatus mysql [/code]

PHP
In a terminal window edit /etc/apache2/httpd.conf

[code lang=”bash”] sudo nano /etc/apache2/httpd.conf [/code]

uncomment this line:
LoadModule php5_module           libexec/apache2/libphp5.so

Restart Apache
[code lang=”bash”] sudo apachectl restart [/code]

Create a phpinfo.php file and drop it in an active site directory or /Library/WebServer/Documents

[code lang=”php”][/code]

Browse to http://yourserverip/phpinfo.php or http://localhost/phpinfo.php to verify

Easy enough right? 🙂

Configuring DNS on Mac OS X 10.6 Snow Leopard Server for Web Hosting

Preface
Snow Leopard Server takes control over bind and named and provides you Server Admin to configure DNS. Apple wants you to use Server Admin either via Server Admin Tools, Server Admin within Remote Management, or via serveradmin on terminal or via ssh to your SLS.   You may want to start fresh if you are having trouble with dns service after modifying config files by hand.  Small changes and file modifications can corrupt the entire DNS service.  If you are having trouble with DNS try to telnet to port 53 on your machine and check dig and dns reports on your domain.  If these fail consider starting fresh.

You’ll need
OS X Snow leopard server with remote access
A domain name and access to your domains management console
2 IP addresses, one for each name server you’ll use
To plan a bit– figure out which IPs you want to use for name servers, what you would like to call the name servers

To begin
Rndc is not necessary for named to work on SLS
Any db zone file edits via command line will be reverted/overwritten with Server Admin
DNS zones are stored in /var/named/zones
Basic server network config like IPs and a network resolver need to be functioning. See network connections and /etc/resolv.conf
Many times SLS relies on and uses RDNS. When you are able set RDNS for IPs you use for NS and hostnames

References
Apple.com Mac OS X Server Snow Leopard Resources – Guides
Apple.com Discussions Mac OS X v10.6 Snow Leopard

Tools
dig on your command line
dig from menandmice.com
dig from geektools.com
dns report from dns.hostdime.com
dns report from intodns.com

Downloads
10.6 DNS Defaults Use these for starting over fresh with DNS after experiencing configuration or performance issues.
Package contents:
/dns
loggingOptions.conf.apple
options.conf.apple
publicView.conf.apple
/named
localhost.zone
named.ca
named.local
named.conf

These files are all system defaults and are tested on SLS 10.6.4.

Server Admin Tools Remote administration tools, documentation and utilities that you can install on a OS X machine other than your server.

Setting up DNS
If you have not already, visit Apple.com Mac OS X Server Snow Leopard Resources – Guides and download the Network Services Admin pdf.
Skip to chapter 3  Working with DNS Service and read this chapter in its entirety if you are new to DNS. If you are already familiar and have configured or setup a DNS server before, skim it and continue to follow this article.

1.  Register your domain name, register your name servers, set name servers
This article assumes you already have the domain name ready that you would like to setup and host on your Snow Leopard Server. The registrar I am using is Enom with a direct account.  If you are using Godaddy or another registrar you may have limited access.  If you are having trouble finding the register a name server function within your domain registration account contact their support team and they should be able to add your name servers for you.  Here are the steps in with Enom to give you an idea of the process:

a.   After logging in, go to Domain -> Register a name server

b.  Add your name server (ns1.yourdomain.com) and one of the ip addresses from your server.  For this example I’m using 66.7.195.226 (main server ip where the site will be hosted), 66.7.195.227 for name server 1, and 66.7.195.228 for name server 2.  If you have multiple IPs on your snow leopard server try and use consecutive IPs.

c.  Add your second name server and the IP you wish to use for it

d.  Check both nameservers if you can to verify they were added correctly

e.  Set the name servers that you just created on the domain you will be hosting on your Snow Leopard Server.

Keep in mind name server updates can take from 1-24 hours depending your location and the traffic on root dns servers.

Now that your domain name is properly configured to point to your Snow Leopard Server you’ll need to setup DNS service to host your domain.
2.  Enable DNS Service
a.  Launch Server Admin and connect to your server.
b.  Select your server and click [Settings]
c.  Click [Services] , Select the DNS checkbox.  Click save.

3.  Create a DNS zone and add DNS records
a.  Open Server Admin, connect to your server.  Click the triangle and expand the service drop down.
b.  Select DNS.
c.  Click [Zones]
d.  Click Add Zone -> Add Primary Zone (Master)
e.  Select the new zone, in the Primary Zone Name field enter the zone name, or the domain name you wish to host on your Snow Leopard Server
f.  Enter the email address of the zones administrator
g.  Add name servers for the zone by clicking [+] and entering the 2 name servers you created earlier.
h.  Click save.

4.  Finish configuring the zone.  Add records.
a.  Select the zone you just created
b.  Click Add Record -> Add Alias (CNAME)
c.  Add your domain as the Machine Name with a trailing . and click Fully Qualified
d.  Enter the ip address that you’ll be hosting your site on, typically your servers main ip address.
e.  Click save.

f.  Click Add Record -> Add Machine (A)
g.  Alias Name:  www
h.  Destination:  Your domain name with a trailing . and check Fully Qualified
e.  Click save.

This zone was only created for web hosting not for email or any other services for the domain mikemix.com. Snow Leopard Server will attempt to obtain rdns entries for your domain and will add them above the zone you just created.

5.  Configure logging
If you wish to troubleshoot DNS service visit -> DNS -> Settings -> Log Level
Here you can configure the amount of information displayed in Server Admin.  Select information or debug for the most information.  To trouble shoot via terminal you can :
[code lang=”bash”]
tail -F /Library/Logs/named.log[/code]
6.  Configure firewall
Before proceeding you’ll want to make exceptions in the servers firewall for dns.  Enable all port 53 traffic.
a.  In Server Admin, Select Firewall
b.  Click [Settings]
c.  Click Services
d.  Click next to both DNS entries, Inbound queries and outbound queries.
e.  Click save.

7.  Stop and start DNS service and test your domain

You  should now proceed to setup Web service and setup a Site. This web files should be placed in /Library/WebServer/Documents/domain.com or the location you set in Server Admin. This process is pretty straight forward, I will create a guide for it next.

If you setup DNS and the site correctly you should now be ready to host web sites on your Snow Leopard Server.

Starting fresh
Is DNS service not responding or acting strange?  Did you modify some of the config files above outside of Server Admin? Try starting over if you arent getting results from telnet to your ip port 53 and you arent seeing responses when you dig or do a dns report on your domain.

1. Stop DNS Service in Server Admin
2. Close Server Admin

3. Grab the 10.6 DNS Defaults package mentioned above
4. Place the DNS_defaults.zip on your server, maybe on the desktop. Extract it.
5. Overwrite the following files:

/etc/dns/loggingOptions.conf.apple
/etc/dns/options.conf.apple
/etc/dns/publicView.conf.apple
/var/named/named.ca
/etc/named.conf
/var/named/named.local
/var/named/localhost.zone

(ex: In extracted dns defaults directory: sudo mv named.conf /var/named.conf)
Also rm any of the db files in /var/named and in /var/named/zones or move them elsewhere to reference later if you need to restore these zones.

6. Launch Disk Utility
Spotlight (Command+space) -> Disk Utility
or
Finder -> Applications -> Utilities -> Disk Utility
7. Click on your main disk (Macintosh HD)
8. Click the (Repair Disk Permissions) Button
9. Allow the repair to complete and restart your server

After your server comes back up from reboot check Server Admin and you’ll have a clean slate. Move back up to Setting up DNS, create a primary zone and use some of the tools above to test.

Contact me if you have any questions or need a hand setting up your Snow Leopard Server for web hosting