Server Setup with Debian GNU/Linux 4.0 'Etch'
Contents
Introduction
This server guide and my experiences have only been tested in environments with up to fifteen people/workstations so don't expect it to be spot-on when it comes to other areas. I have no experience of running a server openly on the Internet or a (Linux) server at high capacity for large numbers of users so expect the advice as applied to these realms to be vague. Everything in here comes from direct experience at one time or another but my most thorough day-to-day server knowledge, reflected in sections in here and in other guides from thegoldenear.org, is in Samba domain controllers; mail servers; print servers; Linux and Debian.
The Samba server details in this guide are for a simple file server, for more see my separate guide to a Samba primary domain controller and file/print/software deployment server for Windows using Samba 3
See my related documents on setting up a desktop system using Debian which includes some aspects common to both servers and desktops: Desktop System Setup with Debian 4.0 Testing/Etch.
I also provide a menu driven command-line program, called Twix, to help you install most of what is covered in this document and configure some of it. Twix can be downloaded for free from http://thegoldenear.org/toolbox/unices/twix/.
Notable changes to this document
Work in progress: - 11 September 2012 - Advice on changing Postfix's message size limit mistakenly said to use a value in kilobytes, rather than in bytes. - Leave 2% of unused unpartitioned space at the end of each disk so that in the event of failure, if the disk is replaced with another of notionally the same size, because disk sizes tend to differ slightly we can cope if the replacement disk is a little smaller. - improved RAID and LVM sections - TODO: updated kernel package
1.3.4 - 25 August 2010
- The main Debian archive no longer includes Etch packages and Etch security updates, so ftp.uk.debian.org and security.debian.org have been replaced with archive.debian.org
- 19 January 2010 - In Linux updates section, the AMD64 'Etch and a Half' package had the wrong name, was linux-image-2.6-etchnhalf-amd64 when should have been linux-image-2.6-amd64-etchnhalf
- 10 January 2010 - Mail server - removing old deleted mails - the line added to root's crontab to achieve this shouldn't have included 'root', should have read '00 1 * * * find /home/vmail/ -name '*,ST' -ctime +7 | xargs rm -f' rather than '00 1 * * * root find /home/vmail/ -name '*,ST' -ctime +7 | xargs rm -f'.
- 9 January 2010 - disk labeling section - said that fstab didn't need changing if you used LVM on its own (without RAID), which neglected to recognise that we never use LVM on the '/' partition, even when LVM is used on other partitions, so disk references will need changing in fstab.
- GR Soft Virtual Mail Manager
- create a saner URL - login.php rather than index.php
- fix to be able to forward mail to outside domains in version 1.7 series
- upgrade instructions
- create / change mailmaster accounts
1.3.0 - 5 August 2009
- Added 'Etch and a Half' / Debian 4.0 Etch release 4 kernel 2.6.24
- Added disk labeling section in General Configuration section
- Added 'Recommended Size' to disk partitions
- Added 'Upgrading from the Previous Debian Stable Version' section to the Mail Server section
- Added packages 'htop' and 'lshw' to General Configuration - Useful Tools section
1.2.14 - 26 April 2009 - added ca-certificates package to Fetchmail section.
1.2.9 - 4 Oct 2008 - moved hosts file configuration from MySQL section to General Configuration section because a properly configured /ets/hosts is required for other software too.
1.2.7 - 9 July 2008 - removed appendices on mail server, moved it to seperate document...
1.2.6 - 20 June 2008 - added how to use authenticated SMTP when your mail server uses a relayhost.
1.2.5 - 6 June 2008 - Fetchmail requires START_DAEMON=yes in /etc/default/fetchmail to work.
1.2.4 - 4 June 2008 - added creation of abuse and postmaster accounts to mail server.
1.2.3 - 30 May 2008 - removed webmin-fetchmail, webmin isn't available in Debian, it's installed as one large package from the webmin web site
1.2.0 - 9 March 2008
- Added 'NTP - Set The Time From An Internet Time Server' section
- Expanded the Mail Server section
- Polished off Webmin section
1.1.3 - 5 March 2008 - Added 'Network Addressing' section to 'General Configuration' section; improved 'updates' section in 'Linux kernel updates'.
1.1 - 27 February 2008
- Added PostgreSQL database
- Added 'updates' section to 'Linux kernel updates' section with examples of the different messages you're likley to see when updating.
- Added diagram to help explain mail server system
- Fleshed out RAID + LVM so that it's now a step-by-step guide you can follow rather than a synopsis
- Various minor updates
1.0.5 - 10 December 2007
- Added unshield
- Squirrelmail - added configuration to make use of IMAP SORT
1.0.4 - November 2007 - Added 'set no bouncemail' to Fetchmail configuration to fix issue of replying to spam email
1.0.1 - 18 October 2007 - in example Fetchmail configuration file added 'set postmaster ""' to set no postmaster so mail tagged as SMTP 550 error 'Recipient address rejected: User unknown in virtual mailbox table' is discarded rather than going in fetchmail's mailbox (/var/mail/fetchmail) and eating up disk space
1.0 - 13 October 2007
- Apache 2: apache2-mpm-worker, apache2-mpm-prefork and apache2-mpm-event
- MySQL section
- Made sure phpmyadmin installs with PHP5 and Apache2 by using libapache2-mod-php5
- Added php5-mysql
- PHP section
- Changed php5 to libapache2-mod-php5
- Replaced php5-pear with php-pear
- Added php5-dev and a full list of available PHP modules
Glossary
<something> - when something is in angle brackets you should replace this with something particular to your system; you do not use the angle brackets.
command - text highlighted and in monospaced typeface indicates a command you issue at the command-line.
setting - text in monospaced typeface indicates something seen on screen such as a filename or configuration setting.
$ - when a command-line command is preceded by a dollar it means you run this whilst logged in as a regular user
# - when a command-line command is preceded by a dollar it means you run this whilst logged in as super user / root
Choosing Hardware
Debian GNU/Linux device driver check page: kmuto.jp/debian/hcl/HP/ML115
Package Repositories, Updates & Upgrades
Package repositories
Debian's package management system, known as 'apt', keeps a list of sources, or repositories, it can retrieve packages from when you choose to install them, in the file /etc/apt/sources.list.
Sources can be of the form
- CD/DVD media
- Internet server
You define which Debian flavour you're subscribed to
- stable, also referenced by its alias, Etch
- testing
- unstable
- experimental
These different licencing groups are kept track of
- main
- contrib
- non-free - packages that don't comply with the Debian Free Software Guidelines. Packages can be non-free for any number and gravity of reasons, sometimes for reasons you might consider too slight to prevent you from installing what might be a worthwhile package. You can usually read the copyright file in /usr/share/doc/<package name> to read the restrictions for yourself. There is a non-free tracking system at nonfree.alioth.debian.org/.
There are different providors of Internet server sources
- Debian sources, for the Stable archive
- for regular packages and very occasional updates to them in the form of new 'point releases' throughout the stable release's supported life. The point releases comprise packages with a very conservative number of important non-security related functionality fixes as well as those previously updated through security updates. Use something like this but substitute the domain and directory with that of your nearest Debian mirror:
deb http://archive.debian.org/debian etch main contrib
(You can add non-free if you wish) - security updates - for non-intrusive updates to fix security issues in packages(apart from Iceweasel and Icedove) - www.debian.org/security/ - use:
deb http://archive.debian.org/debian-security etch/updates main contrib
Security updates are only provided for packages in main, not contrib and non-free.
Note that security support for Debian 4.0 Etch ended in February 2010 - volatile - for updates to quickly outdated software such as spam filtering and virus scanning - http://volatile.debian.org - use something like:
deb http://volatile.debian.org/debian-volatile etch/volatile main contrib
If you're running a stable system you may want to subscribe to or read the archives of the debian-volatile-announce mailing list or the debian-volatile mailing list. You can see the files that are included at volatile.debian.org/debian-volatile/dists/etch/volatile/. See the list of mirrors and other protocols with which to access them.
As-of August 2007 the main section has clamav (antivirus scanner), avscan (GTK frontend for clamav), spamassassin (spam filter), tzdata (Time Zone and Daylight Saving Time Data) and postgrey (Postfix greylisting policy server); contrib and non-free are empty. - volatile-sloppy - for function enhancements to software in the stable archive akin to that in volatile (see lists.debian.org/debian-devel-announce/2005/05/msg00016.html for a description) - use something like:
deb http://volatile.debian.org/debian-volatile etch/volatile-sloppy main contrib
You can see the files that are included at volatile.debian.org/debian-volatile/dists/etch/volatile-sloppy/. See the list of mirrors and other protocols with which to access them.
As-of January 2009 there wasn't anything in volatile-sloppy.
- for regular packages and very occasional updates to them in the form of new 'point releases' throughout the stable release's supported life. The point releases comprise packages with a very conservative number of important non-security related functionality fixes as well as those previously updated through security updates. Use something like this but substitute the domain and directory with that of your nearest Debian mirror:
- other peoples' sources - software not officially in Debian or backports of updated software for stable versions of Debian. For example:
- Debian Backports -
backports.org - "You are running Debian stable, because you prefer the stable Debian tree. It runs great, there is just one problem: the software is a little bit outdated compared to other distributions. That is where backports come in. Backports are recompiled packages from testing (mostly) and unstable (in a few cases only, e.g. security updates), so they will run without new libraries (wherever it is possible) on a stable Debian distribution. I recommend you to pick out single backports which fits your needs, and not to use all backports available here.":
- deb http://www.backports.org/debian etch-backports main contrib
(You can add non-free if you wish and shold instead choose a mirror) - Package: debian-backports-keyring - GnuPG archive key of the backports.org repository.
aptitude -t etch-backports install <package> - deb http://www.backports.org/debian etch-backports main contrib
- Debian Backports -
backports.org - "You are running Debian stable, because you prefer the stable Debian tree. It runs great, there is just one problem: the software is a little bit outdated compared to other distributions. That is where backports come in. Backports are recompiled packages from testing (mostly) and unstable (in a few cases only, e.g. security updates), so they will run without new libraries (wherever it is possible) on a stable Debian distribution. I recommend you to pick out single backports which fits your needs, and not to use all backports available here.":
Debian installs with a default that uses 'main', it doesn't include 'contrib' or 'non-free'.
To add new CDs to your sources list, other than during installation: apt-cdrom add. The disc will be automatically mounted, scanned and its details added to your sources list (if you have trouble you may need to use apt-cdrom add -d /media/cdrom)
To add new Internet servers to your sources list, other than during installation: ?.
Updates
4.0 Etch
| Release | Date | Changes |
|---|---|---|
| 4.0r0 | 8 April 2007 | |
| 4.0r1 | 15 August 2007 | http://times.debian.net/1161-etch-r1 (doesn't list non-free packages i.e. ipw2200-) |
| 4.0r2 | 27 December 2007 | http://www.us.debian.org/News/2007/20071227 |
| 4.0r3 | 17 February 2008 | http://www.debian.org/News/2008/20080217 |
| 4.0r4 / etch-and-a-half / etch'n'half | 26 July 2008 | http://www.debian.org/News/2008/20080726 |
| 4.0r5 | 23 October 2008 | http://www.debian.org/News/2008/20081023 |
| 4.0r6 | 18 December 2008 | http://www.debian.org/News/2008/20081218 |
| 4.0r7 | 10 February 2009 | http://debian.org/News/2009/20090210 |
| 4.0r8 | 8 April 2009 | http://www.debian.org/News/2009/20090408 |
| 4.0r9 | 22 May 2010 | http://www.debian.org/News/2010/20100522 |
A full changelog is available at http://ftp.debian.org/debian/dists/etch/ChangeLog.
There are two daily 'pulses' at 00:00 and 12:00 GMT upon which updated packages, if any, are made available.
Security updates are often made available, potentially even daily.
Very occasional other updates are made in the form of new 'point releases' of Debian stable. They comprise packages with a very conservative amount of miscellaneous bugfixes, removed packages, missing builds and security updates (those previously available thru security updates). These packages are introduced into the main stable archive when released. Similarly the downloadable ISO images available for installing Debian are updated, they have a 'r' designation.
The packages waiting to be made available in the next point release are held in a repository known as stable-proposed-updates but seemingly more readily available as etch-proposed-updates. You can subscribe to this repository to get these packages as they enter the queue rather than waiting for the release date.
For access to packages headed for but not yet entered etch-proposed-updates - 'Packages awaiting proposed-updates moderation - Summary for proposed-updates': http://ftp-master.debian.org/proposed-updates.html
Upgrades
To upgrade to the next version of Debian, replace the code name / alias in sources.list from 'etch' to 'lenny'.
Skipping releases is not supported. To upgrade from Woody to Etch you must first upgrade to Sarge, then to Etch. Edit /etc/apt/sources.list and replace 'testing' or 'etch' or 'stable' or 'unstable' with 'sarge' then 'aptitude update && aptitude dist-upgrade'.
General Configuration
Use the latest Debian 'stable' distribution (this document is for version 4.0) from http://www.debian.org/distrib/ (Note that because Etch is now archived it can only be downloaded from http://cdimage.debian.org/cdimage/archive/4.0_r9/).
Set the time to the correct Greenwich Mean Time (GMT) in the BIOS before installing Debian. During installation, say that the system clock is set to GMT. Debian will take care of setting your localised time correctly (as an offset from GMT).
Partitioning Scheme
Debian Installer's 'Multi-user workstation' option may create the following kind of partitions with a 40GB disk:
- / - 500MB
- /usr - 5GB
- /var - 3GB
- /tmp - 400MB
- swap - 400MB
- /home - 31GB
You may want to locate /home on a separate disk.
Instead of following Debian's suggested partition sizes you may want to manually partition like so:
| Label | Partition No. | Partition type | Minimum Size | Recommended Size | Mount point | File system | Usage that can unexpectedly use up space |
|---|---|---|---|---|---|---|---|
| boot | 1 | primary | 500MB | 1GB | / | ext3 | Linux kernels |
| 2 | extended | Total size of rest of disk | Contains logical partitions | ||||
| usr | 5 | logical | 2GB | ? | /usr | ext3 | |
| var | 6 | logical | 3GB | 3GB | /var | ext3 | Email for local mailboxes (i.e. root) |
| tmp | 8 | logical | 500MB | 1GB | /tmp | ext3 | For temporary files whilst certain operations are carried out |
| swap | 7 | logical | 1GB | 2GB. Needs occasional monitoring; upgrade RAM if swap is used; server shouldn't be using swap but useful to have if something goes wrong. | swap | swap | "'it depends ...' (on the size of physical memory, number of competing processes, degree to which code is shared between active processes, number of users, database requirements" |
| home | 9 | logical | Larger than current user data requires | Estimate how much user data will grow over next couple of years | /home | ext3 | User home directories; email |
| 2% | 2% | If you need to replace this disk in the event of failure with another notionally of the same size, the replacement may not exactly match, so leave 2% of unpartitioned space to enable duplication |
If you're also using this server for a Samba domain controller, following my separate Samba guide, then take into account the differing partition sizes recommended for that role.
Miscellaneous
Don't install applications using Tasksel or DSelect, just install the basic system with the installer, then manually install any software you specifically require, or use Twix to install it for you.
Download and apply any security updates using 'aptitude update' then 'aptitude dist-upgrade'
Make a rescue/boot floppy disk: mkboot
Disk Labeling
If you have a SCSI hard disk (or disks) and a USB-attached disk, say, for backing up to, and you aren't using Linux RAID and/or LVM, then the machine can fail to boot when the USB-attached disk is connected. This is particulrly problematic if you administer the machine remotely. The SCSI subsystem (which deals with SCSI and USB disks, but not ATA disks) numbers disks in the order it finds them, which isn't always the same order. The SCSI disk is generally seen as /dev/sda and the USB-attached disk is generally seen as /dev/sdb. These device references can change depending on various conditions at boot time. Apart from when using LVM, files involved in the Linux boot process by default use the disk device reference, rather than a reference that isn't subject to change. If the USB-attached disk is attached on startup then most of the time, but not always, some way into loading the system Linux fails because the USB-attached disk has been recognised as /dev/sda and part of the kernel is trying to be loaded from the backup disk.
We can fix this by labeling disks, then telling the system the labels of the disks to boot from rather than their device references.
From the fstab man page: "Instead of giving the device explicitly, one may indicate the (ext2 or xfs) filesystem that is to be mounted by its UUID or volume label (cf. e2label(8) or xfs_admin(8)), writing LABEL=<label> or UUID=<uuid>, e.g., 'LABEL=Boot' or 'UUID=3e6be9de-8139-11d1-9106-a43f08d823a6'. This will make the system more robust: adding or removing a SCSI disk changes the disk device name but not the filesystem volume label."
(See 'Auto backup a server to a hotswap USB disk' for how we treat the backup disk)
Label disks
Label the disks as per how they appear in /etc/fstab. Here's an example for one physical disk, with one primary partition, the rest logical partitions:
Label the boot partition: e2label /dev/sda1 boot
Label the usr partition: e2label /dev/sda5 usr
Label the var partition: e2label /dev/sda6 var
Label the swap partition: mkswap -L swap /dev/sda7
Label the tmp partition: e2label /dev/sda8 tmp
Label the home partition: e2label /dev/sda9 home
/etc/fstab
This is a section from an example fstab file (where the system is on one disk, with one primary partition and the other partitions logical, not using LVM - yours might differ):
/dev/sda1 / /dev/sda5 /usr /dev/sda6 /var /dev/sda7 swap /dev/sda8 /tmp /dev/sda9 /home
This is how the same section looks using labels (on a system without Linux RAID and/or LVM):
LABEL=boot / LABEL=usr /usr LABEL=var /var LABEL=swap none LABEL=tmp /tmp LABEL=home /home
Linux RAID uses a unique device reference in fstab that doesn't clash with USB attached disks and so systems using Linux RAID don't require a change to fstab.
LVM uses a unique device reference in fstab that doesn't clash with USB attached disks and so systems using LVM don't require a change to fstab, but note that we don't use LVM on the '/' partition and so that reference will still need an amendment making in fstab unless Linux RAID is also being used.
/boot/grub/menu.lst
In menu.lst, for every kernel you want to use, change the partition name where the kernel finds its root filesystem, changing kernel lines like:
kernel /boot/vmlinuz-2.6.24-etchnhalf.1-686 root=/dev/sda1 ro
to:
kernel /boot/vmlinuz-2.6.24-etchnhalf.1-686 root=LABEL=boot ro
Note that a kernel upgrade, even a minor one, will restore the above line back to the original style of device reference, for each kernel entry, whether or not you updated the other kernels in the list. So after each kernel upgrade, before rebooting, you'll need to amend these back to using a label.
Linux RAID uses a unique device reference in menu.lst that doesn't clash with USB attached disks and so systems using Linux RAID don't require a change to menu.lst, whether or not LVM is also used.
LVM, used on its own rather than in conjunction with Linux RAID, suffers from this issue with menu.lst and so systems using only LVM do require a change to menu.lst, both initially and after each kernel upgrade before rebooting.
(LVM already uses UUID (similar to label) in mdadm.conf)
Network Addressing
It's usually easiest to choose automatic network addressing during installation, if you have a DHCP server running. After installation though, you'll want the server to have a static IP address. In /etc/network/interfaces, replace 'allow-hotplug eth0' and 'iface eth0 inet dhcp' with this kind of addressing information (your scheme may need to differ):
auto eth0 iface eth0 inet static address 10.0.0.10 netmask 255.255.255.0 gateway 10.0.0.1 dns-nameservers 10.0.0.1 dns-search localdomain
Hosts File
MySQL, Apache, amavis (or some other part of the mail server, possibly also postfix) require the hosts file to be set correctly. MySQL will only install if the system already has a non-numeric hostname that is resolvable via the /etc/hosts file.
Run hostname -f; if it returns just the machine's name, i.e. 'server', rather than its fully qualified domain name (FQDN) - its name followed by its domain, i.e. server.localdomain or server.yourdomain.org - then you need to add a line to /etc/hosts with its IP address then FQDN then name such as '10.0.0.10 server.localdomain server'.
Here's an example for a server on an intranet:
127.0.0.1 localhost server 127.0.1.1 server.localdomain server 10.0.0.10 server.localdomain server
Here's an example for a server on the Internet:
127.0.0.1 localhost server 127.0.1.1 server.yourdomain.org server 82.194.133.227 server.yourdomain.org server
Useful Tools
- lshw - very descriptive list of a computer's hardware
- tree (is this not installed by default now in Etch?)
- less (is this not installed by default now in Etch?)
- wipe - securely erase files
- lynx - text mode web browser
- traceroute
- tcpdump
- nmap - network port scanner
- htop - more visually appealing version of 'top'
- Diagnostic programs for network card(s)
- mii-diag - for strictly 10/100 MII hardware (includes 3Com)
- ethtool - display or change ethernet card settings, giving information such as speed, auto-negotiation and duplex (http://sourceforge.net/projects/gkernel/)
- nictools-pci - Diagnostic tools for many PCI ethernet cards. Amongst many such configuration programs, includes:
- eepro100-diag : Diagnostic and setup for the Intel EEPro100 Ethernet cards
- rtl8139-diag : Diagnostics and EEPROM setup for RealTek RTL8129/8139 chips
- vortex-diag : Diagnostics and EEPROM setup for the 3Com Vortex series
- nictools-nopci - Diagnostic tools for many PCI ethernet cards. Amongst many such configuration programs, includes:
- 3c5x9setup : Setup program for 3Com EtherLink III Ethernet cards
- el3diag : Diagnostic program for 3c509 and 3c579 Ethernet cards
Mail Transfer
If you want the system to be able to send out mail, such as for sending logs to you, and you don't have a full-blown mail server:
- Install postfix, replacing exim: aptitude install postfix
- When asked during Postfix's installation, set it to be an 'Internet Site'
- When asked during Postfix's installation, set the name to your normal mail domain name rather than the local server's intranet name
- Add a relay host to Postfix that will deliver mail on your behalf:
postconf -e relayhost=[<your ISP's SMTP server>]
"The form enclosed with [ ] eliminates DNS MX lookups. ... otherwise mail may be mis-delivered.". postconf ensures Postfix picks up the new setting, you don't need to force it to do so yourself.
NTP - Set The Time From An Internet Time Server
Package(s)
- ntp - ntp.isc.org and www.ntp.org [Version: 4.2.2.p4]
- ntp-doc [Version: 4.2.2.p4]
Configuration
Configuration file: /etc/ntp.conf
From /etc/ntp.conf:
# If you want to provide time to your local subnet, change the next line. # (Again, the address is an example only.) #broadcast 192.168.123.255
From /usr/share/doc/README.Debian.gz:
"Several people have reported that ntpd fails on [Intel] SMP boxes unless the "Enhanced Real-Time Clock" support is enabled in the kernel."
"If your system is behind a firewall, the port you need to open up to allow the NTP protocol to work (for either ntpdate or ntpd) is UDP port 123. Server-to-server NTP packets usually use this for both source and destination: for extra security, a stateful firewall should block "new" packets with source, but not destination, port 123 from entering your network."
Usage
Control the daemon: /etc/init.d/ntp start|stop|restart
Print a list of the peers known to the server as well as a summary of their state:
ntpq -p
Logging
Logs to /var/log/daemon.log and /var/log/syslog
Further Information
Debian Bug report logs: Bugs in package ntp in etch: http://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=ntp;dist=etch
/usr/share/doc/ntp-doc/html/index.html
Backup - Backup Manager - Backup to CD-R/CD-RW/DVD-R/FTP/SSH
Package(s)
Good for backing up one computer to either CD-R/CD-RW/DVD-R/FTP/SSH (note that it doesn't support DVD-RW or removable media such as USB-attached hard disk or flash media)
Configuration
Configuration file: /etc/backup-manager.conf.
Schedule configuration file: /etc/cron.d/backup-manager.
A debconf priority of 'low' is advised if you want to be asked if the backup is to be written to CD/DVD or to another computer using SSH.
The backup is automatically scheduled with cron to run at 04:00.
The easiest and officially recommended method to configure backup-manager is using dpkg-reconfigure backup-manager. Alternatively you can edit its configuration file.
If you are trying to write the backup to CD using an ATA CD writer and it's failing, follow this from the Backup Manager User Guide (the man page with version 0.6.2 doesn't explain this option anywhere near as well):
"Backup Manager uses cdrecord for burning CDs. If when you run cdrecord -scanbus you don't see your burning device, that means you will have to force the device in ATA mode. To tell Backup Manager to do so, just put here the path to your device, and a switch will be appended to the cdrecord commandline like the following : cdrecrord ... dev=$BM_BURNING_DEVFORCED ....
Leave this configuration key blank if you see your device with cdrecord -scanbus, in this case, Backup Manager will use the default cdrecord device for burning CDR media.
Example: export BM_BURNING_DEVFORCED="/dev/cdrom""
Usage
You will generally leave responsibility with cron to schedule backups but you can run it manually with backup-manager -v.
Troubleshooting
The log of messages describing backup-manager's operations go to /var/log/messages with the tag backup-manager.
The log of what happened when writing to CD/DVD go to /tmp/bm-burning.log.<6 seemingly random characters>.
Further Information
/usr/share/doc/backup-manager-doc
Backup Manager Documentation, including User Guide: http://www.backup-manager.org/documentation/.
An example configuration file: http://www.backup-manager.org/documentation/backup-manager.conf.html.
Backup - Flexbackup - Backup to tape (DAT)
Good for backing up to tape (DAT).
Package(s)
- flexbackup
- afio
Usage
Schedule it to run daily automatically using /etc/crontab: 00 1 * * 1-5 root flexbackup -set home -full
Rewind a tape: mt -f /dev/nst0 rewind
flexbackup -newtape
flexbackup -set home -full
List files in archive: flexbackup -list
List current device's table of contents: flexbackup -toc
To quickly extract just a single file, use -extract -onefile <path to file>, giving the path from the archive. Or flexbackup -extract -flist <filename> (you have to give a full path, the man page doesn't indicate this, otherwise says "list of files <filename> not readable: No such file or directory".
To extract a list of multiple files, put them into a text file, for instance "restorelist", then use -extract -flist restorelist. The format is one line per pathname, using the path of the file in the archive.
Note if you are using afio with compression you need to append .z
to filenames for any compressed files (depends on threshold and exclusion patterns).
Flexbackup logs to /var/log/flexbackup/ with filenames such as flexbackup.list.200705081249.log, home.0.200705100200.gz, home.latest.gz.
See files / status written last: zless /var/log/flexbackup/home.latest.gz
Configuration
Configuration file: /etc/flexbackup.conf (See http://www.edwinh.org/flexbackup/flexbackup.conf.txt)
- $set{'home'} = "/home";
- $device = '/dev/nst0';
- Defaults to using afio
- Defaults to compress using gzip at compression level 4
- By default -full will erase the tape first; if it takes too long it can be set to just start from the beginning of the tape rather than erasing it as well
It's possibly better to do '-full' backups because less complex when restoring files; works around using the '-level' option ('-full' defaults to '-level 0').
Backup - Tape Drives - Dealing directly with tape drives
Package(s)
- tar - tape archiver
- mt-st - Linux SCSI tape driver aware magnetic tape control (aka mt)
Usage
You don't create a file system on a tape, nor do you mount it or attempt to access the data on it as files. You simply treat the tape device itself as a single 'file'.
SCSI tape drives are referenced by /dev/st0 (device is "rewind on close") or /dev/nst0 (device is "don't rewind on close".
Use tar to read and write files and directories to and from the tape, with the following options:
c- createx- extractv- verbosef- use archive filet- list
Use mt to control the tape drive, with the following syntax: mt -f /dev/st0 command where command would be any of the following:
rewind- rewind a taperetension- retension a tapeoffline- unload a tapestatus- print status information about the tape uniterase- erase a tape
Write files to a tape:
tar cvf /dev/st0 files-or-directories-to-backup
(by default it recurses into sub-directories)
Retrieve a complete archive back from a tape to the current working directory:
tar xvf /dev/st0
(be mindful of the directory you're in when you run this as it could overwrite files in your current directory)
List the files on a tape:
tar tvf /dev/st0
Retrieve individual files from a tape to the current directory:
tar xvf /dev/st0 filename1 filename2 filename3
You can schedule backups using cron, via the configuration file /etc/crontab, such as with this line which will run your own backup script at 04:00:
00 4 * * * root /root/backup.sh
Troubleshooting
Check that the operating system sees the device by running dmesg and looking for "attached SCSI tape st0 at".
List SCSI devices:
cat /proc/scsi/scsi.
See man pages on 'mt' and 'st'.
Apache - web server
Package(s)
- Apache - httpd.apache.org/ - the 'apache2' meta-package is fulfilled by one of either of these versions which each include a different Multi-Processing Module (MPM). If you install apache in order to provide for a single specific application, such as for phpmyadmin, then you can let the application choose its own version of Apache rather than worrying about it in advance. [Version: 2.2.3]
- apache2-mpm-worker - high speed threaded model for Apache HTTPD 2.1. The worker MPM provides a threaded implementation for Apache HTTPD 2.1. It is considerably faster than the traditional model, and is the recommended MPM. This MPM is generally a good choice for high-traffic servers because it has a smaller memory footprint than the prefork MPM.
- apache2-mpm-prefork - traditional model for Apache HTTPD 2.1. This Multi-Processing Module (MPM) implements a non-threaded, pre-forking web server that handles requests in a manner similar to Apache 1.3. It is appropriate for sites that need to avoid threading for compatibility with non-thread-safe libraries. (For example PHP5 ONLY works with Apache's prefork MPM (the apache2-mpm-prefork package), as PHP is not compiled thread-safe.) It is also the best MPM for isolating each request, so that a problem with a single request will not affect any other. This MPM is not as fast, but is considered to be more stable.
- apache2-mpm-event - event driven model for Apache HTTPD 2.1. The event Multi-Processing Module (MPM) is designed to allow more requests to be served simultaneously by passing off some processing work to supporting threads, freeing up the main threads to work on new requests. This MPM is especially suitable for sites that see extensive KeepAlive traffic.
- apache2-doc - documentation
Configuration
/etc/apache2/apache2.conf
/etc/apache2/conf.d
/etc/apache2/httpd.conf
Troubleshooting
Error log (this includes database connection errors from web applications such as egroupware): /var/log/apache2/error.log
PHP - for programming databases
PHP is an Apache module and the only way PHP is used (other than the command-line interpreter, php5-cli).
Package(s)
- libapache2-mod-php5 - this is PHP 5. This also installs the Apache prefork MPM (apache2-mpm-prefork) version of the Apache 2 web server (the only version of Apache 2 PHP will work with)
- php-pear - PEAR - PHP Extension and Application Repository - pear.php.net/. Includes the base PEAR classes for PHP, as well as the PEAR installer (see pear.php.net/package/PEAR for a description of what's included). The PHP Extension Community Library (PECL) (pecl.php.net/) is a repository of PHP extensions that are made available to you via the PEAR packaging system. Alternatively, many PEAR classes are already packaged for Debian, see the list of vailable PHP modules below. Note: to build and install precompiled PECL extensions, you will need php5-dev.
- php5-dev - provides the files from the PHP5 source needed for compiling additional modules.
- Available PHP modules - for database connectivity and a host of other features
- php5-apache2-mod-bt - mod_bt
- php5-auth-pam - PAM authentication
- php5-clamavlib - ClamAV
- php5-idn - PHP api for the IDNA library
- php5-imagick - ImageMagick
- php5-json - JSON serialiser
- php5-mapscript - mapserver
- php5-maxdb - MaxDB database access
- php5-memcache - memcache
- php5-ming - Ming
- php5-ps - ps
- php5-sqlite3 - SQLite3 module
- php5-sqlrelay - SQL Relay PHP API
- php5-suhosin - advanced protection
- php5-uuid - OSSP uuid module
- php5-xapian - Xapian search engine
- php5-curl - CURL
- php5-gd - GD
- php5-imap - IMAP
- php5-interbase - interbase/firebird
- php5-ldap - LDAP
- php5-mcrypt - MCrypt
- php5-mhash - MHASH
- php5-mysql - MySQL
- php5-odbc - ODBC
- php5-pgsql - PostgreSQL
- php5-pspell - pspell
- php5-recode - recode
- php5-snmp - SNMP
- php5-sqlite - SQLite
- php5-sybase - Sybase / MS SQL Server
- php5-tidy - tidy
- php5-xmlrpc - XML-RPC
- php5-xsl - XSL
Configuration
/etc/php5/apache2/php.ini
Upgrading from previous Debian stable version
PHP5 replaces PHP4
Compression / Archival
These can be useful for many reasons, for example the anti-virus and spam co-ordinating program Amavis uses many of them if they're installed.
Package(s)
- arc - archive utility based on the MSDOS ARC program plus a few enhancements
- arj - archiver for .arj files. An open source version of the arj archiver. This version has been created with the intent to preserve maximum compatibility and retain the feature set of original ARJ archiver as provided by ARJ Software, Inc.
- bzip2 - www.bzip.org - bzip2 is a freely available, patent free, high-quality data compressor. It typically compresses files to within 10% to 15% of the best available techniques, whilst being around twice as fast at compression and six times faster at decompression. The archive file format of bzip2 (.bz2) is incompatible with that of its predecessor, bzip (.bz).
- cabextract - www.cabextract.org.uk/ - unpacks Microsoft cabinet (.cab) files. Microsoft cabinet files are used by Microsoft and others to distribute all kinds of data and software: core Web fonts, videos, operating system updates and video codecs, to give some examples. Microsoft cabinets are also used as the installation format for Windows CE software.
[Author: Stuart Caie] - cpio - GNU cpio is a tool for creating and extracting archives, or copying files from one place to another. It handles a number of cpio formats as well as reading and writing tar files.
- lha - the lzh archiver, popular on MS-DOS (and Windows?). [non-free - open source, has some restrictions and some vaguely worded terms; read the licence]
- lzop - www.lzop.org - lzop is a compressor similar to gzip. Its main advantages over gzip are much higher compression and decompression speed. lzop was designed with the following goals in mind: reliability, speed (both compression and decompression), reasonable drop-in compatibility with gzip, portability
- nomarch - Unpacks .ARC and .ARK MS-DOS archives. This is a de-archiving only replacement for the arc archiver from SEA. It can handle pkarc archives, as well as others. This package is very useful for E-Mail virus scanner scripts for attachement unpacking.
- p7zip-full - p7zip.sourceforge.net - 7-Zip (7-zip.org) is the file archiver that archives with the highest compression. This package will also handle ZIP, Zip64, CAB, RAR, ARJ, GZIP, BZIP2, TAR, CPIO, RPM, ISO and DEB formats. It includes programs 7z (handles all the above formats) and 7za (handles less formats than 7z). If you need to save space (2.5MB) you can instead install the p7zip package with its 7zr / p7zip program, a 'light' version of 7za which only includes support for the 7z format. If you want just the 7Zip library you can install the lzma package.
- pax - Portable Archive Interchange. Pax is an archiving utility that reads and writes tar and cpio formats, both the traditional ones and the extended formats specified in IEEE 1003.1. Three user interfaces are supported: tar, cpio, and pax. The pax interface was designed by IEEE 1003.2 as a compromise in the chronic controversy over which of tar or cpio is best. This is the free OpenBSD's version written by Keith Muller.
- tnef - sourceforge.net/projects/tnef - TNEF is a program for unpacking MIME attachments of type "application/ms-tnef". This is a Microsoft only attachment. Due to the proliferation of Microsoft Outlook and Exchange mail servers, more and more mail is encapsulated into this format (often in the form of a winmail.dat file). The TNEF program allows one to unpack the attachments which were encapsulated into the TNEF attachment. Thus alleviating the need to use Microsoft Outlook to view the attachment.
- unrar - extracts files from .rar archives. If you want to create .rar archives, install package rar. Unrar can handle where as unrar-free cannot. [non-free - freeware, open source, restricts you to not using the source to create a rar archiver; read the licence] (alternatively there is unrar-free (https://gna.org/projects/unrar/) but it cannot handle version 3.0 of the rar format)
- unshield - www.synce.org/index.php/Unshield - extracts Microsoft-format CAB files from InstallShield installers. InstallShield installers comprise a .exe InstallShield installer for Microsoft Windows in which there are InstallShield cabinet files (usually named data1.cab, data1.hdr, data2.cab, data2.hdr, etc) and within them Microsoft cabinet files. The Microsoft and InstallShield cabinet files are of different formats. Unshield extracts the InstallShield cabinet files from the .exe InstallShield installer and then the Microsoft cabinet files from the InstallShield cabinet files. The Microsoft cabinet files can then either be loaded into a Windows CE device for installation or themselves unpacked using cabextract (a separate package). Unshield doesn't support encrypted files.
[Version: 0.5 | Author(s): David Eriksson | Licence: MIT] - unzip - www.info-zip.org/UnZip.html
- ytnef - ytnef.sourceforge.net - Yerase's TNEF Stream Reader allows you to decode application/ms-tnef e-mail attachments, which are usually entitled "winmail.dat" and are generally a file container format that is only readable by Microsoft Outlook. Some TNEF streams also include RTF-formatted data. Ytnef parses these streams into normal MIME attachments and RTF attachments that you can read from non-Outlook mail readers.
It also handles VCAL format calendar / meeting requests, though this may not work when dealing with newer versions of Outlook.
A convenience script is provided to allow users to transparently filter messages containing TNEF attachments into messages with proper attachments, via procmail.
ytnef isn't yet a drop-in replacement for tnef. - zip - www.info-zip.org/Zip.html
- zoo - manipulate zoo archives. This package exists for its historical value. If you are looking for a compression tool for serious use, check tar and gzip.
LVM - Logical Volume Management
See also the RAID section, but you can follow just this section to setup both RAID and LVM at the same time.
You can use the Debian Installer to configure RAID and LVM when you initially setup the server.
GRUB can't boot from an LVM partition, nor from an mdadm / software RAID 5 array, so we create a '/' partition that is configured just as a RAID 1 array.
GRUB will only boot when the filesystem uses ext3. If you use something other than ext3 the Debian installer will want to install LILO.
Example 1
This is an example of setting up a system with LVM on a RAID1 array using 2 of 72GB SCSI, SATA or SAS hard disks, without any hot spares, using the Debian Installer.
Here is a kind of map of how disks, RAID and LVM fit together:
disk (/dev/sda or /dev/sdb) partition (/dev/sda1, /dev/sdb1) RAID1 - MD device 1 - /dev/md0 / disk (/dev/sda, /dev/sdb) partition (/dev/sda2, /dev/sdb2) RAID1 - MD device 2 - /dev/md1 LVM - volume group - 'server' logical volume - 'server_usr' /usr logical volume - 'server_var' /var logical volume - 'server_tmp' /tmp logical volume - 'server_swap' swap logical volume - 'server_home' /home
Here is another kind of map of how disks, RAID and LVM fit together, with the disk itself at the bottom and the increasingly abstracted layers as you go up toward the top:
| Filesystem Role | / | other partitions | / | other partitions |
|---|---|---|---|---|
| LVM | LVM 1 | LVM 1 | ||
| RAID Level | RAID 1 | RAID 1 | RAID 1 | RAID 1 |
| Partition No. | 1 | 2 | 1 | 2 |
| Disk No. | 1 | 1 | 2 | 2 |
Note - if you're reinstalling over a previous installation that had RAID + LVM:
You'd probably be best deleting the existing partitions. It may be possible to re-use the already setup RAID and LVM but there might be potential for issues; I'm not sure about this, I'm just recommending this for caution as I've not done it.
As well as deleting the partitions and RAID devices in 'Partition disks', you need to remove the RAID using Configure software RAID → Delete MD device → Multidisk device to be deleted: md0_raid1 otherwise it says "No RAID partitions available - No unused partitions of the type "Linux RAID Autodetect" are available. Please create such a partition, or delete an already used multidisk device to free its partitions."
Leave 2% of unused unpartitioned space at the end of each disk so that in the event of failure, if the disk is replaced with another of notionally the same size, because disk sizes tend to differ slightly we can cope if the replacement disk is a little smaller.
Follow these steps to setup this example:
- Setup a 500MB RAID1 array for /
- Prepare space on each disk for RAID array
- /dev/sda → create new empty partition table on this device? yes → pri/log X GB FREE SPACE → Create a new partition → New partition size: 500MB → Primary → Location for the new partition: Beginning → Use as: physical volume for RAID → Bootable flag: on → Done setting up the partition
- /dev/sdb → create new empty partition table on this device? yes → pri/log X GB FREE SPACE → Create a new partition → New partition size: 500MB → Primary → Location for the new partition: Beginning → Use as: physical volume for RAID → Bootable flag: on → Done setting up the partition
- Create RAID1 array: Configure software RAID → Write the changes to the storage devices and configure RAID? yes → Create MD device → RAID1 → Number of active devices for the RAID1 array: 2 → Number of spare devices for the RAID1 array: 0 → Active devices for the RAID1 multidisk device: [*] /dev/sda1 [*] /dev/sdb1 → Continue → Finish
- Setup a filesystem on the (MD device /dev/md0) array: RAID1 device #0 - 501.6MB Software RAID device - #1 501.6MB → Use as: Ext3 journaling file system → Mount point: / → Done setting up the partition
- Setup the rest of the disk space as a RAID1 array + LVM for /usr, /var, /tmp, /home and swap
- Prepare space on each disk for RAID array
- /dev/sda → pri/log X GB FREE SPACE → Create a new partition → New partition size: choose all remaining space apart from 2% which you should leave unused → Primary → Use as: physical volume for RAID - Done setting up this partition
- /dev/sdb → pri/log X GB FREE SPACE → Create a new partition → New partition size: choose all remaining space apart from 2% which you should leave unused → Primary → Use as: physical volume for RAID - Done setting up this partition
- (Around this point, if you're reinstalling over an old RAID + LVM setup, the old LVM will appear and will need to be removed, otherwise when you come to create the second RAID device there will only be one partition available for doing so. The LVM menu option only now appears.
- Configure software RAID → Delete MD device → Multidisk device to be deleted: md1_raid1
- Configure the Logical Volume Manager → Activate...? → Delete logical volume → delete each server_* → Delete volume group → server → Yes → Finish
- Create RAID1 array: Configure software RAID → Write the changes to the storage devices and configure RAID? yes → Create MD device → RAID1 → Number of active devices for the RAID1 array: 2 → Number of spare devices for the RAID1 array: 0 → Active devices for the RAID1 multidisk device: [*] /dev/sda2 [*] /dev/sdb2 → Continue → Finish
- Prepare space on RAID1 array for LVM: RAID1 device #1 - X GB Software RAID device - #1 X GB → Use as: physical volume for LVM → Done setting up the partition
- Create volume group: Configure the Logical Volume Manager - Keep current partition layout and configure LVM? yes → Create volume group → Volume group name: server → Devices for the new volume group: [*] /dev/md1 72GB → Continue →
- Create logical volumes on volume group 'server'
- Create logical volume → server → server_usr → 2GB minimum? 5GB-7GB if WPKG server
- Create logical volume → server → server_var → 3GB
- Create logical volume → server → server_tmp → 500MB
- Create logical volume → server → server_swap → 1GB
- Create logical volume → server → server_home → the rest of the space → Finish
- Define how logical volumes are to be used
- LVM VG server, LV server_usr - X GB Linux device-mapper - #1 X GB → Use as: Ext3 journaling file system → Mount point: /usr → Done setting up the partition
- LVM VG server, LV server_var - 3 GB Linux device-mapper - #1 3 GB → Use as: Ext3 journaling file system → Mount point: /var → Done setting up the partition
- LVM VG server, LV server_tmp - 500 MB Linux device-mapper - #1 500 MB → Use as: Ext3 journaling file system → Mount point: /tmp → Done setting up the partition
- LVM VG server, LV server_swap - 1 GB Linux device-mapper - #1 1 GB → Use as: swap area → Done setting up the partition
- server_home → Use as: Ext3 journaling file system → Mount point: /home → Done setting up the partition → Finish partitioning and write changes to disk
Example 2
This is a similar LVM example, but without RAID, using just 1 physical ATA disk:
- Partition 1 - 500MB → primary → Use as: Ext3 → / → Bootable flag: on
- Partition 2 - all remaining space → primary → Use as: physical volume for LVM
- Configure the Logical Volume Manager → Create volume group → server → /dev/hda2 → 72GB<
- Create logical volumes on volume group server
- Create logical volume → server_usr → 2GB minimum? 5GB-7GB if WPKG server
- Create logical volume → server_var → 3GB
- Create logical volume → server_tmp → 500MB
- Create logical volume → server_swap → 1GB
- Create logical volume → server_home → the rest of the space
- Define how logical volumes are to be used
- server_usr → Use as: Ext3 journaling file system → Mount point: /usr → static data
- server_var → Use as: Ext3 journaling file system → Mount point: /var → variable data
- server_tmp → Use as: Ext3 journaling file system → Mount point: /tmp → temporary files
- server_swap → Use as: swap area
- server_home → Use as: Ext3 journaling file system → Mount point: /home
Usage
Getting Information
Physical Volumes
Display various attributes of physical volume(s):
pvdisplay
Display information about physical volumes (physical volume used, physical volume size used and amount free):
pvs
Volume Groups
Display volume group information:
vgdisplay
Display information about volume groups (including space allocated to volume group and space free):
vgs
Logical Volumes
Display information about a logical volume:
lvdisplay
Display information about logical volumes:
lvs
List all logical volumes in all volume groups:
lvscan
Further Information
Software RAID5 and LVM with the Etch Installer: www.debian-administration.org/articles/512
LVM HOWTO by AJ Lewis tldp.org/HOWTO/LVM-HOWTO/
Wikipedia - Logical Volume Manager (Linux): en.wikipedia.org/wiki/Logical_Volume_Manager_(Linux)
Partitioning RAID / LVM on RAID
MySQL - database server
Package(s)
MySQL - www.mysql.com - "MySQL is a fast, stable and true multi-user, multi-threaded SQL database server. SQL (Structured Query Language) is the most popular database query language in the world. The main goals of MySQL are speed, robustness and ease of use.". [Version: 5.0.32]
Either you want a specific version because the way you use it will be affected by an upgrade in a way that you'll have to plan for. In which case you want the stability of knowing which version you're using and to be able to upgrade at your convenience.
Or, your use of MySQL is restricted to another application you use that uses it, for example the mail server. If that mail server only minimally uses MySQL's abilities and so isn't affected by an upgrade then use mysql-server.
If your server is used for both scenarios you will want to consider this carefully.
However this doesn't necessarily mean you won't get a forced upgrade when upgrading Debian - mysql-server-4.1 in Debian Etch is there to allow a transition to mysql-server-5.0, it actually installs mysql-server-5.0.- mysql-server - this is my preference - in Debian Etch this installs mysql-server-5.0
- mysql-server-5.0
- PHPMyAdmin - database administration. We have it install and use PHP5, the PHP5 MySQL connector and Apache 2.
- phpmyadmin
- libapache2-mod-php5 (AKA PHP5). This installs the Apache prefork MPM (apache2-mpm-prefork) version of the Apache 2 web server (the only version of Apache 2 PHP will work with)
- php5-mysql - provides modules for MySQL database connections directly from PHP scripts
Installation
MySQL will only install if the system already has a non-numeric hostname that is resolvable via the /etc/hosts file. See the Hosts File section for how to set this up.
Configuration
The MySQL configuration file can live in a number of locations:
- /etc/mysql/my.cnf - to set global options
- /var/lib/mysql/my.cnf - to set server-specific options
- ~/.my.cnf - to set user-specific options
Configuration files, accounts and databases:
- /etc/mysql/my.cnf - brought in by mysql-common. Reconfigure using dpkg-reconfigure mysql-common. If you remove my.cnf you can run
aptitude -o DPkg::Options::="--force-confmiss reinstall mysql-common"to bring in a new version even when you've changed or removed yours. - root user password - dpkg-reconfigure mysql-server-5.0
- databases - dpkg-reconfigure mysql-server-5.0 ?
Set a password for the MySQL root user because it defaults to not having one. You can do so in a number of ways.
a) Set the password from the command-line (this will fail if a password has already been set, in which case you need to add -p):
$ mysqladmin --user=root password '<your new password>'$ mysqladmin --user=root --host <hostname> password '<your new password>'
b) Set the password from within MySQL:
- Open mysql:
$ mysql -u root
(this will fail if a password has already been set, in which case you need to add-p) - Set the password for the various incarnations of the user 'root':
mysql> SET PASSWORD FOR 'root'@'localhost'=PASSWORD('<your new password>');mysql> SET PASSWORD FOR 'root'@';<hostname>'=PASSWORD('<your new password>');
a) Set the username and password in a my.cnf configuration file:
- If you use a /root/my.conf (write the 'user' and the 'password' lines in there, never only the password - see /usr/share/doc/mysql-server/README.Debian for more information.
For security, Debian's MySQL defaults to listening only on the localhost (127.0.0.1) network interface for connections, so it will not allow remote connections. This is achieved by setting bind-address 127.0.0.1 in /etc/mysql/my.cnf (The less secure skip-networking used to be used instead). This is fine for a mail server running on the same server, or phpMyAdmin, but not for, say, OpenOffice running on a workstation connecting to MySQL. Setting bind-address to the server's IP address or hostname (i.e. 10.0.0.10 or server) alternatively enables only remote connections to MySQL. To enable connections from any source, local or remote, comment out bind-address entirely.
To reset the MySQL root password if you've lost it:
- mysqld first reads the name of the user it should run as from /etc/mysql/my.cnf before any username you might specify at the command-line. We need to run it as root so you must temporarily change in this file user = mysql to user = root
- Stop the MySQL daemon:
/etc/init.d/mysql stop - Start MySQL without permissions and as the root user:
mysqld --skip-grant-tables - At another terminal, run MySQL:
mysql -u root - Reset the root password for all incarnations of root (replace <your new password> with the password you choose):
mysql> UPDATE mysql.user SET Password=PASSWORD('<your new password>') WHERE User='root'; - Set the MySQL daemon to use permissions again:
mysql> FLUSH PRIVILEGES; - Quit MySQL:
mysql> quit - Edit /etc/mysql/my.cnf and change user = root back to user = mysql
- Restart MySQL:
/etc/init.d/mysql restart
(From http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html)
If you're wanting to use ODBC to connect client computers across a network to the database server, nothing has to be set on the server specifically to enable this ODBC connection.
Usage
The location of database files is usually /var/lib/mysql/your-database-name (use mysqladmin variables | grep datadir to find it otherwise)
To open the mysql program: mysql -u <username> -p. The -p tells it a password is required, which you will be prompted for.
To create a database:
- From the command-line (using the MySQL root account):
# mysqladmin -p create <database> - From within MySQL:
mysql> create database <database>;
To first delete the database if it already exists:
mysql> drop database <database>;
Set privileges on the database (grants the root account all database level access on your database when connecting from any machine, using the defined password and allows them to give other users priviliges. See http://dev.mysql.com/doc/refman/5.0/en/grant.html for reference):
mysql> grant all on yourdatabasename.* to root@'%' identified by '<your password>' with grant option;
See which users have privileges in MySQL:
mysql> use mysql;mysql> select user,host,password from user;
See what databases have what users with privileges to access them:
mysql> use mysql;mysql> select db,user,host from db;
List the privileges granted to the account that you are using to connect to the server:
mysql> show grants;
List the privileges granted to a specific account, for example:
mysql> show grants for 'root'@'localhost';
Remove all priviliges from a specific user:
mysql> revoke all priviligies, grant option from <user>
Delete a specific user:
mysql> drop user <user>
MySQL server (mysqld) administration, using the command-line - these are the main MySQL clients and processes:
mysql- Command line interface to MySQLmysqld- MySQL server daemonmysqld_safe- Server process monitormysqlaccess- Tool for creating MySQL usersmysqladmin- Utility for administering MySQLmysqldump- Tool for dumping the contents of a MySQL databasemysqlshow- List all MySQL database
Further Information
MySQL 5.0 Reference Manual: http://dev.mysql.com/doc/refman/5.0/en/
MySql 4.1.x Database Survival Guide: http://www.akadia.com/services/mysql_survival.html
'MySQL Database Administration' - 'MySQL User Account Management' - 'MySQL Usernames and Passwords'
PostgreSQL - database server
Package(s)
- postgresql-8.1 - the database server [Version: 8.1.11]
- postgresql-doc-8.1 - documentation [Version: 7.5.22]
- postgresql-client-8.1 - client program to connect to the database [Version: 8.1.11]
- phppgadmin - web-based database administration [Version: 4.0.1]
Usage
Program: psql
RAID arrays
The multidisk device (or, after its most famous variant, 'software RAID'). New devices made up of combined traditional disk devices into RAID volumes referred to as /dev/md#. RAID is not a guarantee for data integrity, it just allows you to keep your data if a disk dies (that is, with RAID levels above or equal one, of course).
The host controller may itself provide RAID capability, in which case the hardware RAID will be superior to using Linux software RAID, but only as long as the host controller is of high quality. Linux software RAID is usually superior to the cheap IDE (pseudo hardware), RAID controllers; and also superior to 'fakeraid' controllers such as Adaptec's 'HostRaid'. Note that host-based RAID controllers may support only a sub-set of the various RAID levels. We use Linux software RAID whether or not the server includes true hardware RAID, or fakeraid, so that in the event of server failure disks can be moved to an alternate server that doesn't have to have the same disk controller.
I remove the RAID controller card and instead attach the cable(s) direct from the motherboard-based controller straight to the disks, or to the backplane if there is a backplane installed.
You may find when you configure a RAID array in your host's software at boot time that the Debian installer partitioning section still sees both disks independently. In this case you need a driver for the host controller that isn't available in Debian. For example Adaptec provide a binary-only HostRaid controller driver. Just use Linux software RAID instead.
Package(s)
- mdadm - tool to administer 'Linux md device arrays' (AKA Linux Software RAID). Can be used to create, manage, and monitor MD devices; a replacement for the old raidtools package.
Configuration
We usually use Software RAID 1 (mirroring), or occasionally software RAID 5 (block-level striping with parity data distributed across all member disks). See en.wikipedia.org/wiki/Standard_RAID_levels for a description.
Read this: http://www.tldp.org/HOWTO/Software-RAID-HOWTO.html#toc
GRUB can't boot from an mdadm / software RAID 5 array, so we create a '/' partition that is configured just as a RAID 1 array.
The tool you use to work with RAID arrays is mdadm.
You can use the Debian Installer to setup a RAID array, rather than doing so manually:
- 1) Choose your partitioning scheme for each disk. If guided partitioning, then apply similarly to each hard disk
- 2) Individually select each partition (not disk) and select 'Use as:' → 'physical volume for RAID' (including for the swap partition) either when you create them manually, or after the guided partitioning
- 3) Configure software RAID
- 4) Create MD device (this is 1 of a number of MD devices you may create)
- 5) Choose 'RAID1' or 'RAID5'
- 6) Set the 'Number of active devices for the RAID# array:'
- 7) Set the 'Number of spare devices for the RAID# array:'
- 8) Set the 'Active devices for the RAID# multidisk device' i.e.:
- [] /dev/ide/host0/bus0/target0/lun0/part1
- [] /dev/ide/host0/bus1/target0/lun0/part1
- Repeat steps 4 through to 8 until done. Then continue as usual.
You can run mdadm as a daemon by using the follow-monitor mode. If needed, that will make mdadm send email alerts to the system administrator when arrays encounter errors or fail. Also, follow mode can be used to trigger contingency commands if a disk fails, like giving a second chance to a failed disk by removing and reinserting it, so a non-fatal failure could be automatically solved. For example mdadm --monitor --mail=root@localhost --delay=1800 /dev/md2.
The MD driver is compiled into the kernel rather than compiled as a module.
Configuration files
/etc/mdadm/mdadm.conf - see man mdadm.conf
Usage
cat /proc/mdstat
Get brief details of a RAID device:
mdadm --query <RAID device>
Get full details of a RAID device:
mdadm --detail <RAID device>
Add a new disk partition to an existing RAID device:
mdadm --add <existing RAID device> <new disk partition i.e. /dev/sdb3>
Use a new disk partition that has been added to an existing RAID device:
mdadm --grow --raid-devices=<total number of RAID devices in this array now> <existing RAID device>
You then have to manually increment the total number of RAID devices in this array in mdadm.conf
Further Information
man mdadm
Partitioning RAID / LVM on RAID
Software RAID5 and LVM with the Etch Installer
Serial ATA (SATA) chipsets — Linux support status: http://linuxmafia.com/faq/Hardware/sata.html
Recovering a RAID disk back into a RAID device /dev/md*: http://www.kieser.net/linux/raidhotadd.html
Installing Debian with SATA based RAID: http://wiki.xtronics.com/index.php/Raid
Growing - adding partitions, expanding existing partitions: linux-raid.osdl.org/index.php/Growing
Probably too out of date, but seemed useful: http://www.james.rcpt.to/programs/debian/raid1/
Samba - Windows file and print server
Package(s)
- samba
- samba-doc - documentation
- smbclient - required for cupsaddsmb; useful for troubleshooting
Creating a Primary Domain Controller
See our separate document Setting up a Samba primary domain controller and file/print/software deployment server using Samba 3 on Debian 4.0 Etch.
Simple Samba File Sharing
Use this /etc/samba/smb.conf configuration file:
# Samba 3.0.x configuration file for simple password-less file sharing. # (if we set security=no would this work with Windows 95, 98 and Me clients?) [global] # The server's name on the Windows network netbios name = server # The workgroup name. Make this the same on all participating computers workgroup = workgroup # Combined with 'guest account' this doesn't require a username/password # to connect security = share # Makes this the WINS server for the network. # Required for computers to browse for the share wins support = yes # Defines which Unix account will be used when the share is used guest account = nobody # Try to make sure this machine is the local master browser so that what # it says, goes, amongst it and the other computers on the (WINS) network os level = 34 preferred master = yes [shared] guest only = yes guest ok = yes # The directory that will be shared path = /home/samba/shared # It is visible when people are browsing the network browseable = yes read only = no # New files are created with this permission # Requires a corresponding Unix setting force create mode = 0666 # New directories are created with this permission # Requires a corresponding Unix setting on the directory force directory mode = 2770
Create the shared directory:
mkdir /home/samba && mkdir /home/samba/shared
Give it liberal permissions:
chmod 666 /home/samba/shared
Creating shares that can be mounted from a GNU/Linux workstation
This share can be mounted by root but files take the permission of whomever creates them.
This is what to do on the server, for what to do on the workstation see Desktop System Setup with Debian 4.0 'Etch'.
- You should at least add the following to /etc/samba/smb.conf:
Security = user [shared] writable = yes path = /home/organisation/shared public = yes browseable = yes force create mode = 0666 force directory mode = 2770 - Enable root to connect in /etc/samba/smb.conf (Debian defaults to root being an invalid user)
- Create a group for everyone, a useful name is the organisation name
- Create UNIX accounts for everyone who wants to use the server, the same as those used on workstations
- Create corresponding Samba accounts for everyone who wants to use the server, using the same passwords as the UNIX accounts,
including root, using
smbpasswd -a username - Make the users members of the group
- Create a directory for the group, i.e. /home/organisation
- Create a shared directory for the group in that directory, i.e. /home/organisation/shared
- Set permissions for that shared directory:
chmod 2770 /home/organisation/shared
(do we also need to set similarly for the directory itself?) - Set the group of that shared directory to the same group:
chgrp group /home/organisation/shared
Upgrading from the previous Debian stable version
Samba 3.0.14a → 3.0.23d
RCS - added to 'passwd chat': '...password created succesfully...'
Release notes for all versions up to 3.0.23d:
http://www.samba.org/samba/history/samba-3.0.23d.html
3.0.23c
RID Algorithms & Passdb
=======================
Starting with the 3.0.23c release, the officially supported passdb
backends (smbpasswd, tdbsam, and ldapsam) now operate identically
with regards to the historical RID algorithm for unmapped users
and groups (i.e. accounts not in the passdb or group mapping table).
The resulting behavior is that all unmapped users are resolved
to a SID in the S-1-22-1 domain and all unmapped groups resolve
to a SID in the S-1-22-2 domain. Previously, when using the
smbpasswd passdb, such users and groups would resolve to an
algorithmic SID in the machine's own domain (S-1-5-XX-XX-XX).
However, the smbpasswd backend still utilizes the RID algorithm
when creating new user accounts or allocating a RID for a new
group mapping entry.
With the changes in the 3.0.23c release, it is now possible to
resolve a uid/gid, name, or SID in any direction and always obtain
a symmetric mapping. This is important so that values for smb.conf
parameters such as "valid users" resolve to the same SIDs as those
included in the local user's initial token.
Most installations will notice no change. However, because
an unmapped account's SID will now change even when using
smbpasswd it is possible that any security descriptors on files
previously copied from a Samba host to a Windows NTFS partition
may now fail to give access. The workaround is to either manually
map all affect groups (or add impacted users to the server's
passdb) or to manually reset the file's ACL.
3.0.23b
Member servers, domain accounts, and smb.conf
=============================================
Since Samba 3.0.8, it has been recommended that all domain accounts
listed in smb.conf on a member server be fully qualified with the
domain name. This is now a requirement. All unqualified names are
assumed to be local to the Unix host, either as part of the server's
local passdb or in the local system list of accounts (e.g. /etc/passwd
or /etc/group).
The reason for this change is that smbd has transitioned from
access checks based on string comparisons to token based
authorization. All names are resolved to a SID and then verified
against the logged on user's NT user token. Local names will
resolve to a local SID, while qualified domain names will resolve
to the appropriate domain SID.
If the member server is not running winbindd at all, domain
accounts will be implicitly mapped to local accounts and their
tokens will be modified appropriately to reflect the local
SID and group membership.
For example, the following share will restrict access to the
domain group "Linux Admins" and the local group srvadmin.
[restricted]
path = /data
valid users = +"DOMAIN\Linux Admins" +srvadmin
Note that to restrict the [homes] share on a member server to the
owner of that directory, it is necessary to prefix the %S value
to "valid users".
[global]
security = {domain,ads}
workgroup = DOM
winbind separator = +
[homes]
valid users = DOM+%S
3.0.23
* Improved support for local and BUILTIN groups.
* User and Group changes -
The user and group internal management routines have been
rewritten to prevent overlaps of assigned Relative Identifiers
(RIDs). In the past the has been a potential problem when either
manually mapping Unix groups with the 'net groupmap' command or
when migrating a Windows domain to a Samba domain using 'net rpc
vampire'.
Unmapped users are now assigned a SID in the S-1-22-1 domain and
unmapped groups are assigned a SID in the S-1-22-2 domain.
Previously they were assign a RID within the SAM on the Samba
server. For a DC this would have been under the authority of the
domain SID where as on a member server or standalone host, this
would have been under the authority of the local SAM (hint: net
getlocalsid).
The result is that any unmapped users or groups on an upgraded
Samba domain controller may be assigned a new SID. Because the
SID rather than a name is stored in Windows security descriptors,
this can cause a user to no longer have access to a resource for
example if a file was copied from a Samba file server to a local
NTFS partition. Any files stored on the Samba server itself will
continue to be accessible because Unix stores the Unix gid and not
the SID for authorization checks.
A further example will help illustrate the change. Assume that a
group named 'developers' exists with a Unix gid of 782 but this
user does not exist in Samba's group mapping table. it would be
perfectly normal for this group to be appear in an ACL editor.
Prior to 3.0.23, the group SID might appear as
S-1-5-21-647511796-4126122067-3123570092-2565. With 3.0.23, the
group SID would be reported as S-1-22-2-782. Any security
descriptors associated with files stored on an NTFS disk partition
would not allow access based on the group permissions if the user
was not a member of the
S-1-5-21-647511796-4126122067-3123570092-2565 group. Because this
group SID not reported in a user's token is S-1-22-2-782, Windows
would fail the authorization check even though both SIDs in some
respect referred to the same Unix group.
The current workaround is to create a manual domain group mapping
entry for the group 'developers' to point at the
S-1-5-21-647511796-4126122067-3123570092-2565 SID.
* Group Mapping Changes - The default mapping entries for groups such as
"Domain Admins" are
no longer created when using an smbpasswd file or a tdbsam passdb
backend. This means that it is necessary to use 'net groupmap
add' rather than 'net groupmap modify' to set these entries.
Parameter Name Action
-------------- ------
dos filemode Modified No
acl group control Deprecated No
* Deprecate 'acl group control' and replace it with added
functionality to 'dos filemode'.
'dos filemode' notes:
make sure your filesystem is mounted with user_xattr:
dev/hda5 / ext3,acl,user_xattr defaults 1 1
Offline files fails
If you have a file share with multiple users using it regularly, and one of the users tries to synchronize the files using Windows' "Offline Files" feature, you might find that random files fail. The user will have read/write access through their group, but the file will be owned by someone else.
Why this is happening
From Jeremy Allison, Samba developer: "Windows does a sync by creating a new file with a temporary name, then sets an ACL on it that matches the current one (but seems to add write access for the current user, not just the owner). This must succeed else the sync will fail. Then it sets the DOS attributes, again this must succeed or the sync will fail. Under POSIX we encode the attributes in the file permissions and these can only be changed by the owner, unless the "dos filemode" parameter is set."
How to fix it
Upgrade to at least Samba 3.0.0. Ensure that smbd is compiled with ACL support (the Debian packages work fine out of the box), and running on a filesystem with POSIX AccessControlLists. Then you also need to set the parameter "dos filemode = yes" for the share. You don't need the acl package installed, but you probably need libacl.
3.0.21
? iprint server New
map read only New
rename user script New
for Suse: rename user script = /usr/sbin/usermod -l '%unew' '%uold'
3.0.20
acl check permissions New
acl map full control New
printer admin Deprecated
* Deprecate the "printer admin" parameter in favor of the
SePrintOperatorPrivilege.
WE EXTENSIVELY USE printer admin BUT WE DO ALREADY USE SePrintOperatorPrivilege. Perhaps we could remove all 'printer admin' from our existing smb.conf.
Mail server
If you only want your system to be able to have the ability to send out mail, for example to email you logs, then see Mail Transfer.
We recommend Christoph Haas's 'Howto: ISP-style Email Server with Debian-Etch and Postfix 2.3', at http://workaround.org/articles/ispmail-etch/. This solution provides POP3/IMAP access and webmail access to multiple domains, virus scanning, spam prevention, secure mail relay access for road-warriors and easy domain administration. It accomplishes this using Postfix SMTP, MySQL database, Dovecot POP3/IMAP, amavisd-new, SpamAssassin and Clam AntiVirus.
In addition to that tutorial, if your server isn't required to receive its own email directly and/or send it directly you can use Fetchmail to collect from a POP3 host (see the Fetchmail section) and add a relay host to Postfix that will deliver mail on your behalf.
Twix doesn't yet setup this version of the mail server for you.
Packages
- mysql-server - see our mySQL section
- phpMyAdmin
- phpmyadmin
- libapache2-mod-php5
- php5-mysql
- postfix-mysql - www.postfix.org. [Version: 2.3.6]
- dovecot-pop3d - www.dovecot.org. [Version: 1.0.rc15]
- dovecot-imapd - www.dovecot.org. [Version: 1.0.rc15]
- amavisd-new - www.ijs.si/software/amavisd/. [Version: 2.4.2]
- spamassassin - spamassassin.apache.org. [Version(s): 3.1.7 (Etch), 3.2.3 (etch/volatile)]
- clamav-daemon - www.clamav.net. [Version(s): 0.88.7 (Etch), 0.92.1 (etch/volatile)
- unarchivers
- arj
- cabextract
- lha [non-free - open source, has some restrictions and some vaguely worded terms; read the licence]
- lzop
- nomarch
- pax
- unrar [non-free - freeware, open source, restricts you to not using the source to create a rar archiver; read the licence]
- zoo
- Additional unarchivers I choose:
- tnef
- openssl - www.openssl.org. [Version: 0.9.8c]
- squirrelmail - www.squirrelmail.org. [Version: 1.4.9a]
- ? imapproxy - "since SquirrelMail is a web application, it needs to reconnect to the IMAP server on each page load. On heavily loaded sites, this can be a problem; use the excellent imapproxy package to cache connections between page requests and reduce the load on your IMAP server".
- telnet
- mutt - www.mutt.org
Installation
Questions and recommended answers for package installation:
- Postfix: type of configuration: Internet Site (the default)
- Postfix: Mail name: server.localdomain (or whatever your server and domain are called, this should default to this FQDN if you've already set it in /etc/hostname)
Configuration
Configuration Choices Or Clarifications I Make Where The workaround.org Howto Gives Choices
In 'Step 9: Authenticated SMTP', I use a Postfix 'mynetworks' setting of 10.0.0.0/24:
postconf -e mynetworks=10.0.0.0/24
In 'Step 10: AMaViS: Filtering spam and viruses', these are set in /etc/amavis/conf.d/20-debian_defaults:
- $sa_tag_level_deflt = undef;
- $final_spam_destiny = D_PASS;
I don't follow 'Step 11: Learning spam and ham'.
In 'Step 12: Populate and administer the users in the database' I use 'Peter Gutwein's PHP administration frontend' (called 'GR Soft Virtual Mail Manager') rather than 'Ronny Tiebel's PHP administration frontend'.
Installing GR Soft Virtual Mail Manager
- Create a database account (one with privileges to write, rather than just read as the workaround.org guide deals with)
mysql -pgrant ALTER, CREATE, DELETE, INDEX, INSERT, SELECT, UPDATE on mailserver.* to mailadmin@'%' identified by '<password>';quitmkdir /srv/mailmanagercd /srv/mailmanager/wget http://www.grs-service.ch/pub/grs_mailmgr_v<version>.tgztar -xzf grs_mailmgr_v<version>.tgzln -s /srv/mailmanager/ /var/www/mailmanagerchown www-data.www-data /srv/mailmanager/* -R- Go to http://server/mailmanager/install.php and follow the wizard, entering the following details:
- Database host: localhost
- Database name: mailserver
- Database username (with right to create tables): mailadmin - this is described a little further on
- Database password:
- MailMaster email address: mailadmin@<yourdomain> - this is the admin for the whole mail server. You can create separate admins for each separate domain
- MailMaster password:
- Continue though the setup wizard
- Make a note of the MailMaster account you setup and any users you specify as DomainMaster
rm /srv/mailmanager/install.php /srv/mailmanager/conf/cnf_main_template.phprm -rf /srv/mailmanager/install- ? "Please check the rights for the other files to fit your needs."
- So that it can be accessed from a saner URL:
cp -a /srv/mailmanager/login.php /srv/mailmanager/index.php - To be able to forward mail to outside domains in version 1.7 series, in 'function fqdn_check($fqdn)' in /srv/mailmanager/mgr_main.php, replace 'return (preg_match("/^([a-zA-Z0-9-]{3,}+\.)+([a-zA-Z]{2,3})$/", $fqdn, $regs));' with 'return (preg_match("/^([a-zA-Z0-9-]{3,}+\.)+([a-zA-Z.]{2,10})$/", $fqdn, $regs));' (the bit that is replaced is '[a-zA-Z]{2,3}' with '[a-zA-Z.]{2,10}')
- The web interface is available at http://server/mailmanager/
If you get part way through and need to run the installation again from the start, clear your browser's cookies, otherwise the program remembers which install step you've gone through and has no option to go back.
Upgrading GR Soft Virtual Mail Manager
mkdir /srv/mailmanager/<old version number>mv /srv/mailmanager/* /srv/mailmanager/<old version number>/mkdir /srv/mailmanager/<new version number>wget http://www.grs-service.ch/pub/grs_mailmgr_v<version>.tgz /srv/mailmanager/<new version number>/tar -xzf /srv/mailmanager/<new version number>/grs_mailmgr_v<version>.tgzcp -r /srv/mailmanager/<new version number>/* /srv/mailmanager/cp -r /srv/mailmanager/<old version number>/conf/cnf_main.php /srv/mailmanager/conf/chown www-data.www-data /srv/mailmanager/* -Rcp -a /srv/mailmanager/login.php /srv/mailmanager/index.php- In 'function fqdn_check($fqdn)' in /srv/mailmanager/mgr_main.php, replace 'return (preg_match("/^([a-zA-Z0-9-]{3,}+\.)+([a-zA-Z]{2,3})$/", $fqdn, $regs));' with 'return (preg_match("/^([a-zA-Z0-9-]{3,}+\.)+([a-zA-Z.]{2,10})$/", $fqdn, $regs));'
These are the parts of the 'Optional features' section that I use:
- 'Offering webmail access'
- 'Sieve: Filtering out spam'
- 'Removing old deleted mails'
- Edit root's crontab:
crontab -u root -e - Add this, scheduling deletion daily at 01:00:
00 1 * * * find /home/vmail/ -name '*,ST' -ctime +7 | xargs rm -f
Optional Configuration Additional To what Is Described In The Howto
Postfix
To add a relay host that will deliver mail on your behalf
postconf -e relayhost=[<your ISP's SMTP server>]
"The form enclosed with [ ] eliminates DNS MX lookups. Don't worry if you don't know what that means. Just be sure to specify the [] around the mailhub hostname that your ISP gave to you, otherwise mail may be mis-delivered."
To Use authenticated SMTP with a relayhost
- Create /etc/postfix/sasl_passwd
- Install package libsasl2-modules - a SASL plug-in that the Postfix SMTP client will use for authentication (without this you get postfix/smtp errors warning: SASL authentication failure: No worthy mechs found and SASL authentication failed; cannot authenticate to server mail.exampledomain.co.uk[x.x.x.x]: no mechanism available)
- In /etc/postfix/sasl_passwd add relayhost and your authentication credentials:
<relayhost> <username>:<password> - Create a new file with a hash of the password contained in /etc/postfix/sasl_passwd:
# postmap hash:/etc/postfix/sasl_passwd - Add Postfix configuration to use all this (goes into /etc/postfix/main.cf)
# postconf -e smtp_sasl_auth_enable=yes
# postconf -e smtp_sasl_password_maps=hash:/etc/postfix/sasl_passwd
# postconf -e smtp_sasl_security_options=noanonymous
To Change Maximum Email Size That Can Be Sent
Postfix defaults to not accepting mail larger than 10MB. This limit is for good reason so you should not increase it but if you do want to, hopefully temporarily, you override it with the message_size_limit parameter in /etc/postfix/main.cf using:
postconf -e message_size_limit=<new value in kilobytes>
Squirrelmail
Configure the Squirrelmail Apache configuration, /etc/squirrelmail/apache.conf, to enable the specific address http://mail.server to load Squirrelmail (change the name if you call your server something else)
#When accessed from anywhere on port 80 at mail.server, respond with Squirrelmail: #This also requires a DNS entry for mail.server <VirtualHost *:80> DocumentRoot /usr/share/squirrelmail ServerName mail.server </VirtualHost>
For mail.server to work you also need to register it with your DNS server:
Host IP address: 10.0.0.10
Hostname: mail
Domain name: server
Make use of the IMAP server's IMAP SORT feature to improve performance when there's lots of email in a folder and fixes the issue with a large inbox where the server tries to download to you right_main.php rather than display the inbox (From 'Optimizing SquirrelMail - IMAP server extensions' - www.squirrelmail.org/docs/admin/admin-6.html#ss6.3).
Use either method:
# squirrelmail-configure→ 4. General Options → 11. Allow server-side sorting: true- In config/config.php set $allow_server_sort = true;
Abuse and Postmaster
Create abuse@<your domain name> and postmaster@<your domain name> mailboxes for each domain. There's some kind of legal requirement to create an abuse mailbox for people to contact you to report spam; similarly postmaster is used to contact the mail administrator and for delivery problem reports to go to. Create proper accounts so any user can add them to their mail client, and they won't get their spam into their main mailbox. You can additionally create forwardings if you want to send mail for these addresses elsewhere.
Set the postmaster address in /etc/dovecot/dovecot.conf → protocol lda → postmaster_address = postmaster@<your domain name>
GR Soft Virtual Mail Manager Mailmaster Accounts
In the mailserver.domain_admins table any user with domain_id = 0 is a mailmaster. Additional mailmasters can be created by adding a new record with a domain_id field of '0' and a user_id field the same as the 'id' field of the user you want to be mailmaster in the mailserver.virtual_users table.
Usage
Query Postfix's configuration:
- Display all parameter settings:
postconf - Display parameter settings that are not left at their built-in default value, because they are explicitly specified in main.cf:
postconf -n - Display a particular Postfix parameter settings:
postconf -d <parameter>
Mail Queue
postqueue - Postfix queue control - for unprivileged queue operations such as listing or flushing the mail queue. For example postqueue -p or postqueue -pvvv.
postsuper - Postfix superintendent - for queue operations that require super-user privileges such as deleting a message from the queue or changing the status of a message. Use of the command is restricted to the superuser.
Delete a single message from the queue (applies to hold, incoming, active and deferred queues):
postsuper -d <queue ID>
Remove all messages from a particular queue (where queue can be hold, incoming, active or deferred):
postsuper -d ALL <queue>
Troubleshooting
Look in the logs, see Logs section.
Show open ports and whether they listen on just localhost or for remote connections. If you see tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 29945/mysqld
it means the server is only listening locally:
netstat -l -t -p
Check open ports:
- Use netstat to verify that postfix is listening:
netstat -nap | grep 25 nmap localhostnetstat -tap
Check 'master' is running.
Flush the queue - attempt to deliver all queued mail (warning: flushing undeliverable mail frequently will result in poor delivery performance of all other mail):
postqueue -f
This can similarly be achieved using:
postfix flush
List contents of the mail queue (add -v to be more verbose, add multiple -v's for increased verbosity):
mailq or postqueue -p
Schedule immediate delivery of all mail that is queued:
mailq -q
Schedule immediate delivery of all mail that is queued for the named site. This option accepts only site names that are eligible for the "fast flush" service, and is implemented by executing the postqueue(1) command. See flush(8) for more information about "fast flush":
mailq -qRsite
Amavis:
/etc/init.d/amavis stop
/etc/init.d/amavis debug
Logs
Mail in general (what the mail server suite is doing, mail by mail)
- /var/log/syslog
- /var/log/mail.log
- /home/vmail/dovecot-deliver.log
Fetchmail: /var/log/syslog
amavisd-new: /var/log/amavis.log - lists its capabilities (which is also saved to syslog) and mail that it's dealt with. Note that logging to this file is off by default (do you turn it on with $LOGFILE?). You can alter the verbosity of Amavis's logging using, for example, $log_level = 2 in /etc/amavis/conf.d/50-user.
Clam: /var/log/clam/clam.log
Freshclam: /var/log/clam/freshclam.log
If you're sending email to the server to test it, whilst looking at a log file, it can be useful to email an address like xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@<domain> to make it easy to spot.
Further Information
Man pages for Postfix daemon processes you'll see mentioned in syslog: cleanup, local, master, qmgr, smtp, smtpd, virtual.
You can learn a lot by reading through the archives of the postfix-users mailing list: www.postfix.org/lists.html
Dovecot configuration file: http://wiki.dovecot.org/MainConfig
Moving the mail server to another machine
Filesystem - you can copy the whole /home/vmail directory to another server. All files in this directory structure need to be owned by vmail.vmail which makes it easy to copy it around.
Database - backup the database 'mailserver' using mysqldump or phpMyAdmin.
Upgrading from the Previous Debian Stable Version
The workaround.org guide for Etch has a 'Migrating from the Sarge Tutorial' that gives an overview of the changes.
- Remove courier-authdaemon, courier-authmysql, courier-pop, courier-pop-ssl, courier-imap, courier-imap-ssl, libsasl2, libsasl2-modules and libsasl2-modules-sql:
aptitude remove courier-authdaemon courier-authmysql courier-pop courier-pop-ssl courier-imap courier-imap-ssl libsasl2 libsasl2-modules libsasl2-modules-sql - Install dovecot-pop3d and dovecot-imapd (POP/IMAP by Courier and SASL by auxprop are both now done by Dovecot):
aptitude install dovecot-pop3d dovecot-imapd - Remove postfix-tls because postfix now includes tls
- Remove clamav (just use clamav-daemon now)
- Add libclass-dbi-mysql-perl
- Add libapache2-mod-php5 and php5-mysql (explicit dependencies for phpmyadmin)
- Add archival software
- add telnet and mutt (useful troubleshooting tools)
- ? Configuration differences and additions - follow the workaround.org guide
- Database schema changes - install python-sqlalchemy and python-mysqldb; download and run dbconvert.py - see 'Step 12: Populate and administer the users in the database' in the workaround.org guide for Etch
- If you use Fetchmail then stop it:
/etc/init.d/fetchmail stop. - Stop Dovecot:
/etc/init.d/dovecot stop. - In /etc/dovecot/dovecot.conf, "mail_location = maildir:/home/vmail/%d/%n/Maildir ... Note - Previous versions of this tutorial recommended to use mail_location = maildir:/home/vmail/%d/%n instead (without the trailing Maildir part). It is now recommended you add the extra directory ... So if you have an existing directory structure you have to create a Maildir folder right there and move all mail folders (cur, new, tmp and all folders starting with a dot) there.".
- I used filezilla and chown but you could write a script to do this for each mailbox, or do it by hand:
cd /home/vmail/<domain name>/<mailbox name>
mkdir Maildir
mv .[!.]* Maildir/
mv cur Maildir/
mv new Maildir/
mv tmp Maildir/
chown vmail.vmail Maildir
chmod g-rwx,o-rwx Maildir - "Please note that when switching from Courier to Dovecot your users will not automatically be subscribed to their IMAP folders any more. But fortunately Courier's 'courierimapsubscribed' file is compatible with Dovecot's 'subscriptions' file, but you need to remove the "INBOX." prefixes from the mailboxes. These files are located in the virtual mailbox directories"
cp courierimapsubscribed Maildir/subscriptions && perl -pi~ -e 's/INBOX.//g' Maildir/subscriptions(there'll be no courierimapsubscribed if the mailbox hasn't been used)
- If you use Fetchmail then start it:
/etc/init.d/fetchmail start. - Start Dovecot:
/etc/init.d/dovecot start. - "If users start to complain that they cannot fetch their emails consider setting:
disable_plaintext_auth = no ". I set this so that Thunderbird doesn't need changing, and because other apps that send their own mail may not be able to do authenticated SMTP. - Is userdb section an addition or replacement setting?
- ISSUE:
Jan 11 19:53:29 localhost postfix/smtpd[10169]: NOQUEUE: reject: RCPT from localhost.localdomain[127.0.0.1]: 554 5.7.1 <external email address>: Relay access denied; from=<internal email address> to=<external email address> proto=SMTP
SOLUTION: fixed withpostconf -e mynetworks=127.0.0.0/24,192.168.50.0/24 - ISSUE: Some mail goes out whilst others are stuck:
Jan 11 17:20:20 localhost postfix/qmgr[3296]: warning: connect to transport amavis: Connection refused .
SOLUTION: It's mail left over from before the upgrade, trying to send to an amavis that no longer exists. Notice the process number stays the same, look back in the log files to see when it first began life. Or: "you called the amavisd-new service amavis and then renamed it to smtp-amavis, and now you have old messages in the queue that still attempt to connect to the old service. Requeue the messages withpostsuper -r ALL ."
Major Changes in Programs Since the Previous Debian Stable Version
PostFix 2.1.5 → 2.3.7 (since upgraded to 2.3.8)
- Postfix Address Rewriting
- Generic mapping for outgoing SMTP mail
- Postfix before-queue Milter support
- bounce - Postfix bounce message template format
- Postfix TLS Support
- Postfix SASL Howto
- Postfix DSN Support
amavisd-new 20030616p10-5 → 2.4.2-5
Added 'check-jpeg' example entry to the @av_scanners list and provide the associated module JpegTester.pm; it offers a fully-fledged check for jpeg comment field buffer overflow attempts; should serve mainly as an example for adding similar quick responses to new threats;
Additional archive extractors that can now be used if available
cabextract - suggested by amavisd-new?
pax - can handle tar/cpio/pax archives (including legacy format variants). Due to limitations in cpio (and in Archive::Tar), for security reasons it is preferred to decode such archives with pax and no longer with cpio; please add a line: $pax = 'pax'; to amavisd.conf and verify that the program pax is installed on the system. pax is available in Debian. This is not a suggests of the package. Should I file a bug to get this added as a suggests for amavisd-new?
tnef - support for decoding TNEF (Microsoft Outlook, winmail.dat) containers by 'tnef'; selectable by an entry in the @decoders list. Debian includes tnef and ytnef. This is not a suggests of the package. Should I file a bug to get this added as a suggests for amavisd-new?
zoo/unzoo - zoo decoder interface routine (do_zoo) can now use utility unzoo(1) or the traditional zoo(1); the unzoo(1) recognizes some additional parameters which makes it more resilient (but still not watertight) against some attempts to hide archive contents or to extract members to unexpected locations, but unfortunately does not recognize all zoo compression schemes ("error, LZD not yet implemented"), and the relative modes "-j ./" or "-j X" do not protect against all malicious cases - so it is a mixed blessing. The way amavisd calls zoo(1) (piping members to stdout, which can be slow) avoids some of the security problems with zoo (writing to arbitrary directories), which were probably the main reason for ClamAV project deciding to switch to unzoo(1);
zoo/unzoo - zoo sucks, unzoo (v4.4) sucks more: considered, but decided against changing zoo entry in @decoders to ['unzoo','zoo'] in amavisd.conf, as was suggested by Gbor Kvesdn. It would not necessarily be an improvement (see previous item, misses extracting members from my test cases), so feel free to choose between the two poor choices, I still prefer zoo(1), partly also because it covers cases which clamd decoding misses;
arj - The non-free unarj has been replaced by the free arj
ripole - ripOLE decoder, which attempts to extract embedded documents from MS OLE documents (MS Office) (http://www.pldaniels.com/ripole/); ripOLE is still experimental/alpha code; To make amavisd-new find the installed program 'ripole', add the: $ripole = 'ripole'; to the amavisd.conf. Not available in Debian but perhaps it can be installed manually?
unfreeze / freeze / melt. freeze - ftp://ftp.warwick.ac.uk/pub/compression/. Not in Debian.
Miscellaneous
* NEWS.Debian: call attention to the left-over quarantine file (caused by the #350917 fix described above) * Make $mydomain normal variable. Still need long term solution, as this variable is referenced by other variables which will be wrong. Check during startup that $myhostname is a fully qualified domain name (or 'localhost', if you must), and abort if it isn't, otherwise a non-FQDN can end up in places where RFC 2822 does not allow it; if uname(3) does not provide a FQDN, then an assignment to $myhostname must be done explicitly in amavisd.conf;
Configuration changes
The new configuration system uses split files in /usr/share/amavis/conf.d and /etc/amavis/conf.d, which are read in priority order. First from /usr/share/amavis/conf.d, then /etc/amavis/conf.d. The ones in /usr/share are Debian/upstream land. You can override anything in them placing files in /etc/amavis/conf.d or editing the ones already in /etc/amavis/conf.d. It is suggested that all user changes be done to 50-user, overriding whatever Debian options you don't like. WARNING: you will have to upgrade your configuration manually Configuration is split into two directories, and processed in the order below: Read-only configuration: /usr/share/amavis/conf.d/ 10-debian_scripts: Stuff you'd better not override 20-package: Packaging decisions, override at will Read-write conffiles: /etc/amavis/conf.d/ 01-debian: Rarely modified settings 05-domain_id: mydomain autodetection, local_domains config 05-node_id: myhostname autodetection 15-av_scanners: AV scanner interface configuration 15-content_filter_mode: Use this to re-enable spamassassin/av checks 20-debian_defaults: Commonly modified settings 50-user: Place your overrides here, if you want - debian package upgrades won't override them If the package detects legacy config files, it renames them adding a ".disabled" extension, and the amavisd-new initscript will refuse to start the service until these files with a ".disabled" extension are removed or renamed. The legacy config files are /etc/amavis.conf and /etc/amavis/amavis.conf. Antivirus and spam-checking. If you use clamav-daemon, make sure that it is configured to init supplementary groups when it drops priviledges, and that you add the clamav user to the amavis group: add AllowSupplementaryGroups to /etc/clamav/clamd.conf if it is not there yet, and run "adduser clamav amavis" as root. If you use spamassassin with the Bayes database system, you should make sure that the spamassassin configuration option "bayes_auto_expire 0" is set in spamassassin configure files. This disables the automatic expiration of tokens which causes problems for amavisd-new when activated. The amavisd-new package includes cron jobs that take care of syncing and expiring the token database frequently.
- Where previously we changed $mydomain = 'example.com'; to $mydomain = 'localhost'; It looks as though now it auto detects the correct mail domain using /etc/mailname so do we stick with this or still change it to localhost?
- Antivirus checking is not enabled by default. Where previously we left commented out '#@bypass_virus_checks_acl = qw( . );' we now re-enable anti-virus by uncommenting the following in /etc/amavis/conf.d/15-content_filter_mode: #@bypass_virus_checks_maps = ( # \%bypass_virus_checks, \@bypass_virus_checks_acl, \$bypass_virus_checks_re);
- Spam checking is not enabled by default. Where previously we left commented out '@bypass_spam_checks_acl = qw( . );' we now re-enable anti-spam by uncommenting the following in /etc/amavis/conf.d/15-content_filter_mode: #@bypass_spam_checks_maps = ( # \%bypass_spam_checks, \@bypass_spam_checks_acl, \$bypass_spam_checks_re);
(?doesn't this say the opposite of what we have above?) because of the reorganization of lookup tables, a new way of quickly disabling virus or spam checks in amavisd.conf is used. Instead of: # @bypass_virus_checks_acl= qw( . ); # uncomment to DISABLE anti-virus code # @bypass_spam_checks_acl = qw( . ); # uncomment to DISABLE anti-spam code the new recipe is: # @bypass_virus_checks_maps = (1); # uncomment to DISABLE anti-virus code # @bypass_spam_checks_maps = (1); # uncomment to DISABLE anti-spam code- Where previously we left '$final_virus_destiny = D_DISCARD;' as it was, we now do the same because of the setting in 20-debian_defaults
- Where previously we changed '$final_banned_destiny = D_BOUNCE;' to '$final_banned_destiny = D_REJECT;' we now do the same but in the file 50-user
- TO DO: WE PROBABLY WANT TO ENABLE SOME FILE TYPES INSTEAD, SUCH AS .DOC
- Where previously we changed '$sa_tag_level_deflt = 4.0;' to '$sa_tag_level_deflt = -1000;' it's now set to 2.0 in 20-debian_defaults so do we override it in 50-user?
- Where previously we changed '$sa_tag2_level_deflt = 6.3;' to '$sa_tag2_level_deflt = 5.0;' it's now set to 6.31 in 20-debian_defaults so do we override it in 50-user?
- Where previously we changed '$sa_kill_level_deflt = $sa_tag2_level_deflt;' to '$sa_kill_level_deflt = 10;' it's now set to 6.31 in 20-debian_defaults so do we override it in 50-user?
- Where previously we left the @av_scanners list as it was, we now do the same, but is this the correct way to treat it?
spamassassin 3.0.3-2sarge1 → 3.1.7-2
From Note for Users Upgrading to SpamAssassin 3.1.0 and Release notes for versions 3.1.0, 3.1.1, 3.1.2, 3.1.5.
A significant amount of core functionality has been moved into plugins. These include, AWL (auto-whitelist), DCC, Pyzor, Razor2, SpamCop reporting and TextCat. For information on configuring these plugins please refer to their individual documentation: perldoc Mail::SpamAssassin::Plugin::* (ie AWL, DCC, etc)
There are now multiple files read to enable plugins in the /etc/mail/spamassassin directory; previously only one, "init.pre" was read. Now both "init.pre", "v310.pre", and any other files ending in ".pre" will be read. As future releases are made, new plugins will be added to new files named according to the release they're added in.
Due to license restrictions the DCC plugin is disabled by default. We encourage you to read the appropriate license yourself and decide if you are able to re-enable the plugins for your site. [by uncommenting the appropriate line in /etc/mail/spamassassin/v310.pre]
As of 3.1.0, in addition to the generic BayesSQL support (via Mail::SpamAssassin::BayesStore::SQL) usable by multiple database drivers there is now specific support for MySQL 4.1+ and PostgreSQL. This support is based on non-standard features present in both database servers that allow for various performance boosts.
If you were using the previous BayesSQL support with MySQL, and already have MySQL 4.1+ installed you can begin using the new module immediately by replacing the bayes_store_module line in your configuration with: Mail::SpamAssassin::BayesStore::MySQL
Inclusion of sa-update script which will allow for updates of rules and scores in between code releases.
squirrelmail 1.4.4-10 → 1.4.9a-1
Mostly bug fixes and small improvements.
Fetchmail mail retrieval
Fetchmail retrieves mail from a remote mail server and sends it to your local SMTP server.
Package(s)
- fetchmail - http://www.catb.org/~esr/fetchmail/ - remote mail retrieval and forwarding utility
- ca-certificates - Common CA certificates - PEM files of CA certificates to allow SSL-based applications to check for the authenticity of SSL connections. Useful for checking Gmail / Google Mail, for instance.
- ? fetchyahoo
- ? gotmail
Configuration
Fetchmail runs in general mode or daemon (AKA service) mode, by default checking every 5 minutes. Its behaviour is controlled by command-line options and/or a run control (i.e. config) file, either a system-wide one (/etc/fetchmailrc) or in per-user home directories (~/.fetchmailrc). The fetchmail package installer doesn't create a config file for you, you either create it manually or use the fetchmailconf utility (separately, on a workstation) to create and edit a .fetchmailrc in the home directory of the user that runs it; fetchmailconf requires X windows.
Fetchmail is configured not to run by default. For it to work you have to edit /etc/default/fetchmail, setting START_DAEMON=no to START_DAEMON=yes.
The normal mode of fetchmail is to try to download only 'new' messages, leaving untouched (and undeleted) messages you have already read directly on the server (or fetched with a previous fetchmail --keep).
The most thorough explanation of Fetchmail's configuration is in info fetchmail.
Example /etc/fetchmailrc configuration file:
# Fetchmail configuration file # /etc/fetchmailrc for system-wide daemon mode # Version 1.3 # Changes: # 1.3 - 13 Nov 2007 - added 'set no bouncemail'. # Fetchmail's default is to bounce mail to addresses that don't exist. This is # known as backscatter and in a world of spam you don't want to reply to either # a spammer or the address they forged. With this set an error mail is sent to # postmaster rather than the sender, which for us goes nowhere. # 1.2 - 18 Oct 2007 - added 'set postmaster ""' so unknown user emails are discarded # 1.1 - 14 Aug 2007 - added example using 'envelope 1 "Delivered-To:" qvirtual "109-"' # How often to poll servers, in seconds. The default is 300. set daemon 90 # LOGGING # Don't log to syslog: #set no syslog # Log to the specified log file, for troubleshooting: # (Beware that if you're using the log for troubleshooting, it can grow quickly) # (The log file wants to be editable by the user fetchmail) # (How do we cycle the log file? /etc/logrotate.conf?) #set logfile /var/log/fetchmail defaults protocol pop3 set postmaster "" # Set no postmaster so mail tagged as SMTP 550 error 'Recipient address # rejected: User unknown in virtual mailbox table' is discarded rather # than going in fetchmail's mailbox (/var/mail/fetchmail) and eating up # disk space set no bouncemail # Fetchmail's default is to bounce mail to addresses that don't exist. # This sets Fetchmail to instead send an error to postmaster. # The verbose syntax is like this # poll SERVERNAME protocol PROTOCOL # user USERNAME with password PASSWORD is LOCALUSERNAME here; # Example of various user accounts on the same server # # poll pop.provider.net proto pop3 # user \"jsmith\" with pass \"password\" is \"smith\" here # user jones with pass \"password\" is \"jjones\" here # Example of a multi-drop mailbox # # poll pop.provider.net localdomains loonytoons.org toons.org: # user your_username with pass your_password to * here # Example of a multi-drop mailbox where mail # - host doesn't provide 'X-Envelope-To' so we look at 'Delivered-To' # - mail host is running qmail virtual mailbox, prepending 109- to each address # - 1st 'Delivered-To' is unusable so we look at the 2nd # - Mail is deleted from the mail host. # # poll pop.provider.net localdomains loonytoons.org: # envelope 1 "Delivered-To:" qvirtual "109-" # user your_username with pass your_password to * here # SOME USEFUL OPTIONS # keep - Don't delete seen messages from server # no keep - Delete seen messages from server (default) # fetchall - Fetch all messages whether seen or not # no fetchall - Retrieve only new messages (default)
Set restrictive permissions on the fetchmail configuration file because it contains passwords:
chmod 0600 /etc/fetchmailrc
chown fetchmail /etc/fetchmailrc
Create the Fetchmail log file, change its owner to fetchmail and give root write access to it (beware that if you're using the log for troubleshooting, it can grow quickly):
touch /var/log/fetchmail
chown fetchmail /var/log/fetchmail
chmod g+w /var/log/fetchmail
For details of configuring Fetchmail to deal with nuances specific to different mail hosts read the Fetchmail Multidrop Issues section of Administering A Mail Server
Usage
Be mindful when working through problems with servers that use Fetchmail. There are many occasions where when you bring a server up you don't want it to automatically download for example where you don't trust the disks and you may soon swap them, or if it's a spare server you're bring up that you're not yet migrating to. In these situations it's wise to comment out the /etc/fetchmailrc file until you're ready for it.
Start system-wide fetchmail service: /etc/init.d/fetchmail start
Stop system-wide fetchmail service: /etc/init.d/fetchmail stop
Restart system-wide fetchmail service: /etc/init.d/fetchmail restart
Tell system-wide fetchmail to start a poll cycle immediately: /etc/init.d/fetchmail awaken
Troubleshooting
With the log file settings in our example configuration above uncommented, you can watch the log with tail -f /var/log/fetchmail.
When interpreting syslog, be sure to note, for each item, which particular mail program is doing the processing. This will indicate where you should be looking for the problem, such as 'fetchmail', 'postfix', 'amavis', etcetera. The Fetchmail information in the log file won't be particularly verbose.
You can get a more verbose log running Fetchmail in debug mode (and optionally running it under strace) using::
/etc/init.d/fetchmail debug-run
This scrolls a lot of information down the screen, to save it to a file as well as display it to the screen use something like:
/etc/init.d/fetchmail debug-run 2>&1) | tee fetchmail-debug.log
Display Fetchmail's defaults: /usr/bin/fetchmail --configdump
Further Information
info fetchmail
/usr/share/doc/fetchmail/fetchmail-FAQ.html
/usr/share/doc/fetchmail/README.Debian.gz
SSH server (sshd)
Package(s)
- openssh-server - Secure shell server, an rshd replacement. Provides secure encrypted communications between two untrusted hosts over an insecure network. Depends on openssh-client.
Configuration
Configuration file: /etc/ssh/sshd_config
/etc/init.d/ssh start|stop|restart
To allow X windows programs to be run by people remotely logging in using SSH, in /etc/ssh/sshd_config have X11Forwarding yes (requires one of a number of corresponding configuration settings on the connecting computer).
LDAP server
Package(s)
- slapd - OpenLDAP server
- ldap-utils
Configuration
- /etc/ldap/slapd.conf - configure using
dpkg-reconfigure slapd
See these worthwhile guides for configuration instructions:
- 'Linux LDAP authentication' by "American" Dave Kline, is a Debian-specific tutorial covering both LDAP client and server setup: http://enterprise.linux.com/article.pl?sid=05/09/15/1930256&tid=129
- 'Using OpenLDAP' by metaconsultancy, covers LDAP server setup: http://www.metaconsultancy.com/whitepapers/ldap.htm (Debian-specific; simply written, makes it easy to follow)
Restart slapd for changes to take effect using /etc/init.d/slapd restart.
Linux kernel updates
Package(s)
Debian 4.0 releases 1 though to 7 'Etch' Linux 2.6.18 kernels
The linux-image-<architecture> package will install the most recent Etch 2.6.18 series kernel available for that particular architecture and keep it updated when new versions of 2.6.18 are available. '486', '686', '686-bigmem' and 'k7' architectures are for single and multiprocessor (AKA SMP) 32-bit x86 (generically known as PC, i386, IA32, IA-32 or x86-32) processors. The 'amd64' architecture is for single and multiprocessor (AKA SMP) 64-bit Intel and AMD PC processors (generically known as x86-64 or x64). Debian includes kernels for many other architectures but we focus on these. The following describes how installing the generic kernel package will bring in the specific kernel package. These are upstream kernel version 2.6.18.7, Debian's actual version 2.6.18.dfsg.1-12, upgradeable through Debian security updates to at least 2.6.18.dfsg.1-22etch3.
- linux-image-486 → linux-image-2.6-486 → linux-image-2.6.18-4-486 - optimised for 486-class processors, will work on all 32-bit x86 class processors. Provides a useful fail-safe boot option in case of problems and one which allows you to move the system to a different computer with a different x86 processor architecture.
- linux-image-686 → linux-image-2.6-686 → linux-image-2.6.18-4-686 - optimised for Intel Pentium-Pro/Celeron/Pentium II/Pentium II Xeon/Pentium III/Mobile Pentium III (AKA PIII-M)/Pentium III Xeon/Pentium 4/Mobile Pentium 4/Mobile Pentium 4 M (AKA P4-M)/Pentium 4M/Pentium 4 Extreme Edition/Xeon (32-bit)/Xeon MP (32-bit)/Pentium M (a part of Centrino) [and Core Solo and Core Duo?]
- linux-image-k7 → linux-image-2.6-k7 → linux-image-2.6.18-4-k7 - optimised for AMD K7 (Duron/Athlon/AthlonXP)
- linux-image-686-bigmem → linux-image-2.6-686-bigmem → linux-image-2.6.18-4-686-bigmem - optimised for the same processors as '686' but with 4-64GB RAM
- linux-image-amd64 → linux-image-2.6-amd64 → linux-image-2.6.18-4-amd64 - For Intel IA-32e / EM64T / Intel 64 (Intel Xeon (some models since Nocona), Celeron D (some models since Prescott), Pentium 4 (some models since Prescott), Pentium D, Pentium Extreme Edition, Xeon (Woodcrest), Core 2) and AMD64 K8 (AMD Athlon 64, Athlon 64 X2, Athlon 64 FX, Opteron, Turion 64, Turion 64 X2, Sempron (Palermo E6 stepping and all Manila models))
Debian 4.0 releases 4 though to 7 'Etch'n'Half' Linux 2.6.24 kernels
Debian 4.0r4, known as 'Etch'n'Half' introduced a totally new kernel, version 2.6.24.
See Release Notes and Installing Debian GNU/Linux "etch-and-a-half" for details.
Kernel 2.6.24 is not the default kernel. This kernel won't be installed automatically with a dist-upgrade, nor with a fresh install, it needs specifically installing.
This is the first time Debian have made this kind of semi-major release, between major versions 4.0 and 5.0. The usual Debian guarantees aren't present, see the release notes for details. In what to-all-intents-and-purposes is a normal Debian release, I find such changes to usual Debian dependability and consistency alarming:
- "Debian does not guarantee that all hardware that is supported by the default etch 2.6.18 kernel is also supported by the 2.6.24 kernel, nor that all software included in etch will work correctly with the newer kernel.
- Migrating from the 2.6.18 etch kernel to the 2.6.24 "etch-and-a-half" kernel will work in many cases, but is not guaranteed to succeed. Upgrades from both the 2.6.18 and 2.6.24 kernels to the kernel provided by the next stable release ("lenny") will be supported.
- Not all features of the etch 2.6.18 kernel are available in the 2.6.24 images, this includes the Xen and linux virtual server flavors.
- Out-of-tree kernel module source packages that were provided in etch are not guaranteed to function properly with the 2.6.24 kernel.
- The current "etch-and-a-half" installation images based on Debian Installer Lenny RC1 use a newer kernel (2.6.26) than the version that was included in the "etch-and-a-half" release and is installed for the target system (2.6.24). In some cases this can mean that hardware which is supported during the installation does not work after the reboot into the installed system because support for it was added after the 2.6.24 version."
The linux-latest-2.6-etchnhalf package will install the most recent Etch-and-a-half 2.6.24 series kernel available for your particular architecture and keep it updated when new versions of 2.6.24 are available. '486', '686', and '686-bigmem' architectures are for single and multiprocessor (AKA SMP) 32-bit x86 (generically known as PC, i386, IA32, IA-32 or x86-32) processors (a 'k7' Etch-and-a-half doesn't seem to be available). The 'amd64' architecture is for single and multiprocessor (AKA SMP) 64-bit Intel and AMD PC processors (generically known as x86-64 or x64). Debian includes kernels for many other architectures but we focus on these. The following describes how installing the generic kernel package will bring in the specific kernel package. These are upstream kernel version 2.6.24.6, Debian's actual version 2.6.24-6~etchnhalf.4, upgradeable through Debian security updates to at least 2.6.24-6~etchnhalf.9etch3.
- linux-image-2.6-486-etchnhalf → linux-image-2.6.24-etchnhalf.1-486 - optimised for 486-class processors, will work on all 32-bit x86 class processors. Provides a useful fail-safe boot option in case of problems and one which allows you to move the system to a different computer with a different x86 processor architecture.
- linux-image-2.6-686-etchnhalf → linux-image-2.6.24-etchnhalf.1-686 - optimised for Intel Pentium-Pro/Celeron/Pentium II/Pentium II Xeon/Pentium III/Mobile Pentium III (AKA PIII-M)/Pentium III Xeon/Pentium 4/Mobile Pentium 4/Mobile Pentium 4 M (AKA P4-M)/Pentium 4M/Pentium 4 Extreme Edition/Xeon (32-bit)/Xeon MP (32-bit)/Pentium M (a part of Centrino) [and Core Solo and Core Duo?]
- linux-image-2.6-686-bigmem-etchnhalf → linux-image-2.6.24-etchnhalf.1-686-bigmem - optimised for the same processors as '686' but with 4-64GB RAM
- linux-image-2.6-amd64-etchnhalf → linux-image-2.6.24-etchnhalf.1-amd64 - For Intel IA-32e / EM64T / Intel 64 (Intel Xeon (some models since Nocona), Celeron D (some models since Prescott), Pentium 4 (some models since Prescott), Pentium D, Pentium Extreme Edition, Xeon (Woodcrest), Core 2) and AMD64 K8 (AMD Athlon 64, Athlon 64 X2, Athlon 64 FX, Opteron, Turion 64, Turion 64 X2, Sempron (Palermo E6 stepping and all Manila models))
Installation
If you install any of these kernels they will be installed and your old kernel version retained with the new kernel set as the default in the GRUB boot menu. You can find out which CPU you have in your system with the command cat /proc/cpuinfo, under 'model name'.
Updates
You will see various messages when updating or upgrading kernels. Here are some examples.
When you use aptitude upgrade you get updated versions of the same kernel(s) you have installed. Same package name, different version of that package. For example you might get package linux-image-2.6.18-4-686 (package version 2.6.18.dfsg.1-12etch1) updated to package version 2.6.18.dfsg.1-12etch2. This is the kind of message you would see in this case (this particular example actually deals with a Debian 3.1 Sarge update, kernel-image-2.6.8-4-686-smp (package version 2.6.8-17) → kernel-image-2.6.8-4-686-smp (package version 2.6.8-17sarge1)):
Setting up kernel-image-2.6.8-4-686-smp (2.6.8-17sarge1) ... You are attempting to install a kernel version that is the same as the version you are currently running (version 2.6.8-4-686-smp). The modules list is quite likely to have been changed, and the modules dependency file /lib/modules/2.6.8-4-686-smp/modules.dep needs to be re-built. It can not be built correctly right now, since the module list for the running kernel are likely to be different from the kernel installed. I am creating a new modules.dep file, but that may not be correct. It shall be regenerated correctly at next reboot. I repeat: you have to reboot in order for the modules file to be created correctly. Until you reboot, it may be impossible to load some modules. Reboot as soon as this install is finished (Do not reboot right now, since you may not be able to boot back up until installation is over, but boot immediately after). I can not stress that too much. You need to reboot soon. Please Hit return to continue. Not touching initrd symlinks since we are being reinstalled (2.6.8-17) Not updating image symbolic links since we are being updated (2.6.8-17) Searching for GRUB installation directory ... found: /boot/grub . Testing for an existing GRUB menu.list file... found: /boot/grub/menu.lst . Searching for splash image... none found, skipping... Found kernel: /boot/vmlinuz-2.6.8-4-686-smp Updating /boot/grub/menu.lst ... done
When you use aptitude dist-upgrade you get upgraded kernel packages themselves - actual new builds of the same kernel version (2.6.18) you have installed, bringing in bigger updates than when just the package version changes. For example you might get package linux-image-2.6.18-5-686 upgraded to package linux-image-2.6.18-6-686. The whole package itself has changed, so you end up with the old kernel and the new kernel. This is the kind of message you would see in this case (this particular example actually deals with a Debian 3.1 Sarge update, kernel-image-2.6.8-3-686-smp → kernel-image-2.6.8-4-686-smp):
You are running a kernel (version 2.6.8-3-686-smp) and attempting to remove
the same version. This is a potentially disastrous action. Not only
will /boot/vmlinuz-2.6.8-3-686-smp be removed, making it impossible to boot
it, (you will have to take action to change your boot loader to boot
a new kernel), it will also remove all modules under the directory
/lib/modules/2.6.8-3-686-smp. Just having a copy of the kernel image is not
enough, you will have to replace the modules too.
I repeat, this is very dangerous. If at all in doubt, answer
no. If you know exactly what you are doing, and are prepared to
hose your system, then answer Yes.
Remove the running kernel image (not recommended) [No]?
If you say 'no' here you get this:
dpkg: error processing kernel-image-2.6.8-3-686-smp (--remove): subprocess pre-removal script returned error exit status 1 Errors were encountered while processing: kernel-image-2.6.8-3-686-smp E: Sub-process /usr/bin/dpkg returned an error code (1) Ack! Something bad happened while installing packages. Trying to recover: Setting up kernel-image-2.6.8-4-686-smp (2.6.8-17) ... Searching for GRUB installation directory ... found: /boot/grub . Testing for an existing GRUB menu.list file... found: /boot/grub/menu.lst . Searching for splash image... none found, skipping... Found kernel: /boot/vmlinuz-2.6.8-4-686-smp Found kernel: /boot/vmlinuz-2.6.8-3-686-smp Updating /boot/grub/menu.lst ... done
If you say 'yes' here you get this:
Ok, proceeding with removing running kernel image. Searching for GRUB installation directory ... found: /boot/grub . Testing for an existing GRUB menu.list file... found: /boot/grub/menu.lst . Searching for splash image... none found, skipping... Found kernel: /boot/vmlinuz-2.6.8-4-686-smp Updating /boot/grub/menu.lst ... done The link /vmlinuz.old is a dangling link Removing symbolic link vmlinuz.old Unless you used the optional flag in lilo, you may need to re-run lilo The link /initrd.img.old is a dangling link Removing symbolic link initrd.img.old Unless you used the optional flag in lilo, you may need to re-run lilo ... Setting up kernel-image-2.6-686-smp (101sarge2) ... server:/var/log# aptitude dist-upgrade Reading Package Lists... Done Building Dependency Tree Reading extended state information Initializing package states... Done Reading task descriptions... Done The following packages are unused and will be REMOVED: kernel-image-2.6.8-3-686-smp
This example involves an ABI (application binary interface) change:
Note that this update changes various package names due to ABI changes.
You must therefore have the corresponding upgrade-assist metapackage(s)
installed for your upgrades to automatically take place. These packages
have names with the prefix 'linux-image-2.6-'. Systems installed with an
official Debian 4.0 installer will have the appropriate packages installed
by default. For a full list of these metapackages for Debian 4.0, see:
http://packages.debian.org/source/etch/linux-latest-2.6
Any 3rd party modules that have been built and installed for your system
will need to be rebuilt and installed for compatability with the new ABI.
The following matrix lists additional source packages that were rebuilt for
compatability with or to take advantage of this update:
Debian 4.0 (etch)
fai-kernels 1.17+etch.17etch1
linux-latest-2.6 6etch3
linux-modules-contrib-2.6 2.6.18-4+etch3
linux-modules-extra-2.6 2.6.18-7+etch4
linux-modules-nonfree-2.6 2.6.18-4etch2
loop-aes 3.1d-13etch2
nvidia-graphics-legacy-modules-amd64 1.0.7184+6etch2
nvidia-graphics-legacy-modules-i386 1.0.7184+6etch2
nvidia-graphics-modules-amd64 1.0.8776+6etch2
nvidia-graphics-modules-i386 1.0.8776+6etch2
user-mode-linux 2.6.18-1um-2etch.17etc
If you are using the apt-get package manager, use the line for
sources.list as given below:
apt-get update
will update the internal database
apt-get dist-upgrade
will install corrected packages
Configuration
To see which compile-time options were set in your kernel, see the file /boot/config-<kernel version>-<Debian build version>-<architecture>.
Further Information
Changes in the 2.6 Linux kernel - prior to the present mainline kernel wiki.kernelnewbies.org/Linux26Changes
Changes in the 2.6 Linux kernel - the present mainline kernel wiki.kernelnewbies.org/LinuxChanges
'Debian Reference - Chapter 7 - The Linux kernel under Debian: www.debian.org/doc/manuals/reference/ch-kernel.en.html
KernelTrap: kerneltrap.org
Kernel Traffic: www.kerneltraffic.org/kernel-traffic/latest.html
The Linux Kernel Mailing List (LKML): lkml.org
The Linux Kernel Archives: kernel.org
Bits from the kernel team - "Half-way between the Sarge release and the Etch freeze the Debian kernel team takes a look back at what already happened after the Sarge release and what you should expect for Etch" - 8 Mar 2006: lists.debian.org/debian-devel-announce/2006/03/msg00007.html.
NFS server
Package(s)
- nfs-kernel-server (because nfs-user-server "is buggy and unmaintained")
- portmap
Configuration
The userID of the user on the workstation must match the userID of a user on the server.
Add directories to share and who to share them to in /etc/exports, for example:
/home/shared 10.0.0.0/255.255.0.0(rw) 192.168.0.0/255.255.0.0(rw)
Re-export all directories in the table of exported file systems for NFS:
exportfs -ra
Further Information
- man exports
Version control - Subversion
Package(s)
- subversion (http://subversion.tigris.org/)
- subversion-dav
Configuration
This configuration is explained in more depth at http://svnbook.red-bean.com/nightly/en/svn.serverconfig.svnserve.html
In order to use Subversion's own lightweight server
(as opposed to using Apache) to enable access over a network edit the following then restart inetd with /etc/init.d/inetd restart:
/etc/inetd.conf: svn stream tcp nowait svnowner /usr/bin/svnserve svnserve -i -r /usr/local/repositories
You can leave out the -r /usr/local/repositories but users will have to include the whole local path in their client software). You need to create the user svnowner and give them appropriate permissions on the subversion repository directory.
Define the name of the password file of users that can commit to the repository, and give your realm a name, by adding the following to:
/repository-directory/conf/svnserve.conf
[general]
password-db = passwd
realm = My First Realm
Define users that can commit to the repository, by creating the file: /repository-directory/conf/passwd
and adding users using this syntax:
[users]
harry = foopassword
sally = barpassword
Further Information
Version Control with Subversion:
Printing
Package(s)
This is an interesting document on changes to be made to printing packages in Debian: PrinterDriverPackagesSuggestedChanges.
When printing to a directly attached printer
- CUPS - Common UNIX Printing System
- cupsys - server
- cupsys-client - client
- smbclient - Samba client so can find Windows shared printers
- printer drivers
There are various providers of PPDs (printer description files) but for an individual printer some will be better than others. CUPS includes a few generic PPDs for non-PostScript printers (in /usr/share/cups/model) that work with some 400 printers (see http://samba.org/samba/docs/man/Samba-HOWTO-Collection/CUPS-printing.html#id2642170) If you instead use the alternative drivers described here you'll get better quality results and have support for more printers.- Gutenprint (was called Gimp-Print)
- cupsys-driver-gutenprint or ijsgutenprint - universal printer driver for non-PostScript printers. Check the list of supported models or use the command
man gimpprint-models. - gutenprint-doc
- gutenprint-locales - for locales other than US English; needed when you want the programs in Gutenprint to print their messages in other languages than US English
- cupsys-driver-gutenprint or ijsgutenprint - universal printer driver for non-PostScript printers. Check the list of supported models or use the command
- hpijs - HP Linux Printing and Imaging System - for printing on most JetDirect and USB attached HP SFP (single function peripheral) InkJets and many LaserJets (not all, see the other HP packages for more). Check the list of supported printers
Use with hplip. - hplip
- hplip - support for printing on most JetDirect and USB attached HP SFP (single function peripheral) InkJets and many LaserJets, and for scanning and photo-card access on most HP MFP (multi-funtcion peripheral) printers. (Mutually exclusive package to hpoj).
- hplip-doc
- hpoj - seems to be fairly universally not recommended - support for most parallel port attached "multi-function" (also known as "all-in-one") peripherals from Hewlett-Packard, including OfficeJet, LaserJet (not all, see the other HP packages for more), Printer/Scanner/Copier ("PSC"), and PhotoSmart printer products. (Mutually exclusive package to hplip). Check the list of supported printers
- pnm2ppa
- pnm2ppa - for HP Deskjet 7xx, 820 and 1000 PPA protocol GDI printers
- psutils - enables n-up printing support
- min12xxw - http://www.hinterbergen.de/mala/min12xxw/ - CUPS/Foomatic printer driver for the KonicaMinolta PagePro 1200W, 1250W, 1300W, 1350W and 1400W.
- c2050 - Lexmark 2050 Color Jetprinter Linux Driver. Filter to convert a Postscript file to Lexmark 2050 format.
- cjet - Software PCL emulation for Canon CaPSL laser printers (Canon LBP-4U and Canon LBP-8A1)
- There are other printer drivers not available in Debian, such as:
PXLJR - http://hp-pxl-jetready.sourceforge.net/ for HP Color LaserJet 3500, 3550 and 3600;
Omni - http://omniprint.sourceforge.net/ for various Brother, Canon, Epson, HP, IBM, KS, Kyocera, Okidata, Panasonic and Star printers.
- Gutenprint (was called Gimp-Print)
- Foomatic database for various print drivers
- foomatic-db-gutenprint - database for Gutenprint printer drivers
- foomatic-db-hpijs - database for HPIJS driver
- foo2zjs - http://foo2zjs.rkkda.com - support for printing to ZjStream-based printers Minolta magicolor 2200/2300/2430 DL, Minolta Color PageWorks/Pro L and HP LaserJet 1000/1005/1018/1020/1022 (often erroneously referred to as 'winprinters' or 'GDI printers')
- Foomatic PPD files
- PPD files for non-PostScript printers
- hplip-ppds (was hpijs-ppds) - for Hewlett-Packard printers
- foomatic-filters-ppds - These are those available individually from linuxprinting.org / http://www.linux-foundation.org/en/OpenPrinting
- PPD files for PostScript printers
- linuxprinting.org-ppds - PPD files for PostScript printers supplied under free licences by printer manufacturers; for those under non-free licences you have to go to the manufacturer's web site. These are those available individually from linuxprinting.org / http://www.linux-foundation.org/en/OpenPrinting
- hp-ppd - PPD files for some Hewlett-Packard PostScript printers that aren't included in the linuxprinting.org-ppds package: HP_Business_Inkjet_2500C_Series.ppd, HP_ColorLaserJet_5-5M.ppd, HP_DeskJet_350C.ppd, HP_DeskJet_600C_Photo_Series.ppd, HP_DeskJet_600C_Series.ppd, HP_DeskJet_630C.ppd, HP_DeskJet_800C_Series.ppd, HP_DeskJet_900C_Series.ppd, HP_DeskJet_990C.ppd, HP_LaserJet_3200M.ppd, HP_LaserJet_5.ppd, HP_LaserJet_5000_Series.ppd, HP_LaserJet_5P.ppd and HP_LaserJet_6P.ppd
- PPD files for non-PostScript printers
- Foomatic - http://www.linux-foundation.org/en/OpenPrinting/Database/Foomatic - improves/simplifies integration between print drivers and CUPS
- The Foomatic print filter system
- foomatic-db-engine - the programs - (also brings in foomatic-filters and foomatic-db (the database))
- netcat
- GNOME-based Foomatic interface
- foomatic-gui - an alternative to using the command-line tools included with foomatic-db-engine
- netcat
- nmap
- smbclient
- pconf-detect
- The Foomatic print filter system
- printconf - auto setup for parallel and USB port printers with CUPS
- Ink, nozzle and head utilities
- escputil - display the ink levels, clean the nozzles, and align the heads of Epson inkjet printers. From the Gimpprint / Gutenprint project.
- mtink - display the ink levels, clean the nozzles, and align the heads of Epson inkjet printers - an alternative to escputil
When printing to either a directly attached or remote printer
- cupsys-client - Common UNIX Printing System - client programs
- cupsys-pt - Tool for viewing/managing print jobs under CUPS
- cupsys-bsd - BSD printing tools, including
lpr(Mozilla prints usinglpr); it allows OpenOffice to automatically find your printers - gs-esp - The Ghostscript PostScript interpreter - ESP version (the ESP version of Ghostscript is better maintained and suited to CUPS than AFPL's versions gs-afpl and gs-gpl)
- psfontmgr - PostScript font manager (part of Defoma, Debian Font Manager) ['recommended']
- Recommended but not essential:
- a2ps - 'Anything to PostScript' converter and pretty-printer; converts files into PostScript for printing or viewing. it's atleast a useful utility for a well layed-out printout.
- enscript - Converts ASCII text to Postscript, HTML, RTF or Pretty-Print. It's atleast a useful utility for a well layed-out printout
Package installation options
cupsys-bsd asks "Do you want to set up the BSD lpd compatibility server?" - yes
When printing to a remote printer
Put the hostname or IP address of the print server in the ServerName section of the configuration file /etc/cups/client.conf. The printer should then be available to most applications to print to.
Install the Printer Driver, when the printer is directly attached
You need a PostScript printer driver (and filter, if the printer isn't a PostScript printer) for each printer, even if the printer isn't a PostScript printer. Go to the http://www.linux-foundation.org/en/OpenPrinting Printer Database at http://linuxprinting.org/printer_list.cgi and look up your particular printer and note which driver (and accompanying filter) it recommends using.
Install the recommended PostScript printer driver package (see previously), or if you're using an actual PostScript printer you may be getting the driver from the printer vendor.
Restart CUPS: /etc/init.d/cupsys restart
(This example is for an Epson Stylus C84, you need to change the name of the files to suit your printer)
Create the print queue, when the printer is directly attached
Using the CUPS web interface
- go to http://localhost:631/admin/ if the printer is attached to the computer you're using, or http://IP-address-of-computer:631/admin/ if attached to a remote computer
- choose Add Printer then enter a Name and choose Continue
(CUPS will know where to look for the printer drivers and deal with them in their gzipped format so you don't need to uncompress them manually.) - choose Device:
- if this is a directly attached printer, attached to the USB port, choose something like: USB Printer #1 (<name of printer>) → Continue
- if this is a directly attached printer, attached to the parallel port, choose something like: Parallel Port #1 (<name of printer>) → Continue
(Note that the parallel port will only appear if it is enabled in the BIOS; to see if Linux has recognised the parallel port usedmesg|grep lp) - if this is a directly attached printer, attached to the USB or parallel port, and you're using the HPLIP driver (see instructions), choose something like: hp:/usb/<printer name>, <serial number> → Continue
- if this is a remote printer, available via CUPS, choose: Internet Printing Protocol (ipp)
- if this is a remote printer, attached directly to the network using a JetDirect card, whether or not you're using HPLIP the driver, choose Appsocket/HP JetDirect
- choose Device URI (for remote printers)
- if the remote printer is made available via CUPS, choose: ipp://<hostname>/printers/<printer name>
- if the remote printer is attached to the network using a JetDirect card, choose socket://hostname:9100
- if the remote printer is attached to the network using a JetDirect card and you're using the HPLIP driver
- search for the printer URI:
hp-makeuri <printer IP address> - choose this URI, it will be of the form hp:/net/HP_<model name>_<model number>?ip=<IP address>
- search for the printer URI:
- choose Make: EPSON → Continue
- choose Model (those that appear relates to those you've installed drivers for; choose the one labeled '(recommended)')
- i.e. EPSON Stylus C84 - CUPS + Gutenprint v<version-number> (<language>)(despite appearances, for this choice to work you have to have previously installed the Gutenprint driver) → Continue
- i.e. HP LaserJet 5 Foomatic/hpijs (recommended) (en)
Using the command-line
- Unlike other methods, you need to uncompress the PPD (PostScript Printer Description) file for your printer, either leaving it in the same directory or you can copy it elsewhere
- Gutenprint drivers are located in /usr/share/cups/model/gutenprint/<version-number>/<language>/, so you should uncompress it with the command
gzip -d /usr/share/cups/model/gutenprint/<version-number>/<spoken-language>/escp2-c84.ppd.gz; then copy it to the printer drivers directory with the commandcp /usr/share/cups/model/gutenprint/<version-number>/<spoken-language>/escp2-c84.ppd /usr/share/cups/model - foomatic-filters-ppds are located in /usr/share/cups/model/foomatic-ppds/<printer manufacturer>
- Gutenprint drivers are located in /usr/share/cups/model/gutenprint/<version-number>/<language>/, so you should uncompress it with the command
- Create the queue, enable it and accept jobs (this example is for an Epson Stylus C84):
lpadmin -p epson_c84 -v device-name -m escp2-c84.ppd -E
wheredevice-nameis specific to how your device is attached, for example- for a USB attached printer on the 1st USB port: usb:/dev/usb/lp0
- for a directly attached printer, attached to the 1st parallel port: parallel:/dev/lp0
(Note that the parallel port will only be available if it is enabled in the BIOS; to see if Linux has recognised the parallel port usedmesg|grep lp) - if the printer is directly attached, or attached to the network using a JetDirect card and you're using the HPLIP driver
- search for the printer URI:
hp-makeuri <printer IP address> - choose this URI, it will be of the form hp:/net/HP_<model name>_<model number>?ip=<IP address> or hp:/usb/<printer name>, <serial number>
- search for the printer URI:
- for a remote CUPS printer: ipp://<hostname>/printers/<printer name>
- for a remote Windows or Samba printer: smb://<hostname>/<printer name> or smb://<workgroup>/<hostname>/<printer name> (if WINS is unavailable, add -h <IP address>(but the Samba HOWTO says this won't work); if you need to provide credentials, prepend with smb://username:password@ but note that it's available in various places in the clear))
- for a remote HP JetDirect: socket://<IP address>:9100
- Set as the default printer:
lpadmin -d epson_c84
If you need to remove the print queue, use lpadmin -x <printer>.
Configure the printer driver
Using the CUPS web interface
Configure Printer...
Using the command-line
lpoptions - display or set printer options and defaults. Use it to lock down a set of sensible defaults. To see the options available for your setup, use the 'docs' option like this: lp -d <printer> -o docs /etc/hosts; or use lpoptions -p <printer> -l. Usually, you can also use the media=..., sides=..., and duplex CUPS options, if there are InputSlot, MediaType, and Duplex options for your driver.
Sharing the printer
CUPS
- To enable remote administration, and remote printing for CUPS-aware software, add or amend these sections in /etc/cups/cupsd.conf (change IP addresses to suit your situation, we use 10.0.0.*, or use a domain name wildcard, or All (but All is an insecure method):
- ServerAdmin <your administrator's email address>
- Access permissions for everywhere (printers, classes, jobs):
<Location />
Order Deny,Allow
Deny from None
Allow from 10.0.0.*
</Location>
(or should it be Deny from None?) - Access permissions for printers:
<Location /printers>
AuthType None
Order Deny,Allow
Deny from None
Allow from 10.0.0.*
</Location>
(or should it be Deny from None?) - Access permissions for administration functions (this allows access to those in the system group):
<Location /admin>
AuthType Basic
AuthClass System
Order Deny,Allow
Deny From All
Allow from 10.0.0.*
</Location>
- You can remotely access CUPS printer configuration, either using a web browser, at http://<server name>:631; or using the command-line tools described elsewhere in this document.
Samba
To share printers to Windows workstations (this assumes some understanding of Samba).
This is only a rudimentary guide to setting up print sharing through Samba. For a much more complete guide see the printing section of our Samba document 'Setting up a Samba primary domain controller and file/print/software deployment server for Windows using Samba 3 on Debian 4.0 Etch'.
- If you're allowing anonymous access to the printer, create a user account for remote print jobs:
adduser --system --disabled-password smbprint
If you've configured CUPS to restrict printing to certain users, you must allow the smbprint user to access printers you want to share. - Configure Samba to make use of the CUPS print server, in the Samba configuration file /etc/samba/smb.conf.
If you're using the smbprint user, include it here so that anyone who can make a network connection to the system is able to print. If instead you need access control, use security=user or security=domain in the global section of smb.conf.[global] printcap name = cups printing = cups security = share [printers] browseable = yes printable = yes public = yes create mode = 0700 guest only = yes guest account = smbprint path = /home/smbprint
- Windows printer drivers format their output for the printer before sending it across the network. You must configure CUPS to accept the pre-formatted output by uncommenting the following lines from the following files
- /etc/cups/mime.convs: application/octet-stream application/vnd.cups-raw 0 -
- /etc/cups/mime.types: application/octet-stream
- ? Get the specific printer PPD file and copy it to /etc/cups/ppd/.
- Add the CUPS driver for Windows to the CUPS print server.
- Use cupsaddsmb to add each CUPS printer to Samba.
- Install the CUPS PostScript printer driver on each Windows workstation, by connecting to the printer on the server from each workstation, for example using Windows Explorer, and right-clicking on the printer and choosing 'Connect'. The one CUPS driver for Windows will work for all different printers.
Tools for working with printer queues and print jobs
Using the CUPS web interface
Should be self explanatory.
Using the command-line
(use -h IP-address with each of these to specify the IP address of the print server if using a remote printer)
- Print a file to the default printer:
lp file - Print a file to a specific printer:
lp -d <printer name> file - Configure CUPS printers and classes:
lpadmin-p- specify printer name-v- sets the device-uri attribute of the printer queue, e.g.:usb:/dev/usb/lp0- a USB device in the first USB portsmb://hostname/printer-name- a remote Windows or Samba queue- (There is documentation saying you configure a remote CUPS printer with
-v ipp://IP-address/printers/printer-namebut you can instead use the simpler-h IP-address)
-P- specifies a PostScript Printer Description file to use with the printer-d- sets default printer (doesn't seem to work for remote printers)-L- describe the printer's physical location (in your own words)-D- describe the printer (in your own words)-x- remove a print queue
- Show all CUPS status information, including system default printer, device name(s), what printer(s) are doing:
lpstat -t(specify a printer with-p printer(s); if no printers are specified then all printers are listed) - Show a long listing of printers, classes, or jobs:
lpstat -l(specify a printer with-p printer(s); if no printers are specified then all printers are listed) - Show the status of the default print queue:
lpq - Show the status of a specific print queue:
lpq -P <printer name> - Accept jobs sent to a destination:
accept <destination(s)> - Reject jobs sent to a destination:
reject <destination(s)> - Start printers and classes:
cupsenable <destination(s)>(use in place ofenable, CUPS' version is a double-booking on the name) - Stop printers and classes:
cupsdisable <destination(s)> - Cancel all print jobs from the specified destination:
cancel -a <destination> - Cancel a print job with the specified job number from the specified queue:
cancel <queuename>-<jobnumber> - kill any processes still using the printer device, when the job has been removeed from the queue but some remains printing:
fuser -k device
Inkjet printer maintenance
With Epson Stylus printers
Using the command-line
- escputil
- Check ink levels:
escputil -r <raw device name> --ink-level
To do this requires communicationg in a bi-directional way with the printer, which requires the Linux kernel to be configured for bi-directional printing with the CONFIG_PARPORT_1284 configuration option, which Debian kernels have (back with the 2.2 series kernel this was called CONFIG_PRINTER_READBACK). Presumably it also requires the BIOS to have bi-directional parallel port usage enabled. - Print a nozzle test pattern:
escputil --nozzle-check
Dirty or clogged nozzles will show as gaps in the pattern. If you see any gaps, you should run a head cleaning pass or two. - Clean the print head:
escputil --clean-head
This can also be performed from the printer front panel. - Align the print head:
escputil -r <raw device name> --align-head
CAUTION: Misuse of this option may result in poor print quality and/or damage to the printer. - Retrieve printer status:
escputil -r <raw device name> --status
- Check ink levels:
- The following options might need to be used with escputil
-P, --printer-name=<printer>- specify printer name-r, --raw-device=device- specify the name of the device to write to directly rather than going through a printer queue, used when an option requires read/write access to the raw printer device. Raw device names look like /dev/usb/lp0 for a USB attached printer on the first USB port, /dev/lp0 for a parallel cable attached printer on the first parallel port. You can find the raw device name usinglpstat -v-u, --new- the printer is a new printer (Stylus Color 740 or newer).
Troubleshooting
List available devices on the system: lpinfo -v
List available drivers on the system: lpinfo -m
Restart CUPS: /etc/init.d/cupsys restart
CUPS configuration file: /etc/cups/cupsd.conf
CUPS error log: /var/log/cups/error_log. (Change 'LogLevel warn' to 'LogLevel debug' in /etc/cups/cupsd.conf, then restart CUPS, for more verbose messages in the error log.)
Configuration for Printing to Windows Printers
(Note: add package names for installing Samba components for this to work)
Check you can connect to the Windows system: smbclient -L <computer-name> -N.
If WINS isn't available you need to additionally specify the IP address with -I IP-address.
Verify that your installation of CUPS has the SMB backend by looking for a particular symbolic link: ls -l /usr/lib/cups/backend/smb. If this symbolic link doesn't exist, create it: ln -s /usr/bin/smbspool /usr/lib/cups/backend/smb
Further Information
CUPS Software Administrators Manual: http://localhost:631/documentation.html or http://www.cups.org/sam.html
CUPS Software Users Manual: http://www.cups.org/sum.html
http://www.linux-foundation.org/en/OpenPrinting includes forums for specific printer makes
CUPS Software Users Manual, http://localhost:631/documentation.html
Setting Up CUPS under Debian GNU/Linux: http://mumford1.dyndns.org/~bs7452/linuxhelp/cups.html
HP Linux Printing Project: http://hpinkjet.sourceforge.net/
Debian and Windows Shared Printing mini-HOWTO: http://www.faqs.org/docs/Linux-mini/Debian-and-Windows-Shared-Printing.html (this is a good introduction)
http://www.linuxmafia.com/faq/Debian/printing-setup.html
http://gimp-print.sourceforge.net/p_Documentation.php3
Noteworthy changes since previous Debian stable version
- PostScript printer definitions linuxprinting.org-ppds and hp-ppd.
- CUPS 1.1.23 → 1.2.7
cupsd.conf by default only listens for connections from the local machine.
For remote access you need to change 'Listen Localhost:631' to 'Listen *:631' or what ever suits your
situation.
Interesting
- Added official support for printer maintenance commands
via the CUPS Command file format and hooks in the
printer-type and web interfaces (STR #932)
- Added support for DBUS on Linux.
- Fixed a problem with N-up printing and OpenOffice (STR
#576)
- Added new on-line help CGI to web interface to provide
searchable help.
- Added new printer auto-detection, server configuration,
and log file viewing to the administration web page.
- Added KDE/GNOME icons and a Manage Printers menu item.
- The parallel and USB backends no longer wait for the
printer to go on-line - this caused problems with
certain printers that don't follow with the IEEE-1284
standard (STR #1738)
potentially worth looking into to use
- Added new "set allowed users" web interface to set the
list of allowed users for a printer or class.
- Added a "set allowed users" interface to the web
interface so that you can set the list of allowed or
denied users/groups for a printer or class.
- Updated the cupsaddsmb utility to correctly export the
CUPS driver for Windows.
- New policy mechanism allows per-operation and
per-printer control over what users and groups are
allowed to do various IPP operations.
- Added the SNMP backend for network printer discovery
(STR #1555)
- The cupsaddsmb man page listed the wrong files for the
CUPS driver.
potentially problematic for an upgrade
- The USB backend no longer supports the usb:/dev/foo
format on systems that support device ID queries.
useful bugs fixed
- Windows clients could not monitor the queue status (STR
#2006) - http://www.cups.org/windows/str.php?L2006+P0+S-2+C0+I0+E0+Q
Document scanner server
Package(s)
- sane (http://www.sane-project.org/) - driver software for dealing with a directly attached scanner.
- libsane-extras (http://www.fifi.org/doc/libsane/README.Debian) - some backends that are not yet included into the official SANE distribution
Configuration
Follow the configuration instructions in our document 'Desktop System Setup with Debian 4.0 Etch' and additionally configure for sharing as described below.
saned is the SANE (Scanner Access Now Easy) daemon that allows remote clients to access image acquisition devices available on the local host.
- configuration file: /etc/sane.d/saned.conf - contains a list of accepted clients
- add this to /etc/inetd.conf:
sane stream tcp nowait saned.saned /usr/sbin/saned saned - The Debian package automatically adds this for you to /etc/services:
sane 6566/tcp # SANE network scanner daemon
(Note: Debian uses 'sane' where as the SANE project's documentation uses 'sane-port'. It looks as though 'sane-port' will be replaced in the IANA ports specification with 'sane')
DHCP
Package(s)
- dhcp3-server
Configuration
Configuration file: /etc/dhcp3/dhcpd.conf
Internet relay chat (IRC) server using dancer
Package(s)
- dancer-ircd - IRC server
- dancer-ircd-doc - documentation for dancer-ircd
- dancer-services - services for dancer IRC server
Configuration
dancer-ircd
- /etc/dancer-ircd/ircd.conf
- This is the syntax for the M: line:
M:local host name or IP address::server text name
For example:
M:127.0.0.1::dancer-services
And another example:
M:10.0.0.20::dancer-services - you may have to leave in this line: I:NOMATCH::*@*::1
- I:192.168.*::x::1
- This is the syntax for the M: line:
- /etc/dancer-ircd/motd
The documentation in /usr/share/doc/dancer-ircd/ and /usr/share/doc/dancer-ircd-doc/ doesn't seem helpful with configuration.
dancer services
- /etc/dancer-ircd/ircd.conf
- C. Specify an IRC services server that the ircd server will connect to. The syntax is:
C:ircd server host name or IP address:password:IRC services server host name or IP address (see services.conf's N):optional port number:optional connection class
An example where both servers are on the same machine:
C:127.0.0.1:password:services.
And another example where both servers are on the same machine:
C:10.0.0.20:password:services. - N. Specify an IRC services server that will connect to the ircd server. The syntax is:
N:ircd server host name or IP address:MD5 encrypted password hash:IRC services server host name or IP address (see services.conf's N):optional hostmasking number:optional connection class
An example where both servers are on the same machine:
N:127.0.0.1:$1$TLm44bLT$a6nyoRMpPJHCtMWaNOpXc/:services.
And another example where both servers are on the same machine:
N:10.0.0.20:$1$TLm44bLT$a6nyoRMpPJHCtMWaNOpXc/:services.
(The MD5 encrypted password hash is created with a tool such asmakepasswd --crypt-md5 --clearfrom password-filerather than usingmd5sum, wherepassword-fileis a file containing only the selected password (don't know why but this generates a different hash each time, which are all valid, where as anything else will not work. makepasswd needs to be installed.)
- C. Specify an IRC services server that the ircd server will connect to. The syntax is:
- /etc/dancer-services/services.conf
- O. The syntax is:
O:username@host:password:nickname:privilege flags - see doc/README-FLAGS - N. The syntax is:
N:IRC services server host name or IP address (see ircd.conf's C and N):server text name (see ircd.conf's M)
An example where both servers are on the same machine:
N:services.:dancer-services - S. The syntax is:
S:password:ircd server host name or IP address
An example where both servers are on the same machine:
S:password:127.0.0.1
And another example where both servers are on the same machine:
S:password:10.0.0.20
- O. The syntax is:
- /etc/dancer-services/services.conf
Troubleshooting
dancer-ircd
/var/log/dancer-ircd/ircd.log
Dancer services
/var/log/dancer-services/services.log
Linux Terminal Server (LTSP)
Package(s)
- ? ltsp-server or ltsp-server-standalone (which is ltsp-server and dhcp3-server) rather than ltsp-utils, xdm, nfs-kernel-server and tftpd-hpa - http://www.ltsp.org
Configuration
ltspadminltspcfg- /etc/dhcp3/dhcpd.conf - DHCP configuration
- domain name
- dynamic or static IP address assignment
- for PXE booting: filename "/lts/kernel-version-ltsp-LTSP-kernel-revision-number/pxelinux.0";
tftpd-hpa- tftpd-hpa adds the following to /etc/inetd.conf:
tftp dgram udp wait root /usr/sbin/in.tftpd /usr/sbin/in.tftpd -s /var/lib/tftpboot
Replace the exported directory /var/lib/tftpboot with /tftpboot as the LTSP installer only puts the boot files in /tftpboot - If you've previously had the tftpd package installed, the replacement of it with tftpd-hpa won't update /etc/inetd.conf, in which case you may have this wrong setting in there:
tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /boot
- tftpd-hpa adds the following to /etc/inetd.conf:
- /opt/ltsp/i386/etc/lts.conf - workstation configuration (replace the /opt/ltsp with whatever is your specific LTSP location if different)
- /tftpboot/lts/kernel-version-ltsp-LTSP-kernel-revision-number/pxelinux.cfg/default - PXE booting configuration file, default version that applies to all PXE booting workstations
Once LTSP is running and you're able to login, you'll need to install a window manager and other software. We found you just install, for example, gnome, and it just works when logging in from the workstation.
(However this seems to run counter to what is described in the
Project MueKow / LTSP 5 documentation which says you need to install packages into the LTSP export directory /opt/ltsp using:
chroot /opt/ltsp/i386)
aptitude install mozilla-firefox
Further Reading
- LTSP - Linux Terminal Server Project - the main documentation from LTSP
- LTSP Wiki
Troubleshooting
- Restart inetd after editing inetd.conf, with
/etc/init.d/inetd restart - dhcpd
- Restart:
/etc/init.d/dhcpd-server restart - Log file: /var/log/syslog - watch it while booting the workstation for boot problems; if there's error messages in dhcpd.conf they'll be reported in here
- Restart:
- tftpd
- Restart:
/etc/init.d/tftpd-hpa restart
- Restart:
- sdm
- Restart:
/etc/init.d/sdm restart - ? Log file: /var/log/sdm.log
- Restart:
Bugs
- dhcpd.conf existed on our system, so when ltspcfg ran it created a .sample one, rather than over-writing our existing one. there's a comment at the top of that file that claims the live one should be called .sample. And the LTSP config file doesn't indicate it came as part of LTSP
- tftpd-hpa adds the following to /etc/inetd.conf:
tftp dgram udp wait root /usr/sbin/in.tftpd /usr/sbin/in.tftpd -s /var/lib/tftpboot
The ltspcfg option to manually configure services doesn't change this to the correct export directory; nor tell you it's wrong. - In our testing, the IBM ThinkPad R40e Broadcom 5700 network card wasn't auto detected. The error message said 'PCI devices should be auto detected, ISA devices need an 'NIC=' line sent as a kernel parameter'. This is a bug because this is a PCI card which does need its network card defining in an option sent to the kernel with 'NIC=tg3' in the append line in /tftpboot/lts/kernel-version-ltsp-LTSP-kernel-revision-number/pxelinux.cfg/default for all workstations (or, presumably, in a filename based on the IP address of the workstation, converted to hex, for specific workstations); putting it in dhcpd.conf's as an option-129 didn't work. (See http://www.linuxsolved.com/forums/archive/o_t__t_589__ltsp-4.0-network-card-detection-problem.html and http://www.etherboot.org/db/nics.php?show=tech_data&vendor=broadcom).
Bugs with documentation
- LTSP - Linux Terminal Server Project - "During the ltsp_initialize script, a sample dhcpd.conf file is installed. It is called /etc/dhcpd.conf.example you can copy that file to /etc/dhcpd.conf to use it as a basis for your dhcp configuration. You will need to modify the parts of this file that pertain to your specific workstation and server environment."
Its .sample; with Debian's dhcp3-server package the location is different so they should say '(or whichever location your distribution and DHCP server version utilises)' - LTSP - Linux Terminal Server Project - PXE boot section speaks of the PXE config file but doesn't say where it is - /tftpboot/pxelinux.cfg/default - do you have to create this manually?
- LTSP - Linux Terminal Server Project - PXE boot section gives some brief info but says no more, implying this is all you need for PXE to work. But, there's http://www.ltsp.org/README.pxe which gives a whole pile more things to do to use PXE
- README.pxe - says "Within that directory, we place the kernel, the initrd image, the pxelinux.0 bootloader and a configuration subdirectory." without saying where the kernel is (i.e. "we copy the kernel from the above directory"); what the initrd image is called and where it is (is it there already or do you have to install syslinux for that?); or the same for pxelinux.0 (either pxelinux.0 is there already or it comes with syslinux and is in /usr/lib/syslinux/pxelinux.0; somehow on my system it got into /tftpboot/lts/2.4.26-ltsp-3/pxelinux.0 and /tftpboot/lts/2.6.9-ltsp-3/pxelinux.0).
-
LTSP - Linux Terminal Server Project - "There is an NBP available for loading Linux kernels called pxelinux.0. This is part of the syslinux package from kernel developer H. Peter Anvin.
The LTSP kernel package includes the pxelinux.0 NBP and the configuration file needed to load the Linux kernel and an initial ramdisk image." - could be more helpful if it appended this with ", in the /tftpboot/lts/kernel-version-ltsp-version directory" - tftpd - you need to check if your version uses the -s switch. This is displayed in
tftpcfg- 'Show the status of all services' - tftp's 'Notes' section will say 'has '-s flag' if it does - The tftpd man page says there should be the command 'tftpd' but it is actually in.tftpd
Telephony - Asterisk
This section is incomplete.
Package(s)
- asterisk
- asterisk-doc
- ? zaptel
Webmin - web-browser GUI server administration
Project site: www.webmin.com/
Webmin isn't available in the main Debian archive for Debian 4.0 Etch because it is considered a security risk on Internet-connected servers. However for people doing system administration who aren't system administrators on servers behind firewalls Webmin is probably an essential program.
Package(s)
- perl
- openssl
- libnet-ssleay-perl
- libauthen-pam-perl
- libio-pty-perl
- libmd5-perl
- libpam-runtime
Installation
(It would be preferable to use the Webmin APT repository at http://download.webmin.com/download/repository but this is currently only available for Debian 3.1 Sarge.)
Download the Debian package directly (or by other means if you wish):
wget http://prdownloads.sourceforge.net/webadmin/webmin_<version>_all.deb
Install it (it installs in /usr/share/webmin):
dpkg -i webmin_<version>_all.deb
You can now login to Webmin at https://<your server hostname or IP address>:10000 i.e. https://server:10000, as root with your Unix root password, or as any user who can use sudo to run commands as root.
Further Information
Debian installation instructions: www.webmin.com/deb.html.
'The Book of Webmin' or 'How I Learned to Stop Worrying and Love UNIX' by Joe Cooper: www.swelltech.com/support/webminguide-1.0/
UPS - Uninterruptible Power Supply Monitoring
Package(s)
- upsd - version 2.6 - UPSD is a daemon to monitor an Uninterruptible Power Supply (UPS) connected to a computer's serial port. It will signal init(8) when the UPS is operating on battery power so that the computer can be shut down cleanly. UPSD has additional features, including network monitoring, low battery warning, and the capability of turning off the UPS during the shutdown process (if the UPS supports this). In addition it has the capability on slave systems of monitoring the remote master for the return of power in the event that only the master power has failed. A debugging and management tool is included.
Configuration
When you install the package it will automatically start it and use a sensible set of defaults, which are to monitor the first serial port and shutdown after 20 seconds of running on battery power.
Configuration for different kinds of UPS are in /etc/upsd.conf.
Upsd uses the syslog(2) facility for status reporting when running as a daemon, so its messages will be in /var/log/syslog.
Usage
? Test (with UPS attached to first serial port): upsd -t /dev/ttyS0
? Check status: cat /etc/upstatus
Troubleshooting
Log files
Error logs are kept that can help understand when something is broken.
- The operating system and many programs in general log to
- /var/log/syslog
- /var/log/messages
- /var/log/daemon.log
- /var/log/debug
- Some individual programs log to their own log files
- /var/log/<package-name>.log
- /var/log/<package-name>/
- /var/log/<package-name>/error.log
When troubleshooting a problem it can be useful to keep a command-line window open displaying a program's log file, with entries appended in real time as the file grows, using: tail -f <log-file>.