eAccelerator-0.9.6安装笔记

cd tmp
wget http://bart.eaccelerator.net/source/0.9.6/eaccelerator-0.9.6.tar.bz2
tar -jxvf eaccelerator-0.9.6.tar.bz2
cd eaccelerator-0.9.6
/usr/bin/phpize
./configure --enable-eaccelerator=shared --with-php-config=/usr/bin/php-config
make
make install

(注:以上文中“phpize”以及“php-config”的路径如果不知道可以使用find命令事先查找一下。)
安装完毕编辑php.ini将其安装为 PHP extension 模式
在php.ini中添加如下:

extension="eaccelerator.so"
eaccelerator.shm_size="16"
eaccelerator.cache_dir="/tmp/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.log_file = "/var/log/httpd/eaccelerator_log"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"

最后创建/tmp/eaccelerator目录

mkdir /tmp/eaccelerator
chmod 0777 /tmp/eaccelerator

Zeus+php+Zend for Linux安装指南

Zeus+php+Zend Optimizer for Linux安装指南

本文是Crossday第一篇unix作文,基于linux而写出。zeus是一个著名的web服务器软件,其效能远在apache1/2之上,是整台服务器用户跑论坛的首选,对内存小于1G而流量非常大的用户,换用zeus会比apache多获得一倍的负载能力。
本文提供方法在redhat linux 7.3及以上各版本,PHP 4.3.0及以上版本,Zend Optimizer 2.1.0验证通过,所配置参数为适应每15分钟在线1000人以上的,使用Discuz! 2.0/3.0的中大型论坛所优化

进入一个目录 如
cd /usr/local/src

找一个zeus 4.2 r3 for linux的破解版本下载
wget http://download.discuz.net/zeus_linux.tgz

tar xvzf zeus_linux.tgz
cd Zeus.Web.Server.v4.2r3.Linux.x86/
tar xvzf Zeus_42r3_Linux-glibc2.1.tgz
cd Zeus_42r3_Linux-glibc2.1/

开始安装
./zinstall

按CTRL+C 打入accept

Where should the product be installed? [/usr/local/zeus]: 回车

Installation options:

1. Full install of both admin server & web server
2. Stand-alone install of admin server
3. Clustered install of web server
H. Help

Choose installation option [1]: 回车

Enter the key filename, or leave blank for unlicensed mode: /usr/local/src/Zeus.Web.Server.v4.2r3.Linux.x86/license.key (输入密匙位置)

Please choose a password for the admin server: ****** (输入管理员密码)
Re-enter: ****** (重新输入密码)

Would you like Zeus to start at boot time? Y/N [Y]: (回车)

以上是安装过程 很容易的就装好了 如果有apache在跑 先把他停掉 避免80端口冲突
/usr/local/apache/bin/apachectl stop

若安装中提示libdb.so.2不存在 先进入压缩包的libdb.so.2目录中
rpm -ivh db1-1.85-8.i386.rpm

安装php
cd /usr/local/src
从小日本网站下载php
wget http://cn2.php.net/get/php-4.3.4.tar.gz/from/jp2.php.net/mirror
tar xvzf php-4.3.4.tar.gz
cd php-4.3.4/
./configure –prefix=/usr/local/php –enable-fastcgi –enable-force-cgi-redirect –with-config-file-path=/etc –with-zlib –with-mysql –with-xml
make
make install
cp php.ini-dist /etc/php.ini

安装Zend Optimizer
cd /usr/local/src
wget http://download.discuz.net/ZendOptimizer-2%5B1%5D.1.0b-Linux_glibc21-i386.tar.gz
tar xvzf ZendOptimizer-2%5B1%5D.1.0b-Linux_glibc21-i386.tar.gz
cd ZendOptimizer-2.1.0b-Linux_glibc21-i386/
./install.sh
一阵回车 问Confirm the location of your php.ini file的时候打入/etc
问Are you using Apache web server?的时候选No

设置Zeus
访问 http://your.com:9090 (你的域名地址或IP地址)
用户名 admin 密码:刚才设定的密码

进入Zeus管理控制台,点Create a Virtual Server 把相关的六个选项填好 不多说
提交后出现刚才加入的virtual server,点FastCGI

Enabling Support for FastCGI Programs 选 Enabled
Restricting FastCGI locations 选 Enable FastCGI programs to be located anywhere
Configuring Directories for FastCGI Local Responders 不用写他 因为我们用remote方式连接fastcgi

Configuring FastCGI Remote Responders 中填入以下配置
Directory name : /usr/local/php/bin/php
Location: Machine name: localhost
Port: 8002
Additional methods supported?:None

其他都不用管,点Apply changes

点左边Url Handling下面的Handlers
File Extension : php
Specify the path and filename of the handler, relative to the document root : /usr/local/php/bin/php
点Apply changes

点左边Url Handling下面的Directory Requests
Index Files中加入一个 index.php 和一分隔逗号
Directory Listing选Disabled
点Apply changes

再点上面的 This configuration has been modified. Click here for details or to make it take effect.
出来的页面点Commit

配置php-fastcgi
cd /usr/local/zeus/rc.d
建立一个S05php的文件 内容为

#!/bin/sh

# Script to start and stop the persistent PHP runner for FastCGI.
# Please check paths before use.

# FastCGI PHP binary
FPHPBIN=/usr/local/php/bin/php

# Location to place semaphore
SEMFILE=/tmp/php.pid
PHP_FCGI_CHILDREN=200
PHP_FCGI_MAX_REQUESTS=1000
export PHP_FCGI_CHILDREN
export PHP_FCGI_MAX_REQUESTS

# This is Linux – use /proc to increase the local (ephemeral) port range
#echo 1024 65000 > /proc/sys/net/ipv4/ip_local_port_range

if [ -z "$ZEUSHOME" ]
then
cd `dirname $0`/..
ZEUSHOME=`pwd`
export ZEUSHOME
fi

case “$1″ in
’start’)

if [ -e $SEMFILE ]
then
echo FastCGI PHP error: already running.Restart FastCGI PHP now
kill `cat $SEMFILE`
sleep 5
fi

if [ ! -x $FPHPBIN ]
then
echo FastCGI PHP error: please check that $FPHPBIN is executable and exists.
exit 1
fi

echo Starting FastCGI PHP.
$ZEUSHOME/web/bin/fcgirunner –user=99 –group=99 –pidfile=$SEMFILE 8002 $FPHPBIN
;;

’stop’)
if [ -e $SEMFILE ]
then
echo Stopping FastCGI PHP.
kill `cat $SEMFILE`
rm $SEMFILE
exit 0
fi
;;
‘restart’)
if [ -e $SEMFILE ]
then
echo Stopping FastCGI PHP.
kill `cat $SEMFILE`
sleep 5
fi
echo Starting FastCGI PHP.
$ZEUSHOME/web/bin/fcgirunner –user=99 –group=99 –pidfile=$SEMFILE 8002 $FPHPBIN
;;
*)
echo “usage: $0 {start|stop|restart}”
;;

esac
exit 1

注意–user=65534 –group=65534 为php进程运行的用户和组,一般设置为nobody用户和组FreeBSD是65534/65534,Linux是99/99

如不会建文件 可看下面范例
vi S05php
(打一个小写的i)
(把上面的内容复制到剪贴板 然后按SHIFT+INSERT粘贴过去)
(按ESC)
(输入 :wq 然后回车)

改写属性使其可执行
chmod 755 S05php

回到Zeus的9090端口管理界面 把刚才设置的虚拟主机Start

启动Zeus的命令为 /usr/local/zeus/start-zeus
停止Zeus的命令为 /usr/local/zeus/stop-zeus
重启Zeus的命令为 /usr/local/zeus/restart-zeus

编辑/etc/rc.local
加入一行
/usr/local/zeus/start-zeus
使得Zeus在开机时自动运行

如果现在无法访问web,多半是因为没有把apache停掉造成的,注意要将启动时候的apache自启动给去掉 否则zeus无法绑定到80端口进而无法访问 如没有上述问题 安装后仍然无法访问 可能为web服务器没有正确安装 例如第一次安装后中断退出 第二次又以升级方式安装 等等 这样的情况建议先把zeus停掉 然后将其目录rm -fr删除 重新安装一次即可正常 个人以为这是zeus安装脚本设计的不合理所致

Linux的配置与优化

Linux作为一个免费的类似UNIX的操作系统,正日益受到人们的重视。本人作为一名Linux爱好者,出于学习,比较了各种不同的Linux发行套件,安装过各种Linux的发行套件,但是每一次安装完成,大量的配置与优化工作花费笔者许多时间,并且非常容易遗漏一些细节。本文以安装与使用RedHat 6.1为例,参考了/usr/doc/HOWTO/Config-HOWTO文档,结合自己的工作经验,谈一些自己的做法。以下的做法基本上适合各种liunx发行套件。

一、关于硬盘分区
关于安装Linux如何建立硬盘分区、交换分区等问题,已经超出本文范围,但是我的经验是安装Linux时一定要建立单独的分区,用于存储用户的私人数据,同时可以用于备份系统的配置文件(如像域名服务器,Samba的配置文件等),便于以后配置。

二、编辑/etc/inittab文件
大部分Linux的发行套件都建立六个虚拟控制台,实际上三个已经足够,并且可以节省可贵的内存空间。编辑/etc/inittab文件,在下面三行的前面加上#。
4:2345:respawn:/sbin/mingetty tty4
5:2345:respawn:/sbin/mingetty tty5
6:2345:respawn:/sbin/mingetty tty6
然后执行init q,使系统重新读取/etc/inittab文件,关闭tty4、tty5、tty6虚拟控制台。如果不考虑系统的安全,你可以利用第四个虚拟控制台来查看各种系统信息,编辑/etc/syslog.conf文件,在最后一行加入:
*.* /dev/tty4
最后再执行killall -HUP syslog。

三、建立或者编辑/etc/inputrc、/etc/profile、/etc/bashrc文件
虽然最近几年个人计算机的潮流已经从命令行方式转向图形方式,采用鼠标操作,但是shell在Linux中依然有很强的生命力。shell有好几种,主要有bash、ksh、tcsh、zsh、ash, 用得最多的是bash。只要编辑/etc/inputrc文件,设置INPUTRC的环境变量,利用Tab键的命令补全功能,就可以实现类似于MSDOS的DOSKEY的功能。这样对文件与目录的各种操作,也一样方便与快捷。(附/etc/inputrc文件)
__________________________________________________________________
set bell-style none # don’t beep
set meta-flag on # allow 8-bit input
set convert-meta off # don’t strip 8-bit characters
set output-meta on # display 8-bit characters correctly
set horizontal-scroll-mode On # scroll long command lines
set show-all-if-ambiguous On # after TAB is pressed

“\e[1~": beginning-of-line # home
"\e[2~": insert-last-argument # insert
"\e[3~": delete-char # delete
"\e[4~": end-of-line # end
"\e[5~": backward-kill-word # page up
"\e[6~": kill-word # page down

# define F7 F8 like msdos doskey
"\e[18~": history-search-forward # F7
"\e[19~": history-search-backward # F8
__________________________________________________________________

编辑/etc/profile文件,在其尾部插入下面内容:
_________________________________________________
# add by zws
# customize less
#LESS='-M-Q-r'
PS1="[\u@\h \w]\\$ ”
INPUTRC=/etc/inputrc
LESS=’-M-r’ # -r 为了ls | less 支持彩色。
LESSEDIT=”%E ?lt+%lt. %f”
LESSOPEN=”| lesspipe.sh %s”
LESSCHARSET=latin1
PAGER=less
export LESS LESSEDIT LESSOPEN LESSCHARSET INPUTRC
_________________________________________________

建立/usr/bin/lesspipe.sh文件,内容如下:
__________________________________________________________________________
#!/bin/sh
# This is a preprocessor for ‘less’. It is used when this environment
# variable is set: LESSOPEN=”|lesspipe.sh %s”
lesspipe() {
case “$1″ in
*.tar.bz2) bzip2 -cd $1 $1 2>/dev/null | tar tvvf – ;;
*.tar) tar tf $1 2>/dev/null ;; # View contents of .tar and .tgz files
*.tgz|*.tar.gz|*.tar.Z|*.tar.z) tar ztf $1 2>/dev/null ;;
*.Z|*.z|*.gz) gzip -dc $1 2>/dev/null ;; # View compressed files correctly
*.zip) unzip -l $1 2>/dev/null ;; # View archives
*.arj) unarj l $1 2>/dev/null ;;
*.rpm) rpm -qpil $1 2>/dev/null ;;
*.cpio) cpio –list -F $1 2>/dev/null ;;
*.bz2) bzip2 -dc $1 2>/dev/null ;; # View compressed files correctly
*.1|*.2|*.3|*.4|*.5|*.6|*.7|*.8|*.9|*.n|*.l|*.man) FILE=`file -L $1`
FILE=`echo $FILE | cut -d ‘ ‘ -f 2`
if [ "$FILE" = "troff" ]; then
groff -s -p -t -e -Tascii -mandoc $1
fi ;;
*) file $1 | grep text > /dev/null ;
if [ $? = 1 ] ; then # it’s not some kind of text
strings $1
fi ;;
esac
}
lesspipe $1
_________________________________________________________________这样就可以使用less查看以上文件格式的信息与内容。
注意要利用chmod 755 /usr/bin/lesspipe.sh命令将此文件设置为可执行!
/etc/bashrc文件的例子:
____________________________________________
# /etc/bashrc

# System wide functions and aliases
# Environment stuff goes in /etc/profile

# For some unknown reason bash refuses to inherit
# PS1 in some circumstances that I can’t figure out.
# Putting PS1 here ensures that it gets loaded every time.
# PS1=”[\u@\h \w]\\$ ”

eval `dircolors -b`
alias ls=’ls –color=yes -F -N’ # ls 支持彩色
alias l=’ls –color=yes -l -F -N’ # l
alias cp=’cp -i’
alias mv=’mv -i’
alias rm=’rm -i’
alias df=’df -h’
alias ln=’ln -i’
lrpm() # list information on an .rpm file
{
if [ $# != 0 ]; then rpm -qilf `which $1` | less; fi
}
lsrpm() # list information on an .rpm file
{
if [ $# != 0 ]; then rpm -qif `which $1` | less; fi
}
set -o noclobber # 避免覆盖与重写文件
____________________________________________

四、编辑/etc/rc.local文件
如果需要定制自己的登录信息,注意要修改/etc/rc.d/rc.local文件,因为每次执行/etc/rc.d/rc.local文件,都需要修改/etc/issue与/etc/issue.net文件,可以注解掉这些命令,编辑定制自己的/etc/issue文件,加快Linux引导过程,并且加入以下内容:
echo “base=0xd8000000 size=0×800000 type=write-combining” >> /proc/mtrr
# Enable NumLock
for tty in /dev/tty[1-3]; do
setleds -D +num < $tty
done
说明:关于第一行命令请看/usr/src/linux/Documentation/mtrr.txt文件。

五、定制vim的环境
在Linux环境中,有许多编辑器,主要有emacs、vim、joe等,对于从没有使用过UNIX或者Linux的人,我的建议是最好找几本有关的参考书,先了解这些编辑器的使用方法,这样安装好Linux后,在编辑与查看一些配置文件时,不至于茫然不知所措。特别是vi,一开始难以掌握,最好开始能够得到高手的指点,一旦上手,简直就像驾驶一辆高速奔驰的赛车,初学者可以到ftp://ftp.cs.pdx.edu/pub/elvis或者http://www.vim.org下载相应的版本,它提供支持MSDOS、Windows 98等操作系统的版本,解压后就可以在自己熟悉的环境学习与使用vi。
以下是/usr/share/vim/vimrc的例子:
___________________________________________________________
“” (for Chinese)
” Set file encoding format as ‘prc’ for Simplified Chinese
” Valid values for ’set fe=’ is ansi, japan, korea, prc, taiwan
” We set fe to prc for default, if you need single-byte editing,
” just type ‘:set fe=ansi’ will do the work.

set fe=prc

“” (for Chinese)
“” Set ruler on, you must set this to ensure
“” the Chinese functionality of gvim
set ru

“” For syntax color
if &term==”xterm”
set term=rxvt
set t_Co=8
set t_Sb=^[4%dm
set t_Sf=^[3%dm
endif
syntax on

“” Set visual bell and disable screen flash
” :set vb t_vb=

set bs=2

“” Toggle on/off highlightsearch
map <F8> :set hls!<bar>set hls?<cr>

“” Toggle on/off paste mode
map <F9> :set paste!<bar>set paste?<cr>

“” You can toggle the syntax on/off with this command
if has(“syntax_items”) | syntax off | else | syntax on | endif
map <F7> :if has(“syntax_items”) <Bar> syntax off <Bar> else <Bar> syntax on <Bar> endif <CR>

“” Set non-compatible with vi
set nocompatible

“” Set backup extension
” set backup
” set backupext=.bak

” add by zws
set autoindent
set ignorecase
set shiftwidth=4
set showmode
set tabstop=4
set nowrap
“if &t_Co > 1
” syntax on
“endif
“” Map for parenthesis matching
map \ %
“” search English word
map <F3> <Esc>:set keywordprg=/usr/local/bin/cdict<Esc>K<Esc>:set keyword=man<CR>
map <F6> <Esc>:set keywordprg=man<Esc>K
” backspace
map <BS> X
___________________________________________________________

六、编辑/etc/mtools.conf文件
一般情况下,都是在自己的机器安装Windows 98与Linux两种操作系统,通过安装mtools包,可以不用安装相应的文件系统,允许在MSDOS、Windows 98与Linux的文件系统之间,实现文件的读、写、移动、显示等操作。假设Windows 98安装在/dev/hda1、/dev/hda5分区下,修改/etc/mstools.conf文件,加入以下内容:
drive c: file=”/dev/hda1″
drive d: file=”/dev/hda5″
这样就可以执行mdir c:等命令。

七、拷贝各种配置文件
根据机器的用途,编辑拷贝相应的配置文件,例如:samba的配置文件/etc/smb.conf,域名服务器的配置文件,DHCP的配置文件/etc/dhcpd.conf等文件,在一般情况下,这些文件一旦配置好,很少发生改动,这样可以节约许多时间,注意原来的配置文件一定要做好备份,如果配置文件发生改动也要做好备份!

八、编译Linux内核
一般各种Linux系统套件安装的内核,都适合大部分的机器,但缺点是大而全,模块中包含有许多自己根本不需要的模块。只有根据自己的要求及机器硬件配置,来配置内核才能达到最优配置。注意在编译内核前,一定要对自己机器有一个全面的了解,这样才能做到心中有数。

以下是编译内核的简要步骤:(以redhat6.1为例说明)
1.进入/usr/src/linux,编辑Makefile文件,修改EXTRAVERSION= -xx,其中xx表示编译的版本号,最好用数字,并且大于原来的数值。
2.根据自己机器的硬件配置,选择相应的选项来配置内核。
#make menuconfig
3.理顺各文件的依存关系,清理以前生成的目标文件及其他文件。
#make clean ; make dep
4.编译内核与安装,并且安装模块。
#make bzImage
#make modules; make modules_install
5.安装内核。
# cp arch/i386/boot/bzImage /boot/vmlinuz-y.y.yy-xx
将内核复制到/boot目录下,其中y.y.yy表示Linux版本号,xx表示编译的版本号。
# cp System.map /boot/System.map-y.y.yy-xx
# cd /boot
# ln -s System.map-y.y.yy-xx System.map
6.编辑lilo的配置文件/etc/lilo.conf(略)。
注意最好保留原来的内核,这样如果新建的内核引导Linux不成功,可以利用旧的内核引导Linux操作系统。
7.测试新内核。
引导完成后,注意检查/lib/modules/y.y.yy-xx目录下,是否建立modules.dep文件。如果文件存在,可以修改/etc/rc.d/rc.sysinit,将有关执行模块依赖的命令的内容注解掉,这样可以加快Linux的启动过程。

Linux系统中网络配置详解

从linux诞生的那一天起,就注定了它的网络功能空前地强大.所以在linux系统中如何配置网络,使其高效,安全的工作就显得十分重要.下面我们就从网络设备的安装,网络服务的设置和网络安全性三个方面来介绍一下linux系统中网络的设置.

一.安装和配置网络设备

  在安装linux时,如果你有网卡,安装程序将会提示你给出tcp/ip网络的配置参数,如本机的ip地址,缺省网关的ip地址,DNS的ip地址等等.根据这些配置参数,安装程序将会自动把网卡(linux系统首先要支持)驱动程序编译到内核中去.但是我们一定要了解加载网卡驱动程序的过程,那么在以后改变网卡,使用多个网卡的时候我们就会很容易的操作.网卡的驱动程序是作为模块加载到内核中去的,所有linux支持的网卡驱动程序都是存放在目录/lib/modules/(linux版本号)/net/ ,例如inter的82559系列10/100M自适应的引导网卡的驱动程序是eepro100.o,3COM的3C509 ISA网卡的驱动程序是3C509.o,DLINK的pci 10网卡的驱动程序是via-rhine.o,NE2000兼容性网卡的驱动程序是ne2k-pci.o和ne.o.在了解了这些基本的驱动程序之后,我们就可以通过修改模块配置文件来更换网卡或者增加网卡.

  1. 修改/etc/conf.modules 文件
  这个配置文件是加载模块的重要参数文件,大家先看一个范例文件
  #/etc/conf.modules
  alias eth0 eepro100
  alias eth1 eepro100
  这个文件是一个装有两块inter 82559系列网卡的linux系统中的conf.modules中的内容.alias命令表明以太口(如eth0)所具有的驱动程序的名称,alias eth0 eepro100说明在零号以太网口所要加载的驱动程序是eepro100.o.那么在使用命令 modprobe eth0的时候,系统将自动将eepro100.o加载到内核中.对于pci的网卡来说,由于系统会自动找到网卡的io地址和中断号,所以没有必要在conf.modules中使用选项options来指定网卡的io地址和中断号.但是对应于ISA网卡,则必须要在conf.modules中指定硬件的io地址或中断号, 如下所示,表明了一块NE的ISA网卡的conf.modules文件.
  alias eth0 ne
  options ne io=0×300 irq=5
  在修改完conf.modules文件之后,就可以使用命令来加载模块,例如要插入inter的第二块网卡:
  #insmod /lib/modules/2.2.14/net/eepro100.o
  这样就可以在以太口加载模块eepro100.o.同时,还可以使用命令来查看当前加载的模块信息:
  [root@ice /etc]# lsmod
  Module Size Used by
  eepro100 15652 2 (autoclean)
  返回结果的含义是当前加载的模块是eepro100,大小是15652个字节,使用者两个,方式是自动清除.

  2. 修改/etc/lilo.conf文件
  在一些比较新的linux版本中,由于操作系统自动检测所有相关的硬件,所以此时不必修改/etc/lilo.conf文件.但是对于ISA网卡和老的版本,为了在系统初始化中对新加的网卡进行初始化,可以修改lilo.conf文件.在/etc/lilo.conf文件中增加如下命令:
  append=”ether=5,0×240,eth0 ether=7,0×300,eth1″
  这条命令的含义是eth0的io地址是0×240,中断是5,eth1的io地址是0×300,中断是7.
  实际上,这条语句来自在系统引导影像文件时传递的参数,
  LILO: linux ether=5,0×240,eth0 ether=7,0×300,eth1
  这种方法也同样能够使linux系统配置好两个网卡.类似的,在使用三个以上网卡的时候,也可以依照同样的方法.
  在配置好网卡之后,就应该配置TCP/IP的参数,在一般情况下,在安装linux系统的同时就会提示你配置网络参数.但是之后如果我们想要修改网络设置,可以使用如下的命令:
  #ifconfig eth0 A.B.C.D netmask E.F.G.H
  A.B.C.D 是eth0的IP地址,E.F.G.H是网络掩码.
  其实,在linux系统中我们可以给一块网卡设置多个ip地址,例如下面的命令:
  #ifconfig eth0:1 202.112.11.218 netmask 255.255.255.192
  然后,使用命令#ifconfig -a 就可以看到所有的网络接口的界面:
  eth0   Link encap:Ethernet HWaddr 00:90:27:58:AF:1A
       inet addr:202.112.13.204 Bcast:202.112.13.255 Mask:255.255.255.192
       UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
       RX packets:435510 errors:0 dropped:0 overruns:0 frame:2
       TX packets:538988 errors:0 dropped:0 overruns:0 carrier:0
       collisions:318683 txqueuelen:100
       Interrupt:10 Base address:0xc000

  eth0:1  Link encap:Ethernet HWaddr 00:90:27:58:AF:1A
       inet addr:202.112.11.218 Bcast:202.112.11.255 Mask:255.255.255.192
       UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
       Interrupt:10 Base address:0xc000

  lo    Link encap:Local Loopback
       inet addr:127.0.0.1 Mask:255.0.0.0
       UP LOOPBACK RUNNING MTU:3924 Metric:1
       RX packets:2055 errors:0 dropped:0 overruns:0 frame:0
       TX packets:2055 errors:0 dropped:0 overruns:0 carrier:0
       collisions:0 txqueuelen:0
  我们看到网络接口有三个,eth0 , eth0:1,lo,eth0是真实的以太网络接口,eth0:1和eth0是同一块网卡,只不过绑定了另外的一个地址,lo是会送地址。eth0和eth0:1可以使用不同网段的ip地址,这在同一个物理网段却使用不同的网络地址的时候十分有用。
  另外,网卡有一种模式是混杂模式(prosimc),在这个模式下,网卡将会接收网络中所有的数据包,一些linux下的网络监听工具例如tcpdump,snort等等都是把网卡设置为混杂模式.
  ifconfig命令可以在本次运行的时间内改变网卡的ip地址,但是如果系统重新启动,linux仍然按照原来的默认的设置启动网络接口。这时候,可以使用netconfig或netconf命令来重新设置默认网络参数。netconfig 命令是重新配置基本的tcp/ip参数,参数包括是否配置为动态获得ip地址(dhcpd和bootp),网卡的ip地址,网络掩码,缺省网关和首选的域名服务器地址。netconf命令可以详细的配置所有网络的参数,分为客户端任务,服务器端任务和其他的配置三个部分,在客户端的配置中,主要包括基本主机的配置(主机名,有效域名,网络别名,对应相应网卡的ip地址,网络掩码,网络设备名,网络设备的内核驱动程序),DNS地址配置,缺省网关的地址配置,NIS地址配置,ipx接口配置,ppp/slip的配置等等。在服务器端配置中,主要包括NFS的配置,DNS的配置,ApacheWebServer配置,Samba的配置和Wu-ftpd的配置。在其他的配置选项中,一个是关于/etc/hosts文件中的主机配置,一个是关于/etc/networks文件中的网络配置信息,最后是关于使用linuxconf配置的信息。
  在linuxconf命令下,同样也可以配置网络信息,但是大家可以发现,linuxconf程序是调用netconf来进行网络配置的。
  另外,在/etc/sysconfig/network-scripts目录下存放着系统关于网络的配置文件,范例如下:

  ifcfg-eth0*  ifdown-post*  ifup-aliases*  ifup-ppp*
  ifcfg-eth1*  ifdown-ppp*   ifup-ipx*    ifup-routes*
  ifcfg-lo*   ifdown-sl*   ifup-plip*    ifup-sl*
  ifdown@    ifup@      ifup-post*    network-functions

  ifcfg-eth0是以太口eth0的配置信息,它的内容如下:

  DEVICE=”eth0″              /*指明网络设备名称*/
  IPADDR=”202.112.13.204″         /*指明网络设备的ip地址*/
  NETMASK=”255.255.255.192″        /*指明网络掩码*/
  NETWORK=202.112.13.192         /*指明网络地址*/
  BROADCAST=202.112.13.255         /*指明广播地址*/
  ONBOOT=”yes”               /*指明在系统启动时是否激活网卡*/
  BOOTPROTO=”none”             /*指明是否使用bootp协议*/
  
  所以,我们也可以修改这个文件来进行linux下网络参数的改变。

二 网络服务的配置:

  在这一部分,我们并不是详细的介绍具体的网络服务器(DNS,FTP,WWW,SENDMAIL)的配置(那将是巨大的篇幅),而是介绍一下与linux网络服务的配置相关的文件.

1. LILO的配置文件
  在linux系统中,有一个系统引导程序,那就是lilo(linux loadin),利用lilo可以实现多操作系统的选择启动.它的配置文件是/etc/lilo.conf.在这个配置文件中,lilo的配置参数主要分为两个部分,一个是全局配置参数,包括设置启动设备等等.另一个是局部配置参数,包括每个引导影像文件的配置参数.在这里我就不详细介绍每个参数,特别的仅仅说明两个重要的参数——–password和restricted选项,password选项为每个引导的影像文件加入口令保护.我们都知道,在linux系统中有一个运行模式是单用户模式,在这个模式下,用户是以超级用户的身份登录到linux系统中.人们可以通过在lilo引导的时候加入参数(linux single 或linux init 0)就可以不需要口令直接进入单用户模式的超级用户环境中,这将是十分危险的.所以在lilo.conf中增加了password的配置选项来为每个影像文件增加口令保护.你可以在全局模式中使用password选项(对所有影像文件都加入相同的口令),或者为每个单独的影像文件加入口令.这样一来,在每次系统启动时,都会要求用户输入口令.也许你觉得每次都要输入口令很麻烦,可以使用restricted选项,它可以使lilo仅仅在linux启动时输入了参数(例如 linux single)的时候才会检验密码.这两个选项可以极大的增加系统的安全性,建议在lilo.conf文件中设置它们.由于password在/etc/lilo.conf文件是以明文存放的,所以必须要将/etc/lilo.conf文件的属性改为仅仅root可读(0400).
  另外,在lilo的早期版本中,存在着引导扇区必须存放到前1024柱面的限制,在lilo的2.51版本中已经突破了这个限制,同时引导界面也变成了图形界面更加直观.最新版本的下载站点:
  ftp://166.111.136.3/pub/linux/lilo/lilo-2.51.tar.gz
  下载解压后,使用命令make install即可完成安装.
  注意: 物理安全才是最基本的安全,即使在lilo.conf中增加了口令保护,如果没有物理安全,恶意闯入者可以使用启动软盘启动linux系统.

2. 域名服务的配置文件
  (1)/etc/HOSTNAME 在这个文件中保存着linux系统的主机名和域名.范例文件

  ice.xanet.edu.cn

  这个文件表明了主机名ice,域名是xanet.edu.cn
  (2)/etc/hosts和/etc/networks文件 在域名服务系统中,有着主机表机制,/etc/hosts和/etc/networks就是主机表发展而来在/etc/hosts中存放着你不需要DNS系统查询而得的主机ip地址和主机名的对应,下面是一个范例文件:
  # ip 地址 主机名 别名
  127.0.0.1      localhosts        loopback
  202.117.1.13    www.xjtu.edu.cn     www
  202.117.1.24     ftp.xjtu.edu.cn      ftp

  在/etc/networks 中,存放着网络ip地址和网络名称的一一对应.它的文件格式和/etc/hosts是类似的
  (3)/etc/resolv.conf 这个文件是DNS域名解析器的主要配置文件,它的格式十分简单,每一行由一个主关键字组成./etc/resolv.conf的关键字主要有:
  domain   指明缺省的本地域名,
  search   指明了一系列查找主机名的时候搜索的域名列表,
  nameserver 指明了在进行域名解析时域名服务器的ip地址.下面给出一个范例文件:

  #/etc/resolv.conf
  domain    xjtu.edu.cn
  search    xjtu.edu.cn edu.cn
  nameserver  202.117.0.20
  nameserver  202.117.1.9

  (4)/etc/host.conf 在系统中同时存在着DNS域名解析和/etc/hosts的主机表机制时,由文件/etc/host.conf来说明了解析器的查询顺序.范例文件如下:

  #/etc/host.conf
  order hosts,bind     #解析器查询顺序是文件/etc/hosts,然后是DNS
  multi on         #允许主机拥有多个ip地址
  nospoof on        #禁止ip地址欺骗

3. DHCP的配置文件
  /etc/dhcpd.conf是DHCPD的配置文件,我们可以通过在/etc/dhcpd.conf文件中的配置来实现在局域网中动态分配ip地址,一台linux主机设置为dhcpd服务器,通过鉴别网卡的MAC地址来动态的分配ip地址.范例文件如下:

  option domain-name “chinapub.com”;
  use-host-decl-names off;
  subnet 210.27.48.0 netmask 255
  }

  在这个文件中,最主要的是通过设置的硬件地址来鉴别局域网中的主机,并分配给它指定的ip地址,hardware ethernet 00:02:b3:11:f2:30指定要动态分配ip的主机得网卡的MAC地址,fixed-address 210.27.48.8指定分配其ip地址。filename “/tmp/image”是通过tftp服务,主机所要得到的影像文件,可以通过得到的影像文件来引导主机启动。

4. 超级守候进程inetd的配置
  在linux系统中有一个超级守候进程inetd,inetd监听由文件/etc/services指定的服务的端口,inetd根据网络连接请求,调用相应的服务进程来相应请求.在这里有两个文件十分重要,/etc/inetd.conf和/etc/services,文件/etc/services定义linu系统中所有服务的名称,协议类型,服务的端口等等信息,/etc/inetd.conf是inetd的配置文件,由它来指定那些服务可以由inetd来监听,以及相应的服务进程的调用命令.首先介绍一下/etc/services文件,/etc/services文件是一个服务名和服务端口对应的数据库文件,如下面所示:
# /etc/services:
# $Id: services,v 1.4 2000/01/23 21:03:36 notting Exp $
#
# Network services, Internet style
#
# Note that it is presently the policy of IANA to assign a single well-known
# port number for both TCP and UDP; hence, most entries here have two entries
# even if the protocol doesn’t support UDP operations.
# Updated from RFC 1700, “Assigned Numbers” (October 1994). Not all ports
# are included, only the more common ones.
#名称    端口/协议     别名        注释
tcpmux    1/tcp                # TCP port service multiplexer
echo     7/tcp
echo     7/udp
discard   9/tcp      sink null
discard   9/udp      sink null
systat   11/tcp      users
daytime   13/tcp
daytime   13/udp
netstat   15/tcp
qotd     17/tcp      quote
msp     18/tcp                 # message send protocol
msp     18/udp                 # message send protocol
chargen   19/tcp     ttytst source
chargen   19/udp     ttytst source
ftp-data   20/tcp
ftp     21/tcp
fsp    21/udp      fspd
ssh     22/tcp                 # SSH Remote Login Protocol
ssh    22/udp                 # SSH Remote Login Protocol
telnet   23/tcp
# 24 – private
smtp    25/tcp      mail
# 26 – unassigned
time    37/tcp     timserver
time    37/udp      timserver
rlp     39/udp      resource         # resource location
nameserver 42/tcp      name           # IEN 116
whois    43/tcp      nicname
re-mail-ck  50/tcp                  # Remote Mail Checking Protocol
re-mail-ck 50/udp                   # Remote Mail Checking Protocol
domain    53/tcp     nameserver         # name-domain server
domain   53/udp     nameserver
mtp     57/tcp                   # deprecated
bootps    67/tcp                   # BOOTP server
bootps    67/udp
bootpc    68/tcp                   # BOOTP client
bootpc    68/udp
tftp     69/udp
gopher    70/tcp # Internet Gopher
gopher    70/udp
rje     77/tcp netrjs
finger    79/tcp
www     80/tcp     http             # WorldWideWeb HTTP
www     80/udp                    # HyperText Transfer Protocol
link     87/tcp     ttylink
kerberos   88/tcp     kerberos5 krb5        # Kerberos v5
kerberos   88/udp     kerberos5 krb5        # Kerberos v5
supdup   95/tcp
# 100 – reserved
hostnames  101/tcp     hostname           # usually from sri-nic
iso-tsap  102/tcp     tsap             # part of ISODE.
csnet-ns  105/tcp     cso-ns             # also used by CSO name server
csnet-ns  105/udp     cso-ns
rtelnet   107/tcp                    # Remote Telnet
rtelnet   107/udp
pop2     109/tcp    pop-2 postoffice        # POP version 2
pop2     109/udp    pop-2
pop3     110/tcp    pop-3              # POP version 3
pop3     110/udp    pop-3
sunrpc    111/tcp   portmapper            # RPC 4.0 portmapper TCP
sunrpc    111/udp   portmapper            # RPC 4.0 portmapper UDP
auth     113/tcp   authentication tap ident
sftp     115/tcp
uucp-path   117/tcp
nntp     119/tcp    readnews untp          # USENET News Transfer Protocol
ntp      123/tcp
ntp      123/udp                   # Network Time Protocol
netbios-ns   137/tcp                   # NETBIOS Name Service
netbios-ns   137/udp
netbios-dgm   138/tcp                   # NETBIOS Datagram Service
netbios-dgm   138/udp
netbios-ssn   139/tcp                   # NETBIOS session service
netbios-ssn   139/udp
imap2      143/tcp   imap               # Interim Mail Access Proto v2
imap2      143/udp   imap

(实际上,以上仅仅是/etc/services的一部分,限于篇幅没有全部写出)
在这个文件中,为了安全考虑,我们可以修改一些常用服务的端口地址,例如我们可以把telnet服务的端口地址改为52323,www的端口改为8080,ftp端口地址改为2121等等,这样仅仅需要在应用程序中修改相应的端口即可.这样可以提高系统的安全性.
/etc/inetd.conf文件是inetd的配置文件, 首先要了解一下linux服务器到底要提供哪些服务。一个很好的原则是” 禁止所有不需要的服务”,这样黑客就少了一些攻击系统的机会./etc/inetd.conf范例文件如下:
#
# inetd.conf    This file describes the services that will be available
#          through the INETD TCP/IP super server. To re-configure
#          the running INETD process, edit this file, then send the
#          NETD process a SIGHUP signal.
#
# Version:    @(#)/etc/inetd.conf   3.10   05/27/93
#
# Authors:    Original taken from BSD UNIX 4.3/TAHOE.
#         Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
#
# Modified for Debian Linux by Ian A. Murdock <imurdock@shell.portal.com>
#
# Modified for RHS Linux by Marc Ewing <marc@redhat.com>
#
# <service_name> <sock_type> <proto> <flags> <user> <server_path> <args>
#服务名 socket类型 协议 动作 拥有者 服务进程路径名 掉用参数
#nowait 表示在相应一个网络连接之后,服务进程在释放旧的联接之前可以接受
#新的连接请求,wait 则表示必须在旧连接清除之后才能接收新的连接.
# Echo, discard, daytime, and chargen are used primarily for testing.
# To re-read this file after changes, just do a ‘killall -HUP inetd’
#
#echo  stream  tcp  nowait  root  internal
#echo  dgram   udp  wait   root  internal
#discard    stream  tcp  nowait  root  internal
#discard    dgram   udp  wait   root  internal
#daytime stream  tcp   nowait   root   internal
#daytime dgram  udp   wait    root   internal
#chargen     stream  tcp   nowait  root  internal
#chargen     dgram  udp  wait   root   internal
#time   stream   tcp   nowait   root  internal
#time   dgram   udp   wait   root   internal
#
# These are standard services.
#
ftp   stream   tcp   nowait   root   /usr/sbin/tcpd   in.wuftpd -l -a
telnet stream   tcp   nowait   root   /usr/sbin/tcpd   in.telnetd
#
# Shell, login, exec, comsat and talk are BSD protocols.
#
#shell  stream  tcp  nowait  root   /usr/sbin/tcpd   in.rshd
#login  stream  tcp  nowait  root   /usr/sbin/tcpd   in.rlogind
#exec  stream  tcp  nowait  root   /usr/sbin/tcpd   in.rexecd
#comsat dgram  udp  wait   root   /usr/sbin/tcpd   in.comsat
#talk  dgram  udp  wait   root   /usr/sbin/tcpd   in.talkd
#ntalk  dgram  udp wait   root   /usr/sbin/tcpd   in.ntalkd
#dtalk  stream tcp  waut   nobody  /usr/sbin/tcpd   in.dtalkd
# Pop and imap mail services et al
#
#pop-2 stream tcp nowait root /usr/sbin/tcpd ipop2d
#pop-3 stream tcp nowait root /usr/sbin/tcpd ipop3d
#imap stream tcp nowait root /usr/sbin/tcpd imapd
#
# The Internet UUCP service.
#
#uucp stream tcp nowait uucp /usr/sbin/tcpd /usr/lib/uucp/uucico -l
#
# Tftp service is provided primarily for booting. Most sites
# run this only on machines acting as “boot servers.” Do not uncomment
# this unless you *need* it.
#
#tftp  dgram  udp  wait  root  /usr/sbin/tcpd  in.tftpd
#bootps dgram  udp  wait  root  /usr/sbin/tcpd  bootpd
# 
# Finger, systat and netstat give out user information which may be
# valuable to potential “system crackers.” Many sites choose to disable
# some or all of these services to improve security.
#
#finger stream  tcp   nowait   root   /usr/sbin/tcpd   in.fingerd
#cfinger stream  tcp   nowait   root   /usr/sbin/tcpd   in.cfingerd
#systat stream  tcp   nowait   guest   /usr/sbin/tcpd /bin/ps -auwwx
#netstat stream  tcp   nowait   guest   /usr/sbin/tcpd /bin/netstat  -f inet
#
# Authentication
#
#auth    stream  tcp  nowait  nobody  /usr/sbin/in.identd in.identd -l -e -o
#linuxconf stream   tcp  wait   root   /bin/linuxconf linuxconf -http

  大家看到的这个文件已经修改过的文件,除了telnet 和ftp服务,其他所有的服务都被禁止了.在修改了/etc/inetd.conf之后,使用命令kill -HUP (inetd的进程号),使inetd重新读取配置文件并重新启动即可.

5. ip route的配置
  利用linux,一台普通的微机也可以实现高性价比的路由器.首先让我们了解一下linux的查看路由信息的命令:
  [root@ice /etc]# route -n
  Kernel IP routing table
  Destination    Gateway    Genmask     Flags Metric Ref   Use Iface
  202.112.13.204  0.0.0.0    255.255.255.255 UH  0  0  0     eth0
  202.117.48.43   0.0.0.0    255.255.255.255 UH  0  0  0     eth1
  202.112.13.192  202.112.13.204 255.255.255.192 UG  0  0  0     eth0
  202.112.13.192  0.0.0.0    255.255.255.192 U  0  0  0      eth0
  202.117.48.0   202.117.48.43 255.255.255.0  UG  0  0  0     eth1
  202.117.48.0   0.0.0.0     255.255.255.0  U  0  0  0     eth1
  127.0.0.0    0.0.0.0     255.0.0.0     U  0  0  0     lo
  0.0.0.0     202.117.48.1   0.0.0.0     UG  0  0  0     eth1
  命令netstat -r n 得到输出结果和route -n是一样的.它们操作的都是linux 内核的路由表.
  命令cat /proc/net/route的输出结果是以十六进制表示的路由表.
[root@ice /etc]# cat /proc/net/route
Iface  Destination   Gateway  Flags  RefCnt  Use   Metric Mask
eth0  CC0D70CA     00000000 0005  0   0    0     FFFFFFF
eth1  2B3075CA     00000000 0005  0   0    0     FFFFFFF
eth0  C00D70CA     CC0D70CA 0003  0   0    0     C0FFFFF
eth0  C00D70CA     00000000 0001  0   0    0     C0FFFFF
eth1  003075CA     2B3075CA 0003  0   0    0     00FFFFF
eth1  003075CA     00000000 0001  0   0    0     00FFFFF
lo   0000007F      00000000 0001  0   0    0    000000F
eth1   00000000      013075CA 0003  0  0    0     0000000
  通过计算可以知道,下面的这个路由表(十六进制)和前面的路由表(十进制)是一致的.
  我们还可以通过命令route add (del )来操作路由表,增加和删除路由信息.
除了上面的静态路由,linux还可以通过routed来实现rip协议的动态路由.我们只需要打开linux的路由转发功能,在/proc/sys/net/ipv4/ip_forward文件中增加一个字符1.

三.网络的安全设置

  在这一部分,再次强调一定要修改/etc/inetd.conf,安全的策略是禁止所有不需要的服务.除此之外,还有以下几个文件和网络安全相关.

  (1)./etc/ftpusers ftp服务是一个不太安全的服务,所以/etc/ftpusers限定了不允许通过ftp访问linux主机的用户列表.当一个ftp请求传送到ftpd,ftpd首先检查用户名,如果用户名在/etc/ftpusers中,则ftpd将不会允许该用户继续连接.范例文件如下:

# /etc/ftpusers – users not allowed to login via ftp
root
bin
daemon
adm
lp
sync
shutdown
halt
mail
news
uucp
operator
games
nobody
nadmin

  (2)/etc/securetty 在linux系统中,总共有六个终端控制台,我们可以在/etc/securetty中设置哪个终端允许root登录,所有其他没有写入文件中的终端都不允许root登录.范例文件如下:

# /etc/securetty – tty’s on which root is allowed to login
tty1
tty2
tty3
tty4

(3)tcpd的控制登录文件/etc/hosts.allow和/etc/hosts.deny
  在tcpd服务进程中,通过在/etc/hosts.allow和/etc/hosts.deny中的访问控制规则来控制外部对linux主机的访问.它们的格式都是
  service-list : hosts-list [ : command]
  服务进程的名称 : 主机列表 可选,当规则满足时的操作
  在主机表中可以使用域名或ip地址,ALL表示匹配所有项,EXCEPT表示除了某些项, PARANOID表示当ip地址和域名不匹配时(域名伪装)匹配该项.
  范例文件如下:

#
# hosts.allow This file describes the names of the hosts which are
# allowed to use the local INET services, as decided
# by the ‘/usr/sbin/tcpd’ server.
#
ALL : 202.112.13.0/255.255.255.0
ftpd: 202.117.13.196
in.telnetd: 202.117.48.33
ALL : 127.0.0.1

  在这个文件中,网段202.112.13.0/24可以访问linux系统中所有的网络服务,主机202.117.13.196只能访问ftpd服务,主机202.117.48.33只能访问telnetd服务.本机自身可以访问所有网络服务.
  在/etc/hosts.deny文件中禁止所有其他情况:
  #/etc/hosts.deny
  ALL : DENY : spawn (/usr/bin/finger -lp @%h | /bin/mail -s “Port Denial noted in %d-%h” root)

  在/etc/hosts.allow中,定义了在所有其他情况下,linux所应该执行的操作.spawn选项允许linux系统在匹配规则中执行指定的shell命令,在我们的例子中,linux系统在发现无授权的访问时,将会发送给超级用户一封主题是”Port Denial noted in %d-%h”的邮件,在这里,我们先要介绍一下allow和deny文件中的变量扩展.

  

  (4)/etc/issue和/etc/issue.net
  在我们登录linux系统中的时候,我们常常可以看到我们linux系统的版本号等敏感信息.在如今的网络攻击行为中,许多黑客首先要收集目标系统的信息,版本号等就是十分重要的信息,所以在linux系统中一般要把这些信息隐藏起来./etc/issue和/etc/issue.net就是存放这些信息的文件.我们可以修改这些文件来隐藏版本信息.
另外,在每次linux重新启动的时候,都会在脚本/etc/rc.d/rc.local中再次覆盖上面那两个文件./etc/rc.d/rc.local文件的范例如下:

# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don’t
# want to do the full Sys V style init stuff.

if [ -f /etc/redhat-release ]; then
R=$(cat /etc/redhat-release)

arch=$(uname -m)
a=”a”
case “_$arch” in
_a*) a=”an”;;
_i*) a=”an”;;
esac

NUMPROC=`egrep -c “^cpu[0-9]+” /proc/stat`
if [ "$NUMPROC" -gt "1" ]; then
SMP=”$NUMPROC-processor ”
if [ "$NUMPROC" = "8" -o "$NUMPROC" = "11" ]; then
a=”an”
else
a=”a”
fi
fi

# This will overwrite /etc/issue at every boot. So, make any changes you
# want to make to /etc/issue here or you will lose them when you reboot.
#echo “” > /etc/issue
#echo “$R” >> /etc/issue
# echo “Kernel $(uname -r) on $a $SMP$(uname -m)” >> /etc/issue

cp -f /etc/issue /etc/issue.net
echo >> /etc/issue

  在文件中黑体的部分就是得到系统版本信息的地方.一定要将他们注释掉.

  (5)其他配置
  在普通微机中,都可以通过ctl+alt+del三键的组合来重新启动linux.这样是十分不安全的,所以要在    /etc/inittab文件中注释该功能:
  # Trap CTRL-ALT-DELETE
  #ca::ctrlaltdel:/sbin/shutdown -t3 -r now

Linux的基本文件说明

启动引导程序配置文件
  LILO /etc/lilo.conf
  GRUB /boot/grub/menu.lst
  
  系统启动文件核脚本
  主启动控制文件 /etc/inittab
  SysV启动脚本的位置 /etc/init.d、/etc/rc.d/init.d或/etc/rc.d
  SysV启动脚本链接的位置 /etc/init.d/rc?.d、/etc/rc.d/rc?.d或/etc/rc?.d
  本地启动脚本 /etc/rc.d/rc.local、/etc/init.d/boot.local或/etc/rc.boot里的文件
  
  网络配置文件
  建立网络接口的脚本 /sbin/ifup
  保存网络配置数据文件的目录 /etc/network、/etc/sysconfig/network和/etc/sysconfig/network-scripts
  保存解析DNS服务的文件 /etc/resolv.conf
  DHCP客户端的配置文件 /etc/dhclient.conf
  
  超级服务程序配置文件和目录
  inetd配置文件 /etc/inetd.conf
  TCP Wrappers配置文件 /etc/hosts.allow和/etc/hosts.deny
  xinetd配置文件 /etc/xinetd.conf和/etc/xinetd.d目录里的文件
  
  硬件配置
  内核模块配置文件 /etc/modules.conf
  
  硬件访问文件
  Linux设备文件 /dev目录里
  保存硬件和驱动程序数据的文件 /proc目录里
  
  扫描仪配置文件
  SANE主配置 /etc/sane.d/dll.conf
  特定扫描仪的配置文件 /etc/sane.d目录里以扫描仪型号命名的文件
  
  打印机配置文件
  BSD LPD核LPRng的本地打印机主配置文件 /etc/printcap
  CUPS本地打印机主配置和远程访问受权文件 /etc/cups/cupsd.conf
  BSD LPD远程访问受权文件 /etc/hosts.lpd
  LPRng远程访问受权文件 /etc/lpd.perms
  
  文件系统
  文件系统表 /etc/fstab
  软驱装配点 /floppy、/mnt/floppy或/media/floppy
  光驱装配点 /cdrom、/mnt/cdrom或/media/cdrom
  
  shell配置文件
  bash系统非登录配置文件 /etc/bashrc、/etc/bash.bashrc或/etc/bash.bashrc.local
  bash系统登录文件 /etc/profile和/etc/profile.d里的文件
  bash用户非登录配置文件 ~/.bashrc
  bash用户登录配置文件 ~/.profile
  
  XFree86配置文件核目录
  XFree86主配置文件 /etc/XF86config、/etc/X11/XF86Config或/etc/X11/XF86Config-4
  字体服务程序配置文件 /etc/X11/fs/config
  Xft 1.x配置文件 /etcX11/XftConfig
  Xft 2.0配置文件 /etc/fonts/fonts.conf
  字体目录 /usr/X11R6/lib/X11/fonts和/usr/share/fonts
  
  Web服务程序配置文件
  Apache主配置文件 /etc/apache、/etc/httpd或/httpd/conf里的httpd.conf或httpd2.conf文件
  MIME类型文件 与Apache主配置文件在同一目录里的mime.types或apache-mime.types
  
  文件服务程序配置文件
  ProFTPd配置文件 /etc/proftpd.conf
  vsftpd配置文件 /etc/vsftpd.conf
  NFS服务程序的输出定义文件 /etc/exports
  NFS客户端装配的NFS输出 /etc/fstab
  Samba配置文件 /etc/samba/smb.conf
  Samba用户配置文件 /etc/samba/smbpasswd
  
  邮件服务程序配置文件
  sendmail主配置文件 /etc/mail/sendmail.cf
  sendmail源配置文件 /etc/mail/sendmail.mc或/usr/share/sendmail/cf/cf/linux.smtp.mc或其他文件
  Postfix主配置文件 /etc/postfix/main.cf
  Exim主配置文件 /etc/exim/exim.cf
  Procmail配置文件 /etc/procmailrc或~/.procmailrc
  Fetchmail配置文件 ~/.fetchmailrc
  
  远程登录配置文件
  SSH服务程序配置文件 /etc/ssh/sshd_config
  SSH客户端配置文件 /etc/ssh/ssh_config
  XDM配置文件 /etc/X11/xdm目录下
  GDM配置文件 /etc/X11/gdm目录下
  VNC服务程序配置文件 /usr/X11R6/bin/vncserver启动脚本和~/.vnc目录里的文件
  
  其他服务程序配置文件
  DHCP服务程序配置文件 /etc/dhcpd.conf
  BIND服务程序配置文件 /etc/named.conf和/var/named/
  NTP服务程序配置文件 /etc/ntp.conf

Page 1 of 212»