Space Menu Home Downloads Newbie Area Documentation Knowledge Base E-Training Forum Blogs Chat RPMs Farm Linux Events
HistoryHistory |
View
Code | XML |
Help
XWiki Syntax |


Administration & Server Software

Being 'root'

'root' is the most powerful account on a Linux system. Learn how to use it wisely and appropriately.

Backup

You should backup your personal files on a regular basis. Usually, each user saves his personal files in the user directory under the /home directory. All the global administrative configuration files are stored in /etc and can be written only by the root user.

Tools for backup are:

  • tar command
  • dd (device dump) command
  • partimage … save whole partitions of Ext2FS, ReiserFS, NTFS and FAT32 - This is very useful when installing the same software on many machines: just install one of them, create an image, and just restore the image on all other machines. Then, after the first one, each installation is automatically made, and only require a few minutes.

Emergency Recovery

How to cope with severe system errors.

Managing Processes

Almost everything going on in Linux is a process. Have a look at what they are and how to manage them.

Mounting

How to handle file systems in Linux.

Scheduling

How to tell your computer to do certain things at a certain time.

System Services

System services: what they are and how to control them.

Getting Organized

Config files

Do you ever have trouble remembering where the config files are for all those services you run?
Then get organized. Create a /root/config directory, sub-directories for each service you run, and symlinks for those configuration files:

For example, as root:

mkdir /root/config
cd /root/config
mkdir samba apache dns network cups sasl rsynccd samba
ln -s /etc/samba/smb.conf
ln -s /etc/samba/smbusers
ln -s /etc/lmhostscd /root/config/apache
ln -s /etc/httpd/conf/httpd2.conf
ln -s /etc/httpd/conf/commonhttpd.conf
ln -s /etc/httpd/conf/vhosts/Vhosts.confcd /root/config/dns
ln -s /etc/hosts
ln -s /etc/resolv.conf
ln -s /var/named/named.ca
ln -s /etc/named.conf
ln -s /etc/networks
ln -s /var/named/localhostcd /root/config/network
ln -s /etc/sysconfig/network-scripts/ifcfg-eth0
ln -s /etc/sysconfig/network-scripts/ifcfg-eth1
ln -s /etc/services

Now everything will be in one place the next time you configure a service. If you use an editor that creates backup files, with the '~~' suffix, you won't have them all over your filesystems.

Bash Aliases

Do you ever get tired of typing
tail /var/log/syslog
or
less /var/log/messages
?
Then get lazy1.1 Make yourself some aliases. Put these lines in /root/.bashrc.

alias tslog='/usr/bin/tail /var/log/syslog'
alias lslog='/usr/bin/less /var/log/syslog'
alias tmsg='/usr/bin/tail /var/log/messages'
alias lmsg='/usr/bin/less /var/log/messages'
alias tauth='/usr/bin/tail /var/log/auth.log'
alias lauth='/usr/bin/less /var/log/auth.log'
alias tmail='/usr/bin/tail /var/log/mail/info'
alias lmail='/usr/bin/less /var/log/mail/info'
alias tkern='/usr/bin/tail /var/log/kernel/info'
alias lkern='/usr/bin/less /var/log/kernel/info'
alias thacc='/usr/bin/tail /var/log/httpd/access_log'
alias lhacc='/usr/bin/less /var/log/httpd/access_log'
alias therr='/usr/bin/tail /var/log/httpd/error_log'
alias lherr='/usr/bin/less /var/log/httpd/error_log'
alias thsacc='/usr/bin/tail /var/log/httpd/ssl-access_log'
alias lhsacc='/usr/bin/less /var/log/httpd/ssl-access_log'
alias thserr='/usr/bin/tail /var/log/httpd/ssl-error_log'
alias lhserr='/usr/bin/less /var/log/httpd/ssl-error_log'
alias tsmb='/usr/bin/tail /var/log/samba/log.smbd'
alias lsmb='/usr/bin/less /var/log/samba/log.smbd'
alias tnmb='/usr/bin/tail /var/log/samba/log.nmbd'
alias lnmb='/usr/bin/less /var/log/samba/log.nmbd'
alias urpmi='nice -n 15 urpmi ––split-level 10 ––split-length 8'
alias rpm='nice -n 15 rpm'
alias make='nice -n 16 make'

These aliases will become new commands the next time you login. If you can't wait, type each one at the command prompt so they will also be availble in your current login session. Learn these new commands and system administration will be easier.

RSS
WebHome > KB.AdminIndex en Last Author: Flink  Date: 2006/01/17 07:46
Powered by XWiki
Copyright (c) 2006 Mandriva