Server Setup with Debian GNU/Linux 3.1 'Sarge'
Contents
Introduction
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 Sarge; Desktop System Setup with Debian 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
0.7.24 - 22 January 2009 - package repositories changed - the main Debian archive no longer includes Sarge packages and Sarge security updates, so ftp.uk.debian.org and security.debian.org have been replaced with archive.debian.org
0.7.20 - 5 March 2008 - Added 'Network Addressing' section to 'General Configuration' section; improved 'updates' section in 'Linux kernel updates'.
0.7.19 - added 'updates' section to 'Linux kernel updates' section with examples of the different messages you're likley to see when updating.
0.7.15 - 10 December 2007 - Squirrelmail - added configuration to make use of IMAP SORT
0.7.14 - November 2007 - Added 'set no bouncemail' to Fetchmail configuration to fix issue of replying to spam email
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 in monospaced typeface indicates a command you issue at the command-line or text you type yourself into a text editor.
$ - 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
Package repositories
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 this:
deb http://archive.debian.org/debian sarge main contrib
(You can addnon-freeif you wish) - security updates - for non-intrusive security updates to packages in the stable archive - www.debian.org/security/ - use:
deb http://archive.debian.org/debian-security sarge/updates main contrib - volatile - for updates to quickly outdated software such as spam filtering and virus scanning in the stable archive - http://volatile.debian.net/ - use something like:
deb http://volatile.debian.net/debian-volatile sarge/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.net/debian-volatile/dists/sarge/volatile/. See the list of mirrors and other protocols with which to access them. - volatile-sloppy - for function enhancements to software in the stable archive akin to that in volatile
(see http://lists.debian.org/debian-devel-announce/2005/05/msg00016.html
for a description) - use something like:
deb http://volatile.debian.net/debian-volatile sarge/volatile-sloppy main contrib
You can see the files that are included at volatile.debian.net/debian-volatile/dists/sarge/volatile-sloppy/. See the list of mirrors and other protocols with which to access them
- 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 this:
- 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 sarge-backports main contrib
You can addnon-freeif you wish.
- 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'.
General configuration
Use the latest Debian 'stable' distribution (this document is for version 3.1) from http://www.debian.org/distrib/
Set the time to 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 will create the following kind of partitions:
- / i.e. 280MB
- /usr i.e. 5GB
- /var i.e. 3GB
- swap i.e. 390MB
- /tmp i.e. 399MB
- /home i.e. 31GB
You may want to locate /home on a separate disk.
You may want to manually partition like so:
| Partition No. | Partition type | Size | Mount point | File system | Usage |
|---|---|---|---|---|---|
| 1 | primary | 300MB | / | ext3 | |
| 5 | logical | min 2GB? 5GB - 7GB if use WPKG | /usr | ext3 | |
| 6 | logical | 3GB | /var | ext3 | |
| 7 | logical | 1GB max | swap | swap | |
| 8 | logical | 500MB | /tmp | ext3 | |
| 9 | logical | whatever is appropriate | /home | ext3 | User home directories |
Network Addressing
Add to /etc/network/interfaces 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
Miscellaneous
Don't install applications using Tasksel or DSelect, just install the basic system and manually install any software we specifically require or use Twix.
Download and apply any security updates using 'aptitude update' then 'aptitude dist-upgrade'
Install any diagnostic programs for network card(s)
- mii-diag - for strictly 10/100 MII hardware (includes 3Com)
- ethtool - a general network card configuration program (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
Make a rescue/boot floppy disk: mkboot
Useful Tools
- tree
- less
- wipe - securely erase files
- lynx
- nmap - network port scanner
- traceroute
- tcpdump
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
- 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 by adding
relayhost = [<your ISP's SMTP server>]to/etc/postfix/main.cf
Backup - Backup Manager
Package(s)
- backup-manager - http://www.backup-manager.org/ - good for backing up one computer to either CD-R/CD-RW/DVD-R/FTP/SSH (note that it doesn't support DVD-RW).
- backup-manager-doc - not available in Debian Sarge
Getting a newer version from Debian Backports
The version of backup-manager in Debian Sarge is 0.5.7. Newer versions of backup-manager write to a wider array of media, such as DVD rewritables. You can get a newer version of backup-manager from backports.org. Here's a reference of one of backup-manager's authors recommending doing just this. This is how you do it:
- Add this line to
/etc/apt/sources.list:deb http://www.backports.org/debian sarge-backports main contrib - Update your list of available packages:
aptitude update - Install backup-manager:
aptitude -t sarge-backports install backup-manager
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 its 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
Package(s)
- flexbackup
- afio
Usage
Schedule using /etc/crontab:
00 1 * * 1-5 root flexbackup -set home -full
From the command-line
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/my/file, giving the
path from the archive.
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.
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
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 - the web server
- apache-doc - documentation
If you instead need to use 'apache2', also install 'apache2-mpm-prefork' because "so long as you're using the prefork mpm. PHP isn't (yet) completely thread safe... it's a backend module for apache which behaves simillarly to apache 1. i.e. one child process per request."
Troubleshooting
Error log (this includes database connection errors from web applications such as egroupware): /var/log/apache/error.log
PHP - for programming databases
Package(s)
- php4
- php4-pear - further PHP functionality
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
- 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.
- 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.
- 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.4 | Author(s): David Eriksson | Licence: MIT] - zip - www.info-zip.org/Zip.html
- unzip - www.info-zip.org/UnZip.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.
mySQL - database server
Package(s)
- mysql-server - "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."
- phpmyadmin - database administration
Configuration
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'. For example:
127.0.0.1 localhost.localdomain localhost server 10.0.0.10 server.localdomain server
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:
$ 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) - 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/my.cnf (The less secure skip-networking option used to be used instead for this). This is fine for a mail server running on the same machine or phpMyAdmin but not for OpenOffice clients connecting using ODBC for instance. You can enable only remote connections to MySQL by changing bind-address to the machine's IP address or hostname. You don't seem to be able to set it to both. You can enable connections from any source by removing bind-address.
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
To reset the MySQL root password if you've lost it:
- /etc/init.d/mysql stop
- mysqld --skip-grant-tables --user=root
- Go to another terminal
- mysql -u root
- mysql> UPDATE mysql.user SET Password=PASSWORD('<your new password>') WHERE User='root';
- mysql> FLUSH PRIVILEGES;
- quit
- /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';
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 3.23, 4.0, 4.1 Reference Manual: http://dev.mysql.com/doc/refman/4.1/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'
RAID arrays
The host controller may itself provide RAID capability, in which case this 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.
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.
We use Software RAID 1 (mirroring). See 'Standard RAID levels': en.wikipedia.org/wiki/Standard_RAID_levels for a description).
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
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).
This Software RAID is usually superior to the cheap IDE (pseudo hardware) RAID controllers found on newer motherboards
but not as good as hardware RAID as on a dedicated SCSI or SATA RAID controller card.
Read this: http://www.tldp.org/HOWTO/Software-RAID-HOWTO.html#toc
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 partitioing method on each. 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 swap) either when create manually, or after 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'
- 6) set the 'Number of active devices for the RAID1 array:'
- 7) set the 'Number of spare devices for the RAID1 array:'
- 8) set the 'Active devices for the RAID1 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.
Let's see a basic example. Running mdadm --monitor --mail=root@localhost --delay=1800 /dev/md2
Is the MD driver compiled as a module or compiled into the kernel? compiled into the kernel.
Configuration files
? /etc/raid/raidtab, and a symlink from /etc/raidtab
/proc/mdstat
Usage
mdadm --query /dev/md0
mdadm --detail /dev/md0
Further Information
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
probly 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 3.1 Sarge.
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 GNU/Linux 'Testing/Etch'. or Desktop System Setup with Debian GNU/Linux 3.1 'Sarge'.
- 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
rootto connect in/etc/samba/smb.conf(Debian defaults torootbeing 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
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' 'Tutorial: ISP-style Email Service with Debian-Sarge and Postfix 2.1', at http://workaround.org/articles/ispmail-sarge/. 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, Courier POP3/IMAP, Cyrus SASL, AMaViS spam and virus detection using SpamAssassin and ClamAV.
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 of this document) and add a relay host to Postfix that will deliver mail on your behalf.
Our Debian system configuration script, Twix, version 0.2 onwards, can set this mail server up for you (but you should read the tutorial first).
Installation
Questions and recommended answers for package installation:
- Postfix: Postfix mode - Local only
- Postfix: Where should mail for root go? - ?
- Postfix: Force synchronous updates on mail queue? yes
- Courier: Configuring courier-base - Create directories for web-based administration? no
- Clam: Configuring clamav-freshclam - Virus database update method - daemon
- Clam: Configuring clamav-freshclam - Local database mirror site - db.local.clamav.net
- Clam: Configuring clamav-freshclam - Should clamd be notified after updates - Yes
Configuration
This is additional configuration to what is described at workaround.org.
Postfix
To add a relay host to Postfix that will deliver mail on your behalf add relayhost =
[<your ISP's SMTP server>] to /etc/postfix/main.cf.
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>
AMaViS
To enable the list of attachment types that will be rejected uncomment
/etc/amavis/amavisd.conf's $banned_filename_re section.
Squirrelmail
Add the Squirrelmail Apache configuration to Apache, enabling
an address such as http://server/squirrelmail to load
Squirrelmail:
ln -s /etc/squirrelmail/apache.conf /etc/apache/conf.d/squirrelmail.conf
(if you were using Apache 2 you'd instead use /etc/apache2/conf.d/squirrelmail.conf)
Configure that 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 IMAP SORT 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;
Usage
You can use either PHPMyAdmin or the command-line for any of these. Here are the command-line methods.
Domains
Create a virtual domain (you'll be asked for the MySQL root user password):
mysql -u root -p -D provider --exec="INSERT INTO domains VALUES('<domain name>')"
Mailboxes
Create a user mailbox (you'll be asked for the MySQL root user password):
mysql -u root -p -D provider \
--exec="INSERT INTO users VALUES('<mailbox name>@<domain
name>','<password>')"
Send a new user an email to initialise their mailbox:
echo -e "Welcome to your new email account.\r\nEverything should be working, let us know if it isn't." | mail -s "Welcome" <mail name>@<domain name>
Remove a user mailbox:
mysql -u root -p -D provider \
--exec="DELETE FROM users WHERE email = '<mailbox name>@<domain
name>' LIMIT 1"
Forwardings
Forwardings, AKA aliases. They are actually redirections. Use them for redirecting to both local and remote addresses. To forward to multiple addresses, separate addresses with a comma. You'll be asked for the MySQL root user password.
These use the MySQL account 'root' but you might use a different account.
To list all existing forwardings:
mysql -u root -p -D provider --exec="SELECT * from forwardings"
To redirect mail for one mail address (which may or may not actually exist) to another mail address:
mysql -u root -p -D provider \
--exec="INSERT INTO forwardings (source, destination) VALUES \
('<mailbox 1>@<domain name>','<mailbox 2>@<domain name>')"
To redirect mail to another mail address and also leave a copy in the original mailbox:
mysql -u root -p -D provider \
--exec="INSERT INTO forwardings (source, destination) VALUES \
('<mailbox 1>@<domain name>','<mailbox 1>@<domain name>,<mailbox 2>@<domain name>')"
To send mail for all the addresses at your domain for which you don't have a mailbox to a single
mailbox:
mysql -u root -p -D provider \
--exec="INSERT INTO forwardings (source, destination) VALUES \
('@<domain name>','<mailbox name>@<domain name>')"
To redirect a whole domain, use a forwarding of @my.domain to @another.domain:
mysql -u root -p -D provider \
--exec="INSERT INTO forwardings (source, destination) VALUES \
('@<domain name 1>','@<domain name 2>')"
For legal reasons you should forward email to postmaster and abuse to a specific mailbox where they
will be read:
mysql -u root -p -D provider \
--exec="INSERT INTO forwardings (source, destination) VALUES \
('postmaster@<domain name>','<mailbox name>@<domain name>'),
('abuse@<domain name>','<mailbox name>@<domain name>')"
To change an existing forwarding source:
mysql -u root -p -D provider \
--exec="UPDATE forwardings SET source =
'<new forwarding source email address>'
WHERE source = '<forwarding source email address to change>'
AND destination = '<matching forwarding destination email address>';"
To change an existing forwarding destination:
mysql -u root -p -D provider \
--exec="UPDATE forwardings SET destination = \
'<new forwarding destination email address>'
WHERE source = '<forwarding source email address to change>'
AND destination = '<matching forwarding destination email address>';"
To remove a forwarding, by its source address:
mysql -u root -p -D provider \
--exec="DELETE FROM forwardings \
WHERE source = '<forwarding source to remove>';"
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:
postsuper -d <queue ID>
(applies to hold, incoming, active and deferred queues)
Remove all messages from a particular queue:
postsuper -d ALL %lt;queue%gt;
(where queue can be hold, incoming, active or deferred)
Troubleshooting
Look at /var/log/syslog or /var/log/mail.log.
Show open ports and whether they listen on just localhost or for remote connections:
netstat -l -t -p
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.
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
Logs
Mail in general: /var/log/mail.log
AMaViS: /var/log/amavis.log - lists its capabilities and mail it's dealt with
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.
Note
Postfix defaults to not accepting mail larger than 10MB. This limit is for good reason so you probably don't want to increase it but if you do you override it with the message_size_limit parameter in /etc/postfix/main.cf
Further Information
Postfix
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: http://www.postfix.org/lists.html
Mail retrieval using Fetchmail
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
- webmin-fetchmail - webmin module, if you use webmin
- ? 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
(seperately, on a workstation) to create and edit a .fetchmailrc in the home directory of the user that runs it; fetchmailconf requires X windows.
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.
Set restrictive permissions on the fetchmail configuration file because it contains passwords:
chmod 0600 /etc/fetchmailrc
chown fetchmail /etc/fetchmailrc
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; restored missing defaults protocol pop3 # 1.1 - Pete - 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 because so much is kept set no syslog # Logging - log to the specified log file # (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 no keep # 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)
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
Usage
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 set as described in our example configuration above, you can watch the log with tail -f /var/log/fetchmail
(how do we get a log to watch as verbose a log as when using debug-run? do we have to always run in debug-run mode to get this?)
Start a debug run of the system-wide fetchmail service, optionally running it under strace: /etc/init.d/fetchmail debug-run
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)
- ssh - 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 usingdpkg-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 using /etc/init.d/slapd restart.
Linux kernel updates
Package(s)
- kernel-image
- kernel-image-<kernel-version>-<architecture>
Installation
kernel-image is a 'pseudo package' for the Linux kernel which will list the specific
kernel packages available for different kernel versions;
you should install the most recent kernel available using the actual package name in
the form kernel-image-<kernel-version>-<architecture>.
The kernel will be installed and your old kernel version retained
(if this is a kernel for '-386' that works on any x86 architecture then it gives you a fail-safe boot option in case of problems at some point),
with the new kernel set as the default in the GRUB menu (in most instances the default, but not all).
Pick the most recent version 2.6 kernel available.
You can find out which CPU you have in your system with the command cat /proc/cpuinfo,
under 'model name'.
If the Debian Installer hasn't automatically picked the specific <architecture> that matches that of your
system then you should do so -
i.e. for single CPU, 32-bit x86 (generically known as PC, i386, IA32, IA-32 or x86-32) architectures,
the following flavours are available:
- for Linux 2.4 series kernels
- 386 - optimised for all i386 compatible architectures
- 586tsc - optimised for Intel Pentium-Classic
- 686 - optimised for Intel Pentium-Pro/Celeron/Pentium II/Pentium III/Pentium 4 [and Xeon?]
- k6 - optimised for AMD K6/K6-II/K6-III
- k7 - optimised for AMD K7 (Athlon/Duron/Thunderbird)
- for Linux 2.6 series kernels
- 386 - optimised for all i386 compatible architectures
- 686 - optimised for Intel Pentium-Pro/Celeron/Pentium II/Pentium II Xeon/Pentium III/Pentium III Xeon/Pentium 4/Xeon (32-bit)
- k7 - optimised for AMD K7 (Athlon/Duron/Thunderbird)
If you have multiple processors then use the '-smp' versions of some of these which are available.
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 kernel-image-2.6.8-4-686-smp (package version 2.6.8-17) updated to package version 2.6.8-17sarge1. This is the kind of message you would see in this case:
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 kernel-image-2.6.8-3-686-smp upgraded to package kernel-image-2.6.8-4-686-smp. 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:
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
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/
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)
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.- gimp-print
- cupsys-driver-gimpprint
or ijsgimpprint - universal printer driver for non-PostScript printers.
Check the list of supported models
or use the command
man gimpprint-models. - gimpprint-doc
- gimpprint-locales - for locales other than US English; needed when you want the programs in Gimp-Print to print their messages in other languages than US English
- cupsys-driver-gimpprint
or ijsgimpprint - 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).
- 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
- 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)
- gimp-print
- Foomatic database for various print drivers
- foomatic-db-gimpprint - database for Gimp-Print 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
- foomatic-filters-ppds - these are those available individually from linuxprinting.org / http://www.linux-foundation.org/en/OpenPrinting
- PPD files for PostScript printers
- hp-ppd - PPD files for some Hewlett-Packard PostScript printers that aren't available from linuxprinting.org / http://www.linux-foundation.org/en/OpenPrinting: HP_Business_Inkjet_2250.ppd, HP_Business_Inkjet_2500C_Series.ppd, HP_ColorLaserJet_5-5M.ppd, HP_Color_LaserJet.ppd, HP_Color_LaserJet_4500.ppd, HP_Color_LaserJet_4550.ppd, HP_Color_LaserJet_8500.ppd, HP_Color_LaserJet_8550.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_1200.ppd, HP_LaserJet_2100_Series.ppd, HP_LaserJet_2200.ppd, HP_LaserJet_3200M.ppd, HP_LaserJet_4.ppd, HP_LaserJet_4000_Series.ppd, HP_LaserJet_4050_Series.ppd, HP_LaserJet_4100_Series.ppd, HP_LaserJet_4ML.ppd, HP_LaserJet_4MP.ppd, HP_LaserJet_4Si.ppd, HP_LaserJet_4V.ppd, HP_LaserJet_4_Plus.ppd, HP_LaserJet_5.ppd, HP_LaserJet_5000_Series.ppd, HP_LaserJet_5100_Series.ppd, HP_LaserJet_5P.ppd, HP_LaserJet_5Si.ppd, HP_LaserJet_5Si_Mopier.ppd, HP_LaserJet_6P.ppd, HP_LaserJet_8000_Series.ppd, HP_LaserJet_8100_Series.ppd, HP_LaserJet_8150_Series.ppd, HP_LaserJet_9000_Series.ppd, HP_Mopier_240.ppd, HP_Mopier_320.ppd, hp_LaserJet_1300_series.ppd, hp_LaserJet_2300.ppd, hp_LaserJet_4200_Series.ppd, hp_LaserJet_4300_Series.ppd, hp_business_inkjet_2250.ppd, hp_business_inkjet_2300.ppd, hp_color_LaserJet_5500.ppd, hp_color_laserjet.ppd, hp_color_laserjet_4500.ppd, hp_color_laserjet_4550.ppd, hp_color_laserjet_5m.ppd, hp_color_laserjet_8500.ppd, hp_color_laserjet_8550.ppd, hp_laserjet_1200.ppd, hp_laserjet_2100_series.ppd, hp_laserjet_2200.ppd, hp_laserjet_3020_3030.ppd, hp_laserjet_3200.ppd, hp_laserjet_3380.ppd, hp_laserjet_4.ppd, hp_laserjet_4000_series.ppd, hp_laserjet_4050_series.ppd, hp_laserjet_4100_series.ppd, hp_laserjet_4_plus.ppd, hp_laserjet_4ml.ppd, hp_laserjet_4mp.ppd, hp_laserjet_4si.ppd, hp_laserjet_4v.ppd, hp_laserjet_5mp.ppd, hp_laserjet_5si.ppd, hp_laserjet_5si_mopier.ppd, hp_laserjet_6mp.ppd, hp_laserjet_8000_series.ppd, hp_laserjet_8100_series.ppd, hp_laserjet_8150_series.ppd, hp_laserjet_9000_series.ppd, hp_laserjet_9055_9065_mfp.ppd, hp_mopier_240.ppd and hp_mopier_320.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
- The Foomatic print filter system
- printconf - auto setup for parallel and USB port printers with CUPS
- samba - add this if sharing to Windows systems
- Ink, nozzle and head utilities
- escputil - display the ink levels, clean the nozzles, and align the heads of Epson inkjet printers. From the Gimp-Print / 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. Its atleast a useful utility for a well layed-out printout.
- enscript - Converts ASCII text to Postscript, HTML, RTF or Pretty-Print. Its 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 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
- if this is a directly attached printer, attached to the USB port, choose something like:
- choose Device URI (you're only asked this 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
(see instructions)
- 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:
- if the remote printer is made available via CUPS, choose:
- 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 + Gimp-Print v4.2.7 (<language>) (despite appearances, for this choice to work you have to have previously installed the Gimp-Print 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 so that CUPS can find it, either leaving it in the same directory or you can copy it elsewhere
- Gimp-print drivers are located in
/usr/share/cups/model/gimp-print/4.2/, so you should uncompress it with the commandgzip -d /usr/share/cups/model/gimp-print/4.2/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>
- Gimp-print drivers are located in
- 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
where<device-name>is 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>orhp:/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>orsmb://<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 withsmb://username:password@but note that its available in various places in the clear)) - for a remote HP JetDirect:
socket://<IP address>:9100
- for a USB attached printer on the 1st USB port:
- 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, orAll(butAllis 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 3.1 Sarge'.
- 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, usesecurity=userorsecurity=domainin the global section ofsmb.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
show available devices or drivers: lpinfo
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
info cupsd.conf
The Official Samba-3 HOWTO and Reference Guide - Chapter 22. CUPS Printing Support - Part III. Advanced Configuration: http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/CUPS-printing.html
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/Database/Foomatic 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
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 GNU/Linux 'Sarge'' 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-utils
- dhcp3-server
- tftpd-hpa - "This is a tftp server derived from OpenBSD tftp with some extra options added. It is useful if you want to use the PXE protocol which has some non-standard requirements for tftp"
- nfs-kernel-server
- xdm
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/tftpbootwith/tftpbootas 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
/opt/ltsp/i386/etc/lts.conf- workstation configuration (replace the/opt/ltspwith 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:
- xdm
- Restart:
/etc/init.d/xdm restart - Log file:
/var/log/xdm.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 its 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 theappendline in/tftpboot/lts/kernel-version-ltsp-LTSP-kernel-revision-number/pxelinux.cfg/defaultfor 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
Graphical and remote administration using Webmin
Project site: http://www.webmin.com/
Package(s)
These are some of the modules. Only install those you want to use, as each has a dependency on the package it provides administration for:
- webmin-adsl
- webmin-apache
- webmin-bandwidth
- webmin-bind
- webmin-cluster
- webmin-burner
- webmin-dhcpd
- webmin-exim
- webmin-fetchmail
- webmin-filemanager
- webmin-firewall
- webmin-freeswan
- webmin-fsdump
- webmin-grub
- webmin-heartbeat
- webmin-htaccess
- webmin-inetd
- webmin-logrotate
- webmin-ldap-netgroups
- webmin-ldap-useradmin
- webmin-lpadmin
- webmin-lvm
- webmin-mailboxes
- webmin-mon
- webmin-mysql
- webmin-openslp
- webmin-postfix (BUG: has unmet dependencies)
- webmin-ppp
- webmin-pptp-client
- webmin-pptp-server
- webmin-proftpd
- webmin-quota
- webmin-samba
- webmin-sarg
- webmin-sentry
- webmin-smart-status
- webmin-snort
- webmin-software
- webmin-spamassassin
- webmin-squid
- webmin-sshd
- webmin-status
- webmin-stunnel
- webmin-updown
- webmin-usermin
- webmin-vgetty
- webmin-webalizer
- webmin-wvdial
Configuration
- configure for remote use:
- From the console, us the Lynx web browser to navigate to Webmin:
lynx https://localhost:10000 - Login with the system
rootaccount Choose Webmin Configuration -> IP Access Control -> add to the listed addresses- i.e. 10.0.0.0/255.255.255.0- Save
- From the console, us the Lynx web browser to navigate to Webmin:
- libnss-ldap is required for Webmin-ldap-?, does it need to be configured, with the dc?
/usr/share/libnss-ldap/ldap.confneeds the dc setting
(what about/etc/libnss-ldap.conf?)
Further Information
'The Book of Webmin' or 'How I Learned to Stop Worrying and Love UNIX' by Joe Cooper: http://www.swelltech.com/support/webminguide-1.0/
"Tune your web browser to http://file-server.localdomain/cgi-bin/man/man2html to view"
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.
Upsd uses the syslog(2) facility for status reporting when running as a daemon, so its messages will be in /var/log/syslog.
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>.