OS X Server
Cyrus weirdness
12.02.07 23:36 |
Permalink
Feb 12 23:35:35 server launchd: edu.cmu.andrew.cyrus.master: exited with exit code: 75
Feb 12 23:35:35 server launchd: edu.cmu.andrew.cyrus.master: respawning too quickly! throttling
Feb 12 23:35:35 server launchd: edu.cmu.andrew.cyrus.master: 1 more failure without living at least 60 seconds will cause job removal
Feb 12 23:35:35 server launchd: edu.cmu.andrew.cyrus.master: will restart in 10 seconds
Feb 12 23:35:45 server master[14119]: empty option value on line 14 of configuration file
Feb 12 23:35:45 server master[14119]: exiting
That's just launchd's special way of saying that that cyrus is not starting up. The question is - what conf file is it talking about?
Let's check:
> man cyrus-master
OK, so there's two of them - /etc/cyrus.conf and /etc/imapd.conf. The first one had a comment on line 14, but the second one:
tls_common_name:
Setting a CN fixed the problem and cyrus was purring like a kitten again:
Feb 12 23:40:42 server master[14244]: process started
Feb 12 23:40:43 server ctl_cyrusdb[14245]: verifying cyrus databases
Feb 12 23:40:43 server ctl_cyrusdb[14245]: skiplist: recovered /var/imap/mailboxes.db (30 records, 5008 bytes) in 0 seconds
Feb 12 23:40:43 server ctl_cyrusdb[14245]: skiplist: recovered /var/imap/annotations.db (0 records, 144 bytes) in 0 seconds
Feb 12 23:40:43 server ctl_cyrusdb[14245]: done verifying cyrus databases
Feb 12 23:40:44 server master[14244]: ready for work
|
RewritesRule
09.02.07 12:53 |
Permalink
For my thesis, I'm building a simple (there's that
word again!) publishing backend that basically just
accepts any kind of media, gives you an interface to
catalogue it, creates Torrent metafiles, etc and then
spits out XHTML and RSS. For this to look nice, I
decided to use Apache's mod_rewrite to use simple
canonical URI's (like show/get/11, genre/Horror etc),
so my rule looked something like this (L flag means
it's the last rule and NC that the regex is
case-insensitive)
But then you hit the age-old problem. You have some files (like images, css, javascript etc) that you want the browser to access directly, without the redirect. I must have tried a bazillion different permutations of Rewrite conditions, but then ended up with these two:
Which, put before your RewriteRule, simply say:
Perfect. Mind you, there's also a "-U" switch which the Apache docs say should do the same thing, but I simply couldn't get it to work.
A really good way to learn these is to, in your httpd.conf set:
And just follow the output of that while your working on these.
Here's also some good practical RewriteRule documentation.Oh, and there's also a handy RewriteRule cheatsheet over at ILJD.
RewriteRule ^([a-z]+)/(.*)? shows.php?p=$1&id=$2 [L,NC]
But then you hit the age-old problem. You have some files (like images, css, javascript etc) that you want the browser to access directly, without the redirect. I must have tried a bazillion different permutations of Rewrite conditions, but then ended up with these two:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
Which, put before your RewriteRule, simply say:
Only apply the rule if the accessed file or directory doesn't exist on the server
Perfect. Mind you, there's also a "-U" switch which the Apache docs say should do the same thing, but I simply couldn't get it to work.
A really good way to learn these is to, in your httpd.conf set:
RewriteLog /private/var/log/httpd/rewrite_log
RewriteLogLevel 9
And just follow the output of that while your working on these.
Here's also some good practical RewriteRule documentation.Oh, and there's also a handy RewriteRule cheatsheet over at ILJD.
servermgrd bus error
28.01.07 23:44 |
Permalink
This happened after a failed attempt to add a signed
cert from a CA - servermgrd just crashed.
Trying to disable all SSL
(/Library/Preferences/com.apple.servermgrd.plist) had
no effect. Starting in debug mode just said this:
Well, it turns out that the stuff about memory leaking is "normal". Here's the output of the same command on a totally unrelated, perfectly in-order Tiger server:
It's the Bus error that I'm worried about. Most of ktrace servermgrd -d and kdump -f ktrace.out is incomprehensible and so is pretty much /Library/Logs/CrashReporter/servermgrd.crash.log
Checking the last lines of kdump (kdump -f ktrace.out | tail -n 20) did mention /Library/Keychains/System.keychain, just shortly before the crash. A find -ctime 2 confirms that System.keychain was modified just around that fateful moment when this problem started. For the heck of it, I decided to move the old keychain aside, and create a new one:
Sure enough, servermgrd was open for business again:
I was actually able to salvage the certs and private keys from the damaged keychain file like thus:
and then import them back into the fresh keychain:
The bad news is that although Server Admin works again, I'm unable to use the Certificate Manager. Any attempt to either add or import a cert gets replied by a dull "The selected certificate could not be retrieved. Going back to the list." Oh well, just another good reason to get more comfortable with the CLI - it's not as fragile... By the way, If you change SSL certs in httpd conf files, it seems it's better to stop and start the server, not restart (otherwise the old cert is still used).
Just for the record, the cert and key in /etc/servermgrd are disposable. If you delete them, they will be re-created by servermgrd on the next launch. Oh, and there's also certadmin, but it did absolutely nothing for me.
# servermgrd -d
2007-01-28 23:39:04.717 servermgrd[20540] *** _NSAutoreleaseNoPool(): Object 0x306030 of class NSCFData autoreleased with no pool in place - just leaking
2007-01-28 23:39:04.717 servermgrd[20540] *** _NSAutoreleaseNoPool(): Object 0x306420 of class NSCFData autoreleased with no pool in place - just leaking
2007-01-28 23:39:04.733 servermgrd[20540] Entering initialize
2007-01-28 23:39:05.600 servermgrd[20540] Starting idle processing
Bus error
Well, it turns out that the stuff about memory leaking is "normal". Here's the output of the same command on a totally unrelated, perfectly in-order Tiger server:
# servermgrd -d
2007-01-28 23:52:46.348 servermgrd[21665] *** _NSAutoreleaseNoPool(): Object 0x306020 of class NSCFData autoreleased with no pool in place - just leaking
2007-01-28 23:52:46.348 servermgrd[21665] *** _NSAutoreleaseNoPool(): Object 0x306410 of class NSCFData autoreleased with no pool in place - just leaking
2007-01-28 23:52:46.349 servermgrd[21665] Entering initialize
It's the Bus error that I'm worried about. Most of ktrace servermgrd -d and kdump -f ktrace.out is incomprehensible and so is pretty much /Library/Logs/CrashReporter/servermgrd.crash.log
Checking the last lines of kdump (kdump -f ktrace.out | tail -n 20) did mention /Library/Keychains/System.keychain, just shortly before the crash. A find -ctime 2 confirms that System.keychain was modified just around that fateful moment when this problem started. For the heck of it, I decided to move the old keychain aside, and create a new one:
# mv System.keychain System.keychain.old
# security create-keychain /Library/Keychains/System.keychain
Sure enough, servermgrd was open for business again:
server:/Library/Keychains root# servermgrd -d
2007-01-29 00:20:48.654 servermgrd[20712] *** _NSAutoreleaseNoPool(): Object 0x306030 of class NSCFData autoreleased with no pool in place - just leaking
2007-01-29 00:20:48.655 servermgrd[20712] *** _NSAutoreleaseNoPool(): Object 0x306420 of class NSCFData autoreleased with no pool in place - just leaking
2007-01-29 00:20:48.655 servermgrd[20712] Entering initialize
2007-01-29 00:20:48.946 servermgrd[20712] Starting idle processing
2007-01-29 00:20:51.534 servermgrd[20712] Done with idle processing
I was actually able to salvage the certs and private keys from the damaged keychain file like thus:
# security export -k /Library/Keychains/System.keychain.old -t all -o ./all.pem
and then import them back into the fresh keychain:
# security import ./all.pem -P -k /Library/Keychains/System.keychain
2 keys imported.
3 certificates imported.
The bad news is that although Server Admin works again, I'm unable to use the Certificate Manager. Any attempt to either add or import a cert gets replied by a dull "The selected certificate could not be retrieved. Going back to the list." Oh well, just another good reason to get more comfortable with the CLI - it's not as fragile... By the way, If you change SSL certs in httpd conf files, it seems it's better to stop and start the server, not restart (otherwise the old cert is still used).
Just for the record, the cert and key in /etc/servermgrd are disposable. If you delete them, they will be re-created by servermgrd on the next launch. Oh, and there's also certadmin, but it did absolutely nothing for me.
Postmaster
23.01.07 11:40 |
Permalink
Giving your (admin) account the "postmaster" alias
doesn't actually do anything because
/etc/postfix/aliases hardwires postmaster to root and
that sends mail to /dev/null. I fixed this by setting
the "root" config var in aliases.
In other news, watch out for failed user-specific crontab entries. Sometimes (more than once) running
will simply hang, creating a tmp.something into /var/cron/tabs. This drives cron mad, eating up all the cycles it can. To fix is to basically pull a:
In other news, watch out for failed user-specific crontab entries. Sometimes (more than once) running
> crontab -u user -e
will simply hang, creating a tmp.something into /var/cron/tabs. This drives cron mad, eating up all the cycles it can. To fix is to basically pull a:
$ rm -rf /var/cron/tabs/tmp.*
$ killall cron -SIGHUP
Amavis gone haywire
22.01.07 21:08 |
Permalink
The problem:
The solution (found from the postsuper manpage):
The cause:
I wish I knew...
Jan 22 17:57:59 server postfix/qmgr[29037]: warning: mail for [127.0.0.1]:10024 is using up 20000 of 20000 active queue entries
Jan 22 17:57:59 server postfix/qmgr[29037]: warning: you may need to reduce smtp-amavis connect and helo timeouts
Jan 22 17:57:59 server postfix/qmgr[29037]: warning: so that Postfix quickly skips unavailable hosts
Jan 22 17:57:59 server postfix/qmgr[29037]: warning: you may need to increase the main.cf minimal_backoff_time and maximal_backoff_time
Jan 22 17:57:59 server postfix/qmgr[29037]: warning: so that Postfix wastes less time on undeliverable mail
Jan 22 17:57:59 server postfix/qmgr[29037]: warning: you may need to increase the master.cf smtp-amavis process limit
Jan 22 17:57:59 server postfix/qmgr[29037]: warning: please avoid flushing the whole queue when you have
Jan 22 17:57:59 server postfix/qmgr[29037]: warning: lots of deferred mail, that is bad for performance
Jan 22 17:57:59 server postfix/qmgr[29037]: warning: to turn off these warnings specify: qmgr_clog_warn_time = 0
The solution (found from the postsuper manpage):
> mailq | tail +2 | awk 'BEGIN { RS = "" } / spam@host$/ { print $1 }' | tr -d '*!' | postsuper -d -
/ snip /
postsuper: Deleted: 39819 messages
The cause:
I wish I knew...
Creating Empty Files of Any Size
14.01.07 19:55 |
Permalink
About FTP
16.12.06 01:56 |
Permalink
1) To allow only FTP access to a share (AFP/FTP/SMB):
2) All the configuration files are in /Library/FTPServer/Configuration
3) "man ftpaccess" had some useful info on the different chrootType values:
and they all work with serveradmin:
$ sharing -e sharename -s 010
2) All the configuration files are in /Library/FTPServer/Configuration
3) "man ftpaccess" had some useful info on the different chrootType values:
chroot_type standard | homedir | restricted
Sets the type of restricted environment the user is under when he
logs on. standard Allows users to access the ftp root, their
homedir, and sharepoints. homedir Allows users to access the
their homedir and sharepoints. restricted restricts users to
their own home directory.
and they all work with serveradmin:
$ serveradmin settings ftp:chrootType = "HOMEDIR"
DBERROR: critical database situation
11.12.06 23:39 |
Permalink
OK, so this one started with a rather ominous message
in /var/log/mailaccess.log:
Stopped the server, tried a db rebuild. Nothing. Noticed a "no space on device" error, indeed df confirmed it. On to finding what's taking up the room:
Could it really be the logs? Yups:
Yikes! Deleted log.smbd.old and thanks to some avid GNU/Linux users, was able to get things working again:
Dec 11 15:33:47 gw mbpath[4439]: DBERROR: critical database situation
Stopped the server, tried a db rebuild. Nothing. Noticed a "no space on device" error, indeed df confirmed it. On to finding what's taking up the room:
gw:/Library/Logs root# du -hc -d 1 /
0B /.Trashes
1.5K /.vol
318M /Applications
1.5K /automount
3.5M /bin
0B /cores
2.0K /dev
0B /Groups
1.8G /Library
2.0K /Network
21M /opt
45G /private
2.2M /sbin
112K /Shared Items
1.1G /System
9.0M /Users
1.6G /usr
5.7G /Volumes
56G /
56G total
Could it really be the logs? Yups:
gw:/Library/Logs root# du -hc /private/var/log/samba/log.*
68K /private/var/log/samba/log.nmbd
624K /private/var/log/samba/log.smbd
44G /private/var/log/samba/log.smbd.old
44G total
Yikes! Deleted log.smbd.old and thanks to some avid GNU/Linux users, was able to get things working again:
gw:~ root# nano /etc/smb.conf
[global]
bind interfaces only = true
interfaces = en1 192.168.0.1
hosts deny = all
hosts allow = 192.168.0.1/24
Is softwareupdate Broken in 10.4.0?
28.11.06 15:23 |
Permalink
I've seen this more than once - the Update tab in SA
doesn't do anything and neither does "softwareupdate
-l" - they just wait forever. Here's a workaround
(PPC!):
After that, softwareupdate and SA > Update seem to work again. :)
$ curl -O http://tinyurl.com/ynh85z
$ hdiutil attach ./*.dmg
$ cd /Volumes/Mac\ OS\ X\ Server\ 10.4.8\ Combined\ Update/
$ sudo installer -verbose -pkg ./MacOSXSrvrCombo10.4.8PPC.mpkg/ -target /
After that, softwareupdate and SA > Update seem to work again. :)
The Headless Install
26.11.06 23:09 |
Permalink
It's really quite simple when you know it. This is
all also somewhere in the documentation, but here are
the exact steps for easy reference:
1) Boot off the install media
2) On another machine that has the tools installed, pull a
That should get you something like this:
3) Cool.
4) Set up the disks (if you have hardware RAID, remember to use megaraid!):
I want my install on disk0, also check that the disk is working OK:
4) Install (this installs everything)
5) Reboot. Run Server Assistant.
1) Boot off the install media
2) On another machine that has the tools installed, pull a
/System/Library/ServerSetup/sa_srchr 224.0.0.1
That should get you something like this:
localhost#1.25 GHz PowerPC G4#192.168.0.114#00:11:24:3e:62:aa#Mac OS X Server 10.4#RDY4PkgInstall#3.0#512
3) Cool.
ssh root@192.168.0.114
Password: the first 8 characters of your server hardware's serial number
4) Set up the disks (if you have hardware RAID, remember to use megaraid!):
-sh-2.05b# diskutil list
/dev/disk0
#: type name size identifier
0: Apple_partition_scheme *37.3 GB disk0
1: Apple_partition_map 31.5 KB disk0s1
2: Apple_HFS Mac OS X Server 37.1 GB disk0s3
/dev/disk1
#: type name size identifier
0: CD_partition_scheme *746.0 MB disk1
1: Apple_partition_scheme 649.6 MB disk1s1
2: Apple_partition_map 31.5 KB disk1s1s1
3: Apple_Driver_ATAPI 4.0 KB disk1s1s2
4: Apple_HFS Mac OS X Server Install Disc 1 649.2 MB disk1s1s3
/dev/disk2
#: type name size identifier
0: untitled *467.0 KB disk2
/dev/disk3
#: type name size identifier
0: untitled *95.0 KB disk3
/dev/disk4
#: type name size identifier
0: untitled *95.0 KB disk4
/dev/disk5
#: type name size identifier
0: untitled *95.0 KB disk5
/dev/disk6
#: type name size identifier
0: untitled *219.0 KB disk6
I want my install on disk0, also check that the disk is working OK:
-sh-2.05b# diskutil randomDisk 1 /dev/disk0
-sh-2.05b# diskutil eraseDisk "Journaled HFS+" Server disk0
Started erase on disk disk0
Creating Partition Map
5% ..
Formatting Disk 100% ..
Finished erase on disk disk0
Finished partitioning on disk disk0
4) Install (this installs everything)
installer -lang en -verbose -pkg /System/Installation/Packages/OSInstall.mpkg -target /Volumes/Server
5) Reboot. Run Server Assistant.
Setting up HansaWorld Enterprise
26.11.06 23:09 |
Permalink
Actually managed to find some documentation on this
(why their server won't list it's program arguments,
I will never understand). It's here.
When you're wrapping to launchd, keep in mind that every parameter has to go in a separate <string> tag. Ie not <string>--port something</string>, but <string>--port</string> <string>something</string>
Otherwise the server will start up, but won't be accepting connections on that port.
When you're wrapping to launchd, keep in mind that every parameter has to go in a separate <string> tag. Ie not <string>--port something</string>, but <string>--port</string> <string>something</string>
Otherwise the server will start up, but won't be accepting connections on that port.
Useful info on AFP
23.11.06 00:23 |
Permalink
Mac OS X Server: About Privilege
Mapping and When It Is Used
defaults read -g com.apple.AppleShareClientCore
defaults read /Library/Preferences/com.apple.AppleFileServer
defaults read -g com.apple.AppleShareClientCore
defaults read /Library/Preferences/com.apple.AppleFileServer
Securing WebMail (if only just a little bit)
19.11.06 18:15 |
Permalink
By default, the squirrelmail conf only allows
plaintext, but you don't have to enable that just
because of your webmail users. To fix it, just do:
And set Server Settings > Update IMAP Settings > Authentication type > cram-md5. There are a bunch of other useful settings there that should be checked as well. This must be mentioned in the docs as well.
sudo /etc/squirrelmail/config/config.pl
And set Server Settings > Update IMAP Settings > Authentication type > cram-md5. There are a bunch of other useful settings there that should be checked as well. This must be mentioned in the docs as well.
Using MSN with iChat server
14.11.06 02:08 |
Permalink
Finally finished that piece on getting the iChat
server to work with MSN. It's available for download
here. (450kB PDF)
Setting Up a Safety Harness
12.11.06 01:12 |
Permalink
Changing IP-s is sometimes a risky business.
Especially if your server's behind a firewall, in
another country, across a great body of water. So
here's a little backup strategy to use in case
something does go bad:
That way, if all goes to hell, it should go back to the previous state after an hour. If all goes well, don't forget to
sudo at now + 1 hour
networksetup -setmanual "Built-in Ethernet" youroldip youroldnetmask youroldrouter
Ctrl -D
That way, if all goes to hell, it should go back to the previous state after an hour. If all goes well, don't forget to
at -l
at -r jobnumber
Charting spam
09.11.06 10:48 |
Permalink
This actually did make it to afp548.com, but I'm
putting it up here also in the hopes that it might
come in useful for someone else too:
One way to train the spam filter that comes with OS X Server (10.4) is by setting up two accounts - "junkmail" and "notjunkmail" and redirecting all spam and false positives to them accordingly. This is all documented on page 52 of the Mail Service manual. Since users' Mail clients are usually quite well trained, I also instruct them to create a rule to do just that for all the email their client considers spam, but hasn't been tagged as such by the server.
The manual also mentions that the redirected emails are analysed every night at 1 AM after which they should be discarded. To automate that, all we have to do is add the correct ipurge command to the crontab (I use /etc/crontab here but normally you would just edit cyrusimap's crontab).
I think these simple steps can go a long way in battling spam in a small business environment. One thing that's missing though, is any kind of overview of how much junk-mail we're actually processing. Preferably with some-sort of graphical representation. The MAILTO variable at the beginning of the crontab means that all the output of the ipurge command will be sent to the given address, usually the "postmaster" alias. This means we have all the necessary data and can generate the statistics on a remote machine.
I've chosen (what I think is) the most straight-forward approach by using AWK to generate a (partial) HTML file that displays the date of the processing, number of messages numerically and graphically and finally the total amount of messages. Although crude, this technique is very easy to use and doesn't depend on any extra software, except for Mail.app, which is assumed to be the mail client.
To run the script, I have to provide it with the directory with the email files and a name for the generated HTML file:
The script itself is very simple, with most of the typing spent on CSS for the "bars". Please notice that the total message (per day) count is assumed to be on line 32 in the email. This should be fine for default setups, but must be changed accordingly in case your server adds additional headers (or doesn't add the spam headers etc).
Here's a sample of the output. Having a graphical view of our spam, I can immediately see that the numbers have been climbing steadily since August of this year. I guess I better get back to work then…
One way to train the spam filter that comes with OS X Server (10.4) is by setting up two accounts - "junkmail" and "notjunkmail" and redirecting all spam and false positives to them accordingly. This is all documented on page 52 of the Mail Service manual. Since users' Mail clients are usually quite well trained, I also instruct them to create a rule to do just that for all the email their client considers spam, but hasn't been tagged as such by the server.
The manual also mentions that the redirected emails are analysed every night at 1 AM after which they should be discarded. To automate that, all we have to do is add the correct ipurge command to the crontab (I use /etc/crontab here but normally you would just edit cyrusimap's crontab).
MAILTO="postmaster@myserver.com"
PATH=$PATH:/usr/bin/cyrus/bin
# min hour mday month wday who command
30 01 * * * cyrusimap ipurge -f -d 1 user/junkmail user/notjunkmail
I think these simple steps can go a long way in battling spam in a small business environment. One thing that's missing though, is any kind of overview of how much junk-mail we're actually processing. Preferably with some-sort of graphical representation. The MAILTO variable at the beginning of the crontab means that all the output of the ipurge command will be sent to the given address, usually the "postmaster" alias. This means we have all the necessary data and can generate the statistics on a remote machine.
I've chosen (what I think is) the most straight-forward approach by using AWK to generate a (partial) HTML file that displays the date of the processing, number of messages numerically and graphically and finally the total amount of messages. Although crude, this technique is very easy to use and doesn't depend on any extra software, except for Mail.app, which is assumed to be the mail client.
To run the script, I have to provide it with the directory with the email files and a name for the generated HTML file:
awk -f spamchart.awk of=test.html ~/Library/Mail/Mailboxes/Cron\ Jobs/mac.ee.mbox/Messages/*.emlx
The script itself is very simple, with most of the typing spent on CSS for the "bars". Please notice that the total message (per day) count is assumed to be on line 32 in the email. This should be fine for default setups, but must be changed accordingly in case your server adds additional headers (or doesn't add the spam headers etc).
#! /usr/bin/awk
#Usage: awk -f spamchart.awk of=outfile.html maildir
/^Date: / {
theDate = sprintf ("%s %d %d", $4, $3, $5);
}
/^total\ messages / {
if (FNR == 32) {
total += $3;
printf ("<div style=\"background: silver; height: 15px; width: %dpx; font-size: x-small;\">%s %d</div>", $3, theDate, $3) > of;
}
}
END { printf ("<br />Total messages: %s", total) >> of; }
Here's a sample of the output. Having a graphical view of our spam, I can immediately see that the numbers have been climbing steadily since August of this year. I guess I better get back to work then…
FTP Shares & Home folders
31.10.06 21:01 |
Permalink
The home has to be inside an FTP share. Otherwise
you'll get the FTP root contents instead. So to give
local users access to their home folders over FTP,
/Users would have to be set as an FTP share. The
other, not so flexible solution, is to keep all homes
within your FTP root.
Not keeping this in mind will throw your FTP users into the FTP root directory. The FTP transcript will say:
230-No directory! Logging in with home=/
Not keeping this in mind will throw your FTP users into the FTP root directory. The FTP transcript will say:
230-No directory! Logging in with home=/
Are a users emails deleted with the user?
12.10.06 16:02 |
Permalink
If it smashes down
04.10.06 21:18 |
Permalink
Turn Web Performance Cache Off!
27.09.06 20:24 |
Permalink
Make sure to quit your editor!
18.09.06 09:04 |
Permalink
Apache VirtualHosts
17.09.06 15:27 |
Permalink
Was finally able to have the same site respond to
different aadresses differently:
http://httpd.apache.org/docs/2.0/vhosts/examples.html
Just check /etc/httpd/sites/virtual_host_global.conf and make sure it looks like what's described in the article. Rearranging them in the Sites list also seems to help.
http://httpd.apache.org/docs/2.0/vhosts/examples.html
Just check /etc/httpd/sites/virtual_host_global.conf and make sure it looks like what's described in the article. Rearranging them in the Sites list also seems to help.
Tiger Server Administration eBook
08.09.06 08:08 |
Permalink
Replacing Apple's PHP
29.08.06 17:08 |
Permalink
Needed to get gd2 support so thought why not as well
update to latest 4.x PHP:
For JPG support, you'll ned libjpeg which won't compile directly. From the instructions here I found that you should simply:
then just "configure --enable-shared" etc
LIBPNG
Don't bother with the no-config option, it can't find ZLIB.
And you should have PHP 4.4.4 with gdlib and OS X Server didn't notice a thing :P
Some stuff also from Apple, although IMHO Fink is overkill in this case:
For JPG support, you'll ned libjpeg which won't compile directly. From the instructions here I found that you should simply:
> export MACOSX_DEPLOYMENT_TARGET=10.4
> ln -s `which glibtool` ./libtool
> cp /usr/share/libtool/config.sub .
> cp /usr/share/libtool/config.guess .
then just "configure --enable-shared" etc
LIBPNG
>curl -O http://surfnet.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.12.tar.gz
Don't bother with the no-config option, it can't find ZLIB.
>./configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --disable-dependency-tracking --with-apxs --with-ldap=/usr --with-kerberos=/usr --enable-cli --with-zlib-dir=/usr --enable-trans-sid --with-xml --enable-exif --enable-ftp --enable-mbstring --enable-mbregex --enable-dbx --enable-sockets --with-iodbc=/usr --with-curl=/usr --with-config-file-path=/etc --sysconfdir=/private/etc --with-mysql=/usr --with-mysql-sock=/var/mysql/mysql.sock --with-gd --with-jpeg-dir=/usr/local --with-png-dir=/usr/local --with-openssl=/usr
> make && sudo make install
And you should have PHP 4.4.4 with gdlib and OS X Server didn't notice a thing :P
Some stuff also from Apple, although IMHO Fink is overkill in this case:
When Cron Gets Out of Hands
22.08.06 22:13 |
Permalink
I noticed cron had been churning away at 82% CPU for
the past 140 hours (!). sc_usage and fs_usage came up
empty (with the latter crashing) - so did ktrace.
Remembering that "crontab -e -u someuser" hung on
"Installing new crontab", I checked the tabs dir for
any temp files. There were many of them. Ultimately,
this seemed to help:
$ rm -rf /var/cron/tabs/tmp.*
$ launchctl stop com.vix.cron
Back to using just /etc/crontab! :-/
$ rm -rf /var/cron/tabs/tmp.*
$ launchctl stop com.vix.cron
Back to using just /etc/crontab! :-/
Auto Junkmail Deletion
14.08.06 17:38 |
Permalink
If You're using the "junkmail@yourdomain" technique
to teach your server junk, You can make the server
auto-delete learned stuff like this:
and if "crontab -e" gives you grief (like hanging and not writing the file), then just edit /etc/crontab
$ sudo bash
$ export EDITOR=nano; crontab -e -u cyrusimap
30 13 * * * /usr/bin/cyrus/bin/ipurge -d 1 -f user/junkmail
and if "crontab -e" gives you grief (like hanging and not writing the file), then just edit /etc/crontab
WebDAV chroot
29.07.06 13:57 |
Permalink
Well, there's really no such thing. But you can make
it work.
In SA, create a realm where you want your WebDAV home folders to be.
Give Auth/Browse access only to an admin. Then just create something like /etc/httpd/sites/WebDavUsers.conf
and add the following:
It seems that Digest authentication under OS X comes automagically from NetInfo which means we don't have to edit any passwordfiles.
Now only the admin can see all the home folders, but each user can connect to http://server/username and see only their home.
In SA, create a realm where you want your WebDAV home folders to be.
Give Auth/Browse access only to an admin. Then just create something like /etc/httpd/sites/WebDavUsers.conf
and add the following:
<Directory "/WebDAV/folder/username">
<LimitExcept GET HEAD OPTIONS>
require user username
</LimitExcept>
</Directory>
It seems that Digest authentication under OS X comes automagically from NetInfo which means we don't have to edit any passwordfiles.
Now only the admin can see all the home folders, but each user can connect to http://server/username and see only their home.
FTP Without Shell
26.07.06 01:17 |
Permalink
Tools Of the Trade
20.07.06 23:50 |
Permalink
Back To the Basics
05.07.06 07:46 |
Permalink
The Intel Pro/1000 GT NIC won't work with OS X
05.07.06 07:45 |
Permalink
Troube With Quotas
02.07.06 07:47 |
Permalink
Attack of the DNS vol 2
08.06.06 15:10 |
Permalink
Since 10.4.6 all services (it seems) require a FQDN
to function. With a NAT-d IP this is ofcourse
impossible.
So to get servermgrd to cool down behind a NAT:
* Configure DNS service (just add your local IP, no MX etc)
* Enable DNS server
* Add server IP to DNS servers
* Add NAT router's IP to DNS servers
Then check
http://docs.info.apple.com/article.html?artnum=303697
http://lists.apple.com/archives/macos-x-server/2006/May/msg01265.html
So to get servermgrd to cool down behind a NAT:
* Configure DNS service (just add your local IP, no MX etc)
* Enable DNS server
* Add server IP to DNS servers
* Add NAT router's IP to DNS servers
Then check
host localiphost name.of.serversudo changeip
-checkhostname
http://docs.info.apple.com/article.html?artnum=303697
http://lists.apple.com/archives/macos-x-server/2006/May/msg01265.html
ApacheBench
03.06.06 07:49 |
Permalink
Interesting differences running ab -n 1000 -c 10
http://localhost/
1.5Ghz PowerBook G4 running Apache 1.3.3 OS X 10.4.6
Server Software: Apache/1.3.33
Server Hostname: localhost
Server Port: 80
Document Path: /
Document Length: 1456 bytes
Concurrency Level: 10
Time taken for tests: 2.432 seconds
Complete requests: 1000
Failed requests: 0
Broken pipe errors: 0
Total transferred: 1867000 bytes
HTML transferred: 1456000 bytes
Requests per second: 411.18 [#/sec] (mean)
Time per request: 24.32 [ms] (mean)
Time per request: 2.43 [ms] (mean, across all concurrent requests)
Transfer rate: 767.68 [Kbytes/sec] received
Connnection Times (ms)
min mean[+/-sd] median max
Connect: 0 1 1.4 0 13
Processing: 8 22 28.9 13 292
Waiting: 2 22 28.9 12 291
Total: 8 23 28.8 13 292
Percentage of the requests served within a certain time (ms)
50% 13
66% 15
75% 18
80% 23
90% 41
95% 75
98% 134
99% 153
100% 292 (last request)
And Mac mini 1.25 Apache 2.2 OS X 10.4.6 Server:
Server Software: Apache/2.2.0
Server Hostname: localhost
Server Port: 80
Document Path: /
Document Length: 5634 bytes
Concurrency Level: 10
Time taken for tests: 2.655151 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 5
Total transferred: 5939098 bytes
HTML transferred: 5622732 bytes
Requests per second: 376.63 [#/sec] (mean)
Time per request: 26.552 [ms] (mean)
Time per request: 2.655 [ms] (mean, across all concurrent requests)
Transfer rate: 2184.06 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 3.2 0 97
Processing: 4 25 27.1 15 140
Waiting: 0 0 0.0 0 0
Total: 4 25 27.3 15 140
Percentage of the requests served within a certain time (ms)
50% 15
66% 15
75% 20
80% 26
90% 56
95% 110
98% 118
99% 130
100% 140 (longest request)
Now where did I put that server?
03.06.06 07:49 |
Permalink
When (mail) disaster strikes!
03.06.06 07:48 |
Permalink
Is it just me or is it really WebDAV?
01.06.06 07:47 |
Permalink
When moving something to/from a WebDAV volume (such
as an iDisk), try saving something to the desktop.
Here, the file is saved but doesnt show up, neither on the desktop, nor by browsing the Desktop folder (in any view). Things get really weird when you "open file" from the Terminal, then Command-click on the title bar - suddenly the file just appears.
This actually happens in any folder.
Here, the file is saved but doesnt show up, neither on the desktop, nor by browsing the Desktop folder (in any view). Things get really weird when you "open file" from the Terminal, then Command-click on the title bar - suddenly the file just appears.
This actually happens in any folder.
From OSX-vnc to ARD
23.04.06 07:51 |
Permalink
ARD 2.2 & Fast User Switching
08.04.06 07:52 |
Permalink
It's DNS again!
06.04.06 07:53 |
Permalink
10.3/4 Image Deployment & RAID
28.03.06 07:54 |
Permalink
Changing IPs
16.03.06 13:30 |
Permalink
Potential VM growth in DirectoryService since client
PID: 0,
23.02.06 13:59 |
Permalink
Apache 2.2
14.02.06 14:05 |
Permalink
There seems to be some problems with certain Apache
2.x configs under OS X (10.4 only?) where the
connection would just randomly quit. One fix is to
install 2.2
./configure --prefix=/usr/local/apache2 --enable-so --enable-mods-shared=most --enable-ssl --with-ssl=/usr --enable-cgi --enable-mime-magic --enable-dav
Installing PHP 5.1.2
14.02.06 14:05 |
Permalink
These settings worked well for me:
> nano -w /usr/local/php/lib/php.ini
include_path .:
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/lib --with-apxs2=/usr/local/apache2/bin/apxs --with-iconv --with-openssl=/usr --with-zlib=/usr --with-mysql --with-libxml-dir=/usr/local/php --with-xsl=/usr/local/php --with-pdflib=/usr/local/php --with-png-dir=/usr/local/php --with-zlib-dir=/usr --with-ldap--with-iodbc=/usr --with-xmlrpc --with-expat-dir=/usr/local/php --with-iconv-dir=/usr --with-curl=/usr/local/php --enable-exif --enable-soap --enable-sockets --enable-calendar --with-bz2=/usr --enable-calendar --enable-memory-limit
> nano -w /usr/local/php/lib/php.ini
include_path .:
Restoring WebLogs with Apache 2.2
14.02.06 14:04 |
Permalink
http://www.wmwweb.com/apache/tomcat/tomcat-connectors/jk/source/jk-1.2.15/jakarta-tomcat-connectors-1.2.15-src.tar.gz
./configure --with-apxs=/usr/local/apache2/bin/apxs
> nano /usr/local/apache2/conf/httpd.conf
## WebLog
JKWorkersFile /etc/httpd/workers.properties
JKLogFile /var/log/httpd/mod_jk.log
JKLogLevel error
JKMount /*.jsp JBoss1
JKMount /servlet/* JBoss1
JKMount /examples/* JBoss1
JKMount /weblog/* blojsomworker
JKMount /blojsom_resources/* blojsomworker
Upgrading to MySQL 5
10.02.06 14:03 |
Permalink
http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-standard-5.0.18-osx10.4-powerpc.dmg/from/pick#mirrors
G5 version (& RAM > 4GB)
http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-standard-5.0.18-osx10.4-powerpc-64bit.dmg/from/pick#mirrors
Check /etc/hostconfig
Create DB:
Add users:
G5 version (& RAM > 4GB)
http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-standard-5.0.18-osx10.4-powerpc-64bit.dmg/from/pick#mirrors
> mkdir /Library/StartupItems/MySQLCOM
> nano /Library/StartupItems/MySQLCOM/MySQLCOM
#!/bin/sh
##
# MySQL 5 Server
##
. /etc/rc.common
StartService ()
{
if [ "${MYSQL:=-NO-}" = "-YES-" ]; then
ConsoleMessage "Starting MySQL 5 Server"
cd /usr/local/mysql
./bin/mysqld_safe &
fi
}
StopService ()
{
ConsoleMessage "Stopping MySQL 5 Server"
PIDS=`ps ax | grep mysql | grep -v grep | awk '{print $1}'`
for pid in $PIDS; do
kill -KILL $pid
done
}
RestartService ()
{
StopService
sleep 3
StartService
}
RunService "$1"
> nano /Library/StartupItems/MySQLCOM/StartupParameters.plist
{
Description = "MySQL 5 Server";
Provides = ("MySQLCOM");
Requires = ("Resolver");
OrderPreference = "Late";
Messages =
{
start = "Starting MySQL 5 Server";
stop = "Stopping MySQL 5 Server";
};
}
Check /etc/hostconfig
MySQLCOM -=YES=-
Create DB:
>/usr/local/mysql/bin/mysqladmin -u root -p create TESTING
Add users:
GRANT ALL PRIVILEGES ON TESTING.* TO 'name'@'localhost' IDENTIFIED BY 'password';