How to Change WebCit’s Port Number

After installing Citadel mail server, you might find that its web frontend called WebCit occupies your https port 443.  If you want to run Apache (or another web server) with SSL enabled on the same IP, this isn’t going to float.

Fortunately, changing WebCit’s port is as easy as editing the config file likely found at /etc/default/webcit.  Just change the port number on the following line:

export WEBCIT_CITADEL_PORT='443'

Just make it something like 2000, which I believe should be its default port anyway.

After making the change, don’t forget to restart the service:

/etc/init.d/webcit restart

Automate System Updates in Ubuntu

If you’re administering your server in Ubuntu, you might want to set up a cron to update and upgrade your software each night.  There’s an easy way to do this thanks to the convenient Ubuntu package cron-apt.

To automate daily bug and security updates to your Linux system, first install cron-apt with the following command:

apt-get install cron-apt

Then configure it to email you the results each time it runs, edit /etc/cron-apt/config to include the following lines:

MAILTO="you@emailaddress.com"
MAILON="always"

Lastly, link it to cron.daily by running the following command:

sudo ln -s /usr/sbin/cron-apt /etc/cron.daily/

This should keep your system nicely up-to-date.  If you’re feeling a little wild (and you’ve backed up everything), you might also want to upgrade to the latest version of Ubuntu every once in a while (but this should never be automated).

Magento Attributes: Set default in pull-down menu (hack)

In Magento, if you’re using a pull-down attribute that needs to be set to default instead of the “Choose option…” default automatically provided by Magento, you are theoretically supposed to be able to set it from within the Admin portal by using Catalog > Attributes > Manage Attributes.  Unfortunately, it looks like there is a bug that isn’t allowing you to do that.

To fix this, open up the JavaScript file /js/varien/product.js and change line 356 from var index=1; to  var index=0;

This will force Magento to pay notice to your preferred default in the pull-down rather than displaying “Choose option…” and forcing the user to select something.

Caveat: If you are using more than one custom pull-down/drop-down attribute, you’ll probably screw some stuff up.