Hello, I am a Senior Technical Analyst for Apple Systems in an Agency environment and have been working with Macs for roughly 8 years. Most of my days involve desktop and server maintanence, and scripting in UNIX, AppleScript, Xcode, and PHP...etc.

I started this site due to the limited amount of information about Leopard Server. And I have added a few things to help everyone else out. I will be adding new things as they come up. I will also be adding things not related to Leopard. So keep checking the site for new posts. ;)




Leopard Server Methods - OS X Server 10.5.x

changeip | Disk Quotas | MODPU | WebStats
added: February 17th, 2009

changeip - UNIX command for easily updating DNS.


example: changing oldserver:10.1.1.10 to newserver:10.1.1.50
    1. Turn all Server Services OFF!
    2. Now run this in the terminal:
      sudo changeip /LDAPv3/127.0.0.1 10.1.1.10 10.1.1.50 oldserver.domain.com newserver.domain.com
      Note: This will output a lot of information and warnings.
    3. Change the IP and Computer Name in System Preferences
    4. Restart and your done!
February 16th, 2009

Creating Disk Quotas (size or file restrictions) on File Shares for a user or group.

Enabling Quotas on a Volume will affect the entire Volume.
    1. Enable quotes in Server Admin on the Volume that will be storing the Share you want to serve. Select the Volume, choose the Quota tab, and check the Enable Quotes checkbox.
    2. Create the User or Group that you want to set your quota to in Workgroup Manager if they are not already setup.
    3. In the terminal cd into the Volume you want to set your quotas on. Lets pretend the name of the volume is Liquid:
      cd /Volumes/Liquid
    4. Now in the terminal you need to create a the quota file for your user or group like so:
    1. User:
    2. sudo touch .quota.ops.user
    3. Group:
    4. sudo touch .quota.ops.group
    5. Still in the terminal you now need to adjust your quota restrictions with this command:
    1. For User:
    2. sudo edquota -u userName
    3. For Group:
    4. sudo edquota -g groupName
    6. This will then bring you into the vi editor. Here you will need to edit the quota restrictions. Say we want to allocate roughly 1GB, you will need to make the follow adjustments by changing the block's soft and hard settings.
    1. /Volumes/Liquid: 1K blocks in use: 0, limits (soft = 1000000, hard = 1000000) inodes in use: 2602, limits (soft = 0, hard = 0)
    2. For info on using the vi editor go here:
    3. http://staff.washington.edu/rells/R110/
    4. For more info on the quota restriction settings go here or refer to your edquota man pages:
    5. http://publib.boulder.ibm.com/infocenter/systems/index.jsp?topic=/com.ibm.aix.cmds/doc/aixcmds2/edquota.htm
    7. Once you have exited the vi editor, in the terminal run the following to turn the quotas on:
      sudo quotaon -a
    8. Mount your share and test. Once you have reached your quota you will receive a prompt.
February 16th, 2009

MODPU - (Mac Open Directory Password Updater) Web application for Leopard Open Directory Clients to change their password.

    Things you will need to get MODPU setup:
    1. 1. Web/PHP and Open Directory knowledge
    2. 2. Server Admin application
    3. 3. Workgroup Manager application
    4. 4. Leopard Server w/Web Services running and the PHP5 module activated
    Download the files here:
    1. MODPUv1
    MODPU Setup:
    1. This setup assumes you already have a Web Server up and running on your Leopard Open Directory Server. If you don't please refer to here:
    2. http://www.apple.com/support/macosxserver/webservices/
    3. I. Get the files, unzip, and add the modpu directory to here:
      1. Leopard Server HD/Library/WebServer/Documents
    4. II. Workgroup Manager setup:
      1. A. Accounts setup
        1. 1. Create a modpuadmin account.
          1. ~ Privileges Tab:Administration capabilities must be Full to make the user an Open Directory Administrator
          2. ~ Save
        2. 2. Create a testuser account with just the default settings
        3. 3. Write down both users account names and passwords for later reference
        4. 4. Save and Quit Workgroup Manager
      2. B. Permissions Setup on the modpu directory:
        1. 1. Select your Open Directory server in Server Admin and authenticate
        2. 2. Select File Sharing
        3. 3. Select the Browse button
          1. ~ Browse to Leopard Server HD/Library/WebServer/Documents/modpu
        4. 4. Click the "+" button under the POSIX list
        5. 5. Add the World Wide Web user to your ACLs
          1. ~ If you do not see the World Wide Web user you will need to go to the Server Admin Menu:Preferences and check "Show System accounts in users & groups browser"
        6. 6. Save
        7. 7. Select the Gear Drop down menu under the POSIX list and choose Propagate Permissions
        8. 8. Hit OK to propagate the ACL you just added
    5. III. Server Admin setup:
      1. A. Main Site Setup:
        1. 1. Authenticate to your Server that is running Open Directory
        2. 2. Select the Web service
        3. 3. Select the Sites button at the top
        4. 4. Select your site in the list
        5. 5. Now select the Aliases tab
        6. 6. Click the "+" button under URL Aliases and Redirects
          1. ~ Set the Type to: Redirect
          2. ~ Set the Pattern to: /modpu
          3. ~ Set the Path to: https://yoursite/modpu
        7. Note: We will be setting up the secure site next. This Redirect will send anyone who tries to access the modpu web page on the non-secure site to the secure site.
      2. B. Secure Site setup: (optional)
        1. 1. Click the "+" button on the the site list
        2. 2. Check the box next to the site name in the list to turn the site on.
        3. 3. Set the Domain Name to: secure
        4. 4. Select the Security tab and check the Enable Secure Sockets Layer (SSL)
          1. ~ Leave the Certificate set to default
      3. C. Web Realm setup on the Secure Site: (optional)
        1. 1. Select the Realms tab
        2. 2. Click the "+" button under the Realms list
          1. ~ Set the Realm name to: modpu
          2. ~ Browse to or enter the Folder: /Library/WebServer/Documents/modpu
          3. ~ Hit the OK button
        3. 3. Now Click the "+" under the User & Groups list and add the testuser you created.
        4. 4. Save
    6. IV. PHP
      1. A. Config.php Setup
        1. 1. Open the config.php file with your favorite text editor.
        2. 2. Put in all of your info into the proper variables.
        3. 3. Save
    7. IV. TEST!
      1. A. How to test:
        1. 1. Go to http://yoursite/modpu which should redirect you to
        2. 2. Go to https://yoursite/modpu
        3. 3. Login to the realm with a forbidden user to make sure they cannot change their password.
        4. 4. Quit your browser
        5. 5. Login to the realm with the testuser you created.
        6. 6. Enter a new password with at least 7 characters and at least 1 number.
        7. 7. Verify the password.
        8. 8. Hit Submit!
        9. 9. If all goes OK you can now go back into Server Admin and edit your Secure Site realm and add your Open Directory Users group. This will give all Open Directory clients access to the modpu site and they will now have the ability to change their password.
February 16th, 2009

Setting up AWStats using BetterAWStats on Leopard Server, Tiger Server differences are in red.

    Download the latest versions of AWStats and BetterAWStats.
    1. http://awstats.sourceforge.net/#DOWNLOAD
    2. http://betterawstats.com/main/a/download>
    AWStats setup:
    1. 1. Rename the awstats-version# directory to just awstats
    2. 2. Copy the awstats directory to /Library/WebServer/CGI-Executables/
    3. 3. Edit the name of the following file to awstats.yoursite.conf (yoursite would typically be your servername or site name if you have multiple sites)
      1. /Library/WebServer/CGI-Executables/awstats/wwwroot/cgi-bin/awstats.model.conf
    4. 4. Open the awstats.yoursite.config with your favorite text editor, change the following, and save:
      1. LogFile="/Library/WebServer/CGI-Executables/awstats/tools/logresolvemerge.pl /private/var/log/apache2/access_log* |"
      2. LogFile="/Library/WebServer/CGI-Executables/awstats/tools/logresolvemerge.pl /private/var/log/httpd/access_log* |"
      3. SiteDomain="yoursite"
      4. Note: logresolvemerge.pl will merge all archived apache_logs in the specified directory
    5. 5. Now edit the following file and save:
      1. /Library/WebServer/CGI-Executables/awstats/tools/awstats_updateall.pl
      2. DIRCONFIG = "/Library/WebServer/CGI-Executables/awstats/wwwroot/cgi-bin
    BetterAWStats setup:
    1. 1. Copy the betterawstats directory to:
      1. /Library/WebServer/Documents/
    2. 2. Create the following directory:
      1. /Library/WebServer/Documents/betterawstats/icons/awstats
    3. 3. Copy the the awstats' icon directory from here:
      1. /Library/WebServer/CGI-Executables/awstats/wwwroot/icon
      2. TO:
      3. /Library/WebServer/Documents/betterawstats/icons/awstats
      4. Note: The betterawstats will have to reference this icon path via a url
    4. 4. Edit the following file with the parameters below with your favorite text editor and save:
      1. /Library/WebServer/Documents/betterawstats/config.php
      2. $BAW_CONF['site_url'] = 'http://awstats.local';
      3. example: http://yoursite/betterawstats
      4. $BAW_CONF['site_path'] = '/path/to/betterawstats';
      5. example: /Library/WebServer/Documents/betterawstats
      6. $BAW_CONF['path_data'] = '/path/to/betterawstats/awstats/data';
      7. example: /Library/WebServer/CGI-Executables/awstats/wwwroot/cgi-bin
      8. $BAW_CONF['path_lib'] = '/path/to/betterawstats/awstats/lib';
      9. example: /Library/WebServer/CGI-Executables/awstats/wwwroot/cgi-bin/lib
      10. $BAW_CONF['path_lang'] = '/path/to/betterawstats/awstats/lang';
      11. example: /Library/WebServer/CGI-Executables/awstats/wwwroot/cgi-bin/lang
      12. $BAW_CONF['icons_url'] = 'http://awstats.local/awstats/icon';
      13. example: http://yoursite/betterawstats/icons/awstats
    Server Admin setup:
    1. 1. Stop the Web service.
    2. 2. In the finder label all apache_logs located here as old or just delete them if they are not needed for future reference:
      1. /private/var/log/apache2/
      2. /private/var/log/httpd/
    3. 3. Back in Server Admin:Web Services select the site you are working with.
    4. 4. Set Apache_logs to enabled, turn archiving on with however many days you want; default is 7.
      1. Leave the log location as is: (/var/log/apache2/access_log)
      2. (/var/log/httpd/access_log)
    5. 5. Set the log format to the following:
      1. %h %l %u %t "%r" %>s %b "%{Referer}i""%{User-Agent}i"
      2. for Tiger do not set the log format just choose Combined from the drop down menu and then save
    6. 6. Enable Web services.
    7. 7. Load webpage http://localhost to create a new apache_log
    Creating your webstats data:
    1. To manually execute or update awstats, run the following terminal command:
      1. sudo /Library/WebServer/Documents/awstats/wwwroot/cgi-bin/awstats.pl -config=yoursite -update
    2. Or to have the awstats run periodically setup a launchd job in Lingon with the following command as a User Agent:
      1. /Library/WebServer/Documents/awstats/wwwroot/cgi-bin/awstats.pl
      2. with arguments
      3. -config=yoursite
      4. -update
    3. Note: Running the above command will process the awstats.yoursite.config file and create an AWStats text file in the same directory. This is essentially a database file that BetterAWStats will read to create the webstats web page for your viewing pleasure.
    Viewing your AWStats data via BetterAWStats:
    1. Go to this webpage: http://yoursite/betterawstats
    Creating IP host filters:
    1. If you want to setup filters for specific hosts, you can edit your config files as follows. I will give an example of a filter for My Company.
      1. 1. Copy your config file located in awstats/cgi-bin and call it awstats.my_co.yoursite.conf
      2. 2. Now open the config file you just created in your favorite editor so we can setup a filter for only IPs connecting from My Company.
      3. 3. Since all IPs within My Company begin with 10.1. We can use this to filter out everyone connecting with these IPs.
        1. Do a find for "OnlyHosts" and set this exactly to the following:
        2. OnlyHosts="REGEX[^10\.1\.]"
        3. or for multiple filters, separate the REGEX with a space:
        4. OnlyHosts="REGEX[^10\.1\.] REGEX[^10\.2\.]"
      4. Note: To setup a filter to not include certain hosts, say you didn't want anyone from the 10.1.50.x IPs then you would find "SkipHosts" and add the following:
      5. SkipHosts="REGEX[^10\.1\.50\.]"
      6. 4. Save and close the config.
      7. 5. You will now need a client from the filtered IPs to hit a page and then update your awstats with your launchD job or automatically run the command in the terminal. Once you go to view your webstats again, a my_co menu item will now be selectable.
Other Stuff

www.irevew.com - Site I made to review anything with your phone.