`
java-mans
  • 浏览: 11380363 次
文章分类
社区版块
存档分类
最新评论

快速架设apache/vsftpd/samba/sendmail服务器

 
阅读更多
1 序言
2 参考文档
3 动态域名实现
4 apache
5 vsftpd
6 samba
7 sendmail
8 附录
a) httpd.conf的详细设定
b) vsftpd.conf的详细设定
c) smb.conf的详细设定
d) sendmail.mc的详细设定
e) tcp端口对照表(0~1457)

1 序言

现在宽带网络越来越普及,这为个人架设服务器提供了良好的基础.
本文讲述了如何实现动态域名,并快速设置好apache/vsftpd/samba/sendmail服务器.本文参阅了不少优秀文档,并接合了自己的一些心得.在这里,感谢这些无私的作者和为linux做出贡献的人们.

环境:redhat linux 9

2 参考文档

Red Hat Linux 9.0服务器架设全程实录
http://www.douzhe.com/linuxtips/1701.html

简易www伺服器设定
http://linux.vbird.org/linux_server/0360apache.php

简易vsftpd伺服器设定
http://linux.vbird.org/linux_server/0410vsftpd.php

简易samba伺服器设定
http://linux.vbird.org/linux_server/0370samba.php

简易Mail Server架设 -- Sendmail设定
http://linux.vbird.org/linux_server/0380sendmail.php

RHCE_Linux_Study_Guide
此文档在许多linux站点都可以找到

3 动态域名实现

考虑虚拟拨号的用户ip地址是动态分配的,这里我们申请动态域名.假设我们拥有公网ip.
在http://www.comexe.cn/ddns/ddns_trying.php上申请一个二级域名,然后下载linux的动态域名客户端linux_i.tar.gz,放在/tmp下

cd /tmp
tar zxvf linux_i.tar.gz

解压后的文件pipclient我们放在/usr/local/comexe/下

mkdir /usr/local/comexe/
mv pipclient /usr/local/comexe/
cd /usr/local/comexe/

下面配置客户端,在以下网址有说明:
http://www.comexe.cn/ddns/ddns_assistant_use.php#a4

./pipclient
依此输入在科迈注册的用户名,密码,域名
在Input Offline URL or Offline IP(Enter for none):此处我们直接回车(离线域名对我们注册的二级域名无效)
Has another domain?(Y/N):多个域名按"Y"
配置完按Ctrl+C结束.
修改配置用-c参数:
./pipclient -c

运行:
pipclient要在系统启动时以后台进程运行。请修改系统启动脚本(/etc/rc.d/rc.local),加入如下命令:
nohup /usr/local/comexe/pipclient -w /usr/local/comexe &
其中“-w”参数指定工作目录

因为我个人更喜欢用ntsysv(setup->system service),所以没有在rc.local中加命令
于是自己写了个简陋的脚本,用chkconfig加入系统服务,以后可以用service comexe start和service comexe stop启用和停止动态域名:
cd /etc/init.d/
vi comexe
然后写入下面的内容:
#! /bin/sh
#chkconfig:2345 90 90
#description:comexe


. /etc/rc.d/init.d/functions

case "$1" in

start)
echo -n "start ddns: "
/usr/local/comexe/pipclient -w /usr/local/comexe > /dev/null &
echo
;;

stop)
echo -n "stop ddns: "
killproc pipclient
echo
;;

*)
exit 1
;;
esac

exit 0
好了,wq保存退出
chmod 755 comexe
chkconfig --add comexe
chkconfig --level 35 comexe on
这样,把comexe这个脚本加到了启动服务中,以后每次开机后自动加载(运行级3,5)
service comexe start和service comexe stop可手动加载和停止该服务.

4 apache

apache是被广泛应用的web服务器软件,有多个平台的版本.关于apache名称的由来,大家有兴趣可以看看参考文档中的解释Smile
首先是安装工作.
我们需要安装如下的软件包(可以在redhat linux 9 光盘中找到)
httpd
httpd-devel
redhat-config-httpd
httpd-manual
autoconf
automake
libtool
mod_perl
mod_ssl
mod_python
用rpm -Uvh将这些软件包装好,然后:
/sbin/chkconfig --level 35 httpd on 将httpd服务在运行级3,5自动加载
/sbin/service httpd start 启动httpd服务
在web浏览器中输入http://localhost,如果安装无误,你会看见apache的测试页面

在apache 2中主配置文件是/etc/httpd/conf/httpd.conf
该文件的修改可以手动编辑或用redhat-config-httpd这样的图形化程式来完成
下面简单介绍一下该配置文件的主要配置参数:

KeepAlive On
是否允许持续性连线,即一个连线有多个请求

MaxKeepAliveRequests 100
在持续性连线中,最大允许的连接数目,设定为0,表示没有限制

MinSpareServers与MaxSpareServers是设定httpd进程数量的范围
StartServers可以设定在这两者之间(用ps -guax|grep httpd可以看到httpd进程数)

MaxClients 150
同一时间的连接数目.如果设得太大会很耗资源,设得太小则无法让很多人连上来

MaxRequestsPerChild
一个服务进程允许的最大请求数,设为0表示无限制

Listen 80
设定监听端口,默认80,表示监听所有ip的80端口,可以根据情况设成其他端口
也可以设为监听某一ip的端口,如xxx.xxx.xxx.xxx:80
这要在系统启动时激活网络(仅限固定ip),否则httpd服务启动失败

DocumentRoot "/var/www/html"
DocumentRoot设定apache的根目录

<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
设定apache根目录的属性,Options后面的值表示:
ExecCGI 使该目录下CGI可执行
FollowSymLinks 允许链接至其他目录
Includes 允许使用SSI
Indexes 如果该目录下找不到index.html,则显示该目录下文件名称
MultiViews 根据特定条件自动选择并返回一个合适的文件(很少用到)
All 使用上面所有参数,除了MultiViews

AddDefaultCharset ISO-8859-1
apache缺省的显示语言编码,将ISO-8859-1改为GB2312,以显示简体中文

NameVirtualHost *
虚拟主机设定.所谓虚拟机指一个主机有多个域名对应,
该设定可以让不同的域名对应不同的页面,就好像存在多个主机一样
apache有两种方式的虚拟机:基于ip的虚拟机和基于名字的机
基于IP的虚拟主机要求使用不同的IP地址来区别不同的虚拟主机
基于名字的虚拟主机使用相同的IP地址来配置不同的虚拟主机
*可以用ip地址或internet上的主机名称来替代

<VirtualHost www.myvirtualhost.com>
ServerName www.myvirtualhost.com
DocumentRoot /var/www/html/myvirtualhost
ServerAdmin root@myvirtualhost.com
ErrorLog logs/www.myvirtualhost.com-error_log
CustomLog logs/www.myvirtualhost.com-access_log common
</VirtualHost>
上面是一个虚拟机的例子,即www.myvirtualhost.com
ServerAdmin 管理员电邮地址
ErrorLog 错误日志
CustomLog 访问日志
设定一个虚拟机至少需要ServerName和DocumentRoot两项,即服务器名和虚拟机网页的根目录.
可根据情况设定多个虚拟主机

设置无误后,用httpd -t测试有无语法错误
service httpd reload装载修改过的设定

现在可以用浏览器测试一下

最后,开放iptables中的80端口(取决于httpd.conf中的端口设定)
vi /etc/sysconfig/iptables
由于iptables是至上而下读取配置文件规则的,所以在
-A RH-Lokkit-0-50-INPUT -p tcp -m tcp --dport 0:1023 --syn -j REJECT
这一行之上加入允许的规则就可以了.加入:
#httpd(apache)
-A RH-Lokkit-0-50-INPUT -p tcp -m tcp --dport 80 --syn -j ACCEPT
然后service iptables restart
重启iptables服务
这样,可以从internet上访问这台主机的www服务了.

5 vsftpd

vsftpd是linux上常用的几种ftp服务器软件之一,vsftpd是very secure FTP daemon的缩写.

首先,将redhat linux 9 cd #3上的vsftpd-1.1.3-8.i386.rpm装好

chkconfig --level 35 vsftpd on
运行级3,5下,vsftpd服务开机自动加载

service vsftpd start
启动vsftpd服务
参数restart,stop可重启/停止服务

配置文件:
/etc/vsftpd/vsftpd.conf
是vsftpd的主要设定文件

/etc/vsftpd.ftpusers
不能访问ftp服务器的用户列表,默认root不可访问vsftpd服务器

/etc/vsftpd.user_list
这个文件中也是一些用户的列表
在/etc/vsftpd/vsftpd.conf中:
1)当userlist_enable=YES(默认)时,启用配置文件/etc/vsftpd.user_list
a)此时若没有userlist_deny=NO,则/etc/vsftpd.user_list中的用户也不可访问vsftpd服务器
b)此时若存在userlist_deny=NO,则仅接受/etc/vsftpd.user_list中存在的用户的登录请求(同时这些用户不存在于/etc/vsftpd.ftpusers中)
2)当userlist_enable=NO时,则不会启用配置文件/etc/vsftpd.user_list

下面简单说明一下/etc/vsftpd/vsftpd.conf的参数设定:

anonymous_enable=YES
允许匿名用户登录

local_enable=YES
允许本地用户登录(linux系统下实在的帐户)

write_enable=YES
允许上传

local_umask=022
本地用户上传文件的umask设为022

xferlog_enable=YES
启用记录上传/下载活动日志

connect_from_port_20=YES
tcp端口20作为ftp-data传送端口(一般21为ftp-control端口)

userlist_enable=YES
(请参看上面/etc/vsftpd.user_list配置文件的简单说明)

listen=YES
使用standalone模式

local_root=/var/ftp
本地用户登录后的目录为/var/ftp
如果没有这项设定,本地用户登录后的目录为自己的家目录

chroot_list_enable=YES
让下面配置文件中的本地用户不能到达家目录之外的地方
chroot_list_file=/etc/vsftpd.chroot_list

pasv_enable=YES
启用被动模式
#port_enable=YES
启用主动模式
注意,这两个参数只能出现一个,另一个必需用#注释掉(设为NO也不可以)

以上是vsftpd.conf的一些基本设定,更详悉的设定,请参看附录

修改好配置文件,重启一下服务service vsftpd restart

下面开放tcp 20,21端口
在/etc/sysconfig/iptables中加入:

#vsftpd(vsftp)
-A RH-Lokkit-0-50-INPUT -p tcp -m multiport --dport 20,21 --syn -j ACCEPT

(加入的位置在REJECT规则之前)
然后service iptables restart
重启iptables服务

这样,vsftpd服务器就架好了,可以用客户端测试一下

6 samba

samba的作用是提供Unix/Linux与Windows之间的通讯,并使她们之间实现文件/打印机/设备共享.在Windows网络中,设置好samba的Linux机器可以做服务器也可以做客户端.

安装以下几个rpm包:
samba
samba-common
samba-client
samba-swat
redhat-config-samba
其中samba-swat是以web页面方式配置samba的前端,redhat-config-samba是Xwindow下的图形化配置程式,她们的作用都是设定/etc/samba/smb.conf这个配置文件,此文件也可以手动编辑.

chkconfig --level 35 smb on
运行级3,5下,samba服务开机自动加载

service smb start
开启samba服务.参数包括start/restart/stop/reload等

samba的一些重要组成文件:
/usr/sbin/smbd SMB服务守护程式
/usr/sbin/nmbd NetBIOS服务守护程式
/etc/samba/smb.conf samba主配置文件
/usr/bin/smbclient 连接到SMB共享的客户端程式
/usr/bin/testparm 检验smb.conf有效性的脚本
/usr/bin/smbprint 此脚本可以将打印任务送至SMB主机的打印机
/usr/bin/smbstatus 列出本地主机的SMB连接
smbfs smbfs文件系统,可以将共享文件夹用mount命令挂载至本地

samba主配置文件/etc/samba/smb.conf中的主要参数设定:
该文件中#为信息注释符 ;为参数注释符

#======================= Global Settings =====================================
[global]

workgroup = MYGROUP
工作组名称

server string = Samba Server
主机说明

netbios name = SMBServer
在网络中的netbios名称,如果没有设定,预设值为HOSTNAME

hosts allow = 192.168.1. 192.168.2. 127.
设定哪些ip地址可访问主机

security = user
samba的安全级别,从低到高有四级:share/user/server/domain
share: 任何用户都可以访问服务器上的资源,无须帐号
user: 需要用户名和密码进行验证
server: 帐号验证交给另外一个服务器,如交给另一台NT服务器.
如果递交失败,就退到user安全级.
domain: 这个安全级别要求网络上存在一台Windows的主域控制器,samba将帐号递交
给该服务器验证.
    user/server/domain要求用户在本地linux机器上也有系统帐户,否则不能访问.
这里只简单介绍一下share/user的用法,详悉设定请参看附录

encrypt passwords = yes
使用加密密码

smb passwd file = /etc/samba/smbpasswd
存放samba帐户密码的文件

local master = yes
samba服务器可以成为本地主浏览器

os level = 33
samba服务器的管理等级

domain master = yes
该服务器成为域浏览器

preferred master = yes
该服务器成为工作组中的首要主浏览器

#============================ Share Definitions ==============================
[homes]
comment = Home Directories
browseable = no
writable = yes
valid users = %S
create mode = 0664
directory mode = 0775
上面是用户家目录的设置

[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
guest ok = no
writable = no
printable = yes
打印机设定

[document]
comment = daweicheng's document
path = /tmp/document
read only = yes
public = yes

[samba user guest]
comment = guest
path = /tmp/samba
read only = no
guest account = guest


简单介绍一下这里的几个参数:

comment=xxx
共享注释,即共享时对方主机能够看到的文件夹名称

path=/xxx/.../xxx/
共享的目录

read only= yes
只读属性设定

public = yes
公开属性,任何人可以看见该资源,无须帐号

guest account = xxx
访问者的帐户名

这里的参数很容易理解,所以不一一列举了,详细请看附录

如果你希望任何人都可访问共享资源,需要将Global Settings的安全级设定为:
security = share
共享目录参数需要:
public = yes
如果希望某些目录只有特定的用户访问,则要将Global Settings的安全级应设定为:
security = user
共享目录参数需要:
guest account = xxx
这个xxx用户(下例中是NewUser)是用useradd和smbpasswd创建的:

添加samba用户:
useradd NewUser
设定NewUser的samba密码:
smbpasswd -a NewUser
使NewUser可以使用samba服务:
smbpasswd -e NewUser

testparm可以验证/etc/samba/smb.conf的有效性,回车后会显示samba的参数设定

设定无误后,重启smb服务,并打开iptables中的tcp 139端口:
在/etc/sysconfig/iptables中加入:

#smb(samba)
-A RH-Lokkit-0-50-INPUT -p tcp -m tcp --dport 139 --syn -j ACCEPT

(加入的位置在REJECT规则之前)
然后service iptables restart
重启iptables服务

查看其他主机的共享资源:
smbclient -L WindowsHostName
此处WindowsHostName就是对方的windows主机名

smbclient //WindowsHostName/ShareName
可以访问对方主机上的ShareName共享文件夹
也可以是:
smbclient //xxx.xxx.xxx.xxx/D$
xxx.xxx.xxx.xxx表示对方的ip,D$是对方主机D盘的默认共享名称
如果访问的资源需要用户名和密码,可以加入-U参数,如:
smbclient //xxx.xxx.xxx.xxx/D$ -U UserName
然后按提示输入密码,登录后会得到一个提示符,有些类似于命令行方式的ftp登录.

挂载共享驱动器:
可以用smbmount或者mount命令
smbmount的例子:
smbmount //WindowsHostName/ShareName /mnt
这样就将ShareName下的内容挂载在/mnt下了
也可以用mount命令,例子:
mount -t smbfs -o username=xxx //xxx.xxx.xxx.xxx/D$ /mnt/
如果不正确显示中文,可以在-o参数后加入codepage=936,iocharset=cp936
即:
mount -t smbfs -o username=xxx,codepage=936,iocharset=cp936 //xxx.xxx.xxx.xxx/D$ /mnt/
卸载共享目录的命令是umount

在windows中访问samba服务器,可以用网上邻居
或者在"运行"中直接输入//xxx.xxx.xxx.xxx即可

配置samba也可用redhat-config-samba或SWAT
使用SWAT需要先设置一下:
将/etc/xinetd.d/swat中的disable = yes设定为disable = no
service xinetd restart
重启xinetd服务
/sbin/chkconfig swat --level 35 on
在运行级3,5下让swat服务开机自动加载
最后,执行chkconfig --list | grep swat
swat : on表示swat服务已经开启了
在web浏览器中输入http://localhost:901
以root身份进入配置界面,就可以对smb.conf进行设置了.

7 sendmail

将下面的软件包安装上:
sendmail
sendmail-cf
sendmail-doc
imap

chkconfig --level 35 sendmail on
运行级3,5下让sendmail服务开机自动加载

查看/etc/services文件,确定下面几行的内容没有被#号注释掉:
pop3 110/tcp pop-3 # POP version 3
pop3 110/udp pop-3
imap 143/tcp imap2 # Interim Mail Access Proto v2
imap 143/udp imap2

编辑/etc/xinetd.d/ipop3和/etc/xinetd.d/imap
将disable = yes改为disable = no

service xinetd reload
重新装载配置文件

sendmail的主配置文件是/etc/mail/sendmail.cf
但由于该文件较大,并且语法非常深奥,所以官方文档中不建议直接手动编辑
通常我们用m4工具和sendmail.mc模板来生成可用的sendmail.cf

/etc/mail/sendmail.mc中的注释符为dnl,并且每个定义段结束也用dnl来标志

编辑/etc/mail/sendmail.mc,将下面几行注释掉(在行首加入dnl):
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
FEATURE(`accept_unresolvable_domains')dnl
第一行的意思是只接受本机邮件
第二行的意思是接受不可解析的域名relay邮件

去掉下面两行的注释符(去掉行首的dnl):
TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')
打开SMTP认证
任何邮件试图通过本服务器转发邮件必须通过SMTP认证

用m4生成sendmail.cf文件
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

编辑/etc/mail/local-host-names
加入本机的域名

service sendmail restart
重启sendmail服务

这里说一下/etc/mail/access档
这个文件中可以设定哪些主机/域名/ip可以通过本邮件服务器转发
内容格式:
ip地址或ip段/域名/主机 RELAY/DISCARD/REJECT
RELAY: 允许转发
DISCARD: 丢弃
REJECT: 拒绝转发
例子:
211 RELAY
允许211地址段的邮件RELAY

makemap hash /etc/mail/access < /etc/mail/access
将access文件内容转化为/etc/mail/access.db资料库
这里也可以写:
makemap hash /etc/mail/access.db < /etc/mail/access
结果是一样的

当然,也可以不写access档,SMTP认证会挡掉通不过认证的邮件转发请求

最后设置一下iptables,打开sendmail(tcp 25),imap(tcp/udp 143),pop3(tcp/udp 110)端口:
在/etc/sysconfig/iptables中加入:
#smtp(sendmail)
-A RH-Lokkit-0-50-INPUT -p tcp -m tcp --dport 25 --syn -j ACCEPT
#imap,pop3
-A RH-Lokkit-0-50-INPUT -p tcp -m multiport --dport 143,110 --syn -j ACCEPT
-A RH-Lokkit-0-50-INPUT -p udp -m multiport --dport 143,110 -j ACCEPT

(加入的位置在REJECT规则之前)
然后service iptables restart
重启iptables服务

到此,一个简单的邮件服务器架好了.
可以用一个系统帐号测试一下.
比如本机存在系统用户dexter,机器的域名为dexter.testsendmail.com
那么dexter@dexter.testsendmail.com就是一个邮件帐号
帐户名为dexter,密码是dexter的系统密码
pop3/imap/stmp服务器地址填写本机的域名dexter.testsendmail.com
在邮件客户端下打开SMTP认证,就可以收发邮件了

8 附录

a) httpd.conf的详细设定

原文地址:
https://dream4ever.org/archive/t-33200.html

作者:pc51ceo

内容:

APACHE中 httpd.conf 的中文详解

ServerRoot /Apache
#可以用绝对路径 e:webapache
#ServerRoot用于指定守护进程httpd的运行目录,httpd在启动之后将自动将进程的当前目录改变为这个目录,因此如果设置文件中指定的文件或目录是相对路径,那么真实路径就位于这个ServerRoot定义的路径之下。
PidFile logs/httpd.pid
#PidFile指定的文件将记录httpd守护进程的进程号,由于httpd能自动复制其自身,因此系统中有多个httpd进程,但只有一个进程为最初 启动的进程,它为其他进程的父进程,对这个进程发送信号将影响所有的httpd进程。PidFILE定义的文件中就记录httpd父进程的进程号
Timeout 300
#Timeout定义客户程序和服务器连接的超时间隔,超过这个时间间隔(秒)后服务器将断开与客户机的连接.
KeepAlive On
#在HTTP 1.0中,一次连接只能作传输一次HTTP请求,而KeepAlive参数用于支持HTTP 1.1版本的一次连接、多次传输功能,这样就可以在一次连接中传递多个HTTP请求。虽然只有较新的浏览器才支持这个功能,但还是打开使用这个选项
MaxKeepAliveRequests 100
#MaxKeepAliveRequests为一次连接可以进行的HTTP请求的最大请求次数。将其值设为0将支持在一次连接内进行无限次的传输请求。事实上没有客户程序在一次连接中请求太多的页面,通常达不到这个上限就完成连接了。
KeepAliveTimeout 15
#KeepAliveTimeout测试一次连接中的多次请求传输之间的时间,如果服务器已经完成了一次请求,但一直没有接收到客户程序的下一次请求,在间隔超过了这个参数设置的值之后,服务器就断开连接。
<IfModule mpm_winnt.c>
ThreadsPerChild 250
MaxRequestsPerChild 0
</IfModule>
Listen 80
#端口,启动模块.下面许多模块只有在LINUX下才有用
LoadModule access_module modules/mod_access.so
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_module modules/mod_auth.so
LoadModule dir_module modules/mod_dir.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule mime_module modules/mod_mime.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule setenvif_module modules/mod_setenvif.so
#LoadModule cern_meta_module modules/mod_cern_meta.so
#LoadModule env_module modules/mod_env.so
#LoadModule expires_module modules/mod_expires.so
#LoadModule file_cache_module modules/mod_file_cache.so
#LoadModule headers_module modules/mod_headers.so
#LoadModule imap_module modules/mod_imap.so
#LoadModule auth_anon_module modules/mod_auth_anon.so
#LoadModule auth_dbm_module modules/mod_auth_dbm.so
#LoadModule auth_digest_module modules/mod_auth_digest.so
#LoadModule dav_module modules/mod_dav.so
#LoadModule dav_fs_module modules/mod_dav_fs.so
#LoadModule include_module modules/mod_include.so
#LoadModule info_module modules/mod_info.so
#LoadModule isapi_module modules/mod_isapi.so
#LoadModule mime_magic_module modules/mod_mime_magic.so
#LoadModule proxy_module modules/mod_proxy.so
#LoadModule proxy_connect_module modules/mod_proxy_connect.so
#LoadModule proxy_http_module modules/mod_proxy_http.so
#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
#LoadModule speling_module modules/mod_speling.so
#LoadModule status_module modules/mod_status.so
#LoadModule unique_id_module modules/mod_unique_id.so
#LoadModule usertrack_module modules/mod_usertrack.so
#LoadModule ssl_module modules/mod_ssl.so
#LoadModule vhost_alias_module modules/mod_vhost_alias.so
#LoadModule userdir_module modules/mod_userdir.so
LoadModule rewrite_module modules/mod_rewrite.so
#ExtendedStatus On
ServerAdmin abc@123.com
#服务器管理员邮箱,在出错,探针中显示
ServerName localhost.domain.com
UseCanonicalName Off
#是否允许对每个访问者的 DNS 域名的反向查询
DocumentRoot /Apache
#放网页的目录.这个很重要.
#你设置了,e:web是目录 而虚拟主机设置了e:webtwo
#虽然程序还是能运行,但是不在documentroot内的话,程序会有错误
<Directory />
Options FollowSymLinks MultiViews ExecCGI
AllowOverride None
</Directory>
<Directory /Apache/>
Options FollowSymLinks MultiViews ExecCGI
AllowOverride None
Order allow,deny
php_admin_value open_basedir /apache/
Allow from all
</Directory>
#以下是关于用户目录配置部分,即用户可以用http://www.xxxx.com/~username的方式来访问自已的网站!
#UserDir /apache/webroot/aaausersfreehost/*/public_html
#<Directory e:/虚拟主机/*/public_html>
# AllowOverride None
# Options MultiViews SymLinksIfOwnerMatch IncludesNoExec ExecCGI
#下面这条指令定义php只能对public_html此目录及其子目录下的文件进行操作.
# php_flag engine off #表示此目录下的PHP文件不被解释执行,限没有PHP权限。
# php_admin_value open_basedir ./
# Order allow,deny
# Allow from all
#</Directory>
#下面这条指令可以把虚拟目录freehost映射到实际路径/apache/webroot/users/下!
#AliasMatch ^/class/([0-9]).html$ /article.php?articleid=$1
#AliasMatch ^/class/([0-9] ).([0-9a-zA-Z] ).html$ /article.php?articleid=$1&amp;pagenum=$2
DirectoryIndex index.html index.htm index.php index.cgi bbs.pl index.pl admin.php login.htm login.html login.php
#默然主机头
AccessFileName .htaccess
<Files ~ ^.ht>
Order allow,deny
Deny from all
</Files>
TypesConfig conf/mime.types
DefaultType text/plain
<IfModule mod_mime_magic.c>
MIMEMagicFile conf/magic
</IfModule>
#以下是限制主机同时并发连接数
#<IfModule prefork.c>
#ServerLimit 2000
#StartServers 15
#MinSpareServers 15
#MaxSpareServers 20
#MaxClients 850 #最大客户端
#MaxRequestsPerChild 10000 #最大请求数
#</IfModule>
#以下是对单个文件进行访问控制
#<Files ~ 要屏蔽的文件的名称>
#Order allow,deny
#Allow from 允许IP
#Deny from all
#</Files>
HostnameLookups Off
#EnableMMAP off
#EnableSendfile off
ErrorLog logs/error.log
LogLevel warn
LogFormat "%h %l %u %t /"%r/" %>s %b /"%{Referer}i/" /"%{User-Agent}i/"" combined
LogFormat "%h %l %u %t /"%r/" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
CustomLog logs/access.log common
#CustomLog logs/referer.log referer
#CustomLog logs/agent.log agent
#CustomLog logs/access.log combined
ServerTokens Full
ServerSignature Off
#当客户请求的网页并不存在时,服务器将产生错误文档,缺省情况下由于打开了 ServerSignature选项,错误文档的最后一行将包含服务器的名字、Apache的版本等信息。
#Alias /class/ /apache/webroot/phpa #虚拟目录啦
# <Directory /apache/phpsafe> #对虚拟目录进行权限配置
# Options FollowSymLinks # MultiViews ExecCGI为有CGI执行权限
# php_admin_value safe_mode 1 #表示此目录下的PHP脚本只能有php_safe下权限
# php_admin_value open_basedir /apache/phpsafe/
# 此句是限制PHP的文件操作只能限于/apache/phpsafe及其子目录下,不能对此目录外的文进行操作
# php_flag engine off
#表示此目录下的PHP脚本不会被解释执行,此选项要求PHP必须以模块方式安装的!
# AllowOverride None
# Order allow,deny
# Allow from all #表示允许任何人从任何地方访问
# </Directory>
#ScriptAlias /cgi-bin/ E:/Apache2/cgi-bin/
#<Directory E:/Apache2/cgi-bin>
# AllowOverride None
# Options None
# Order allow,deny
# Allow from all
#</Directory>
IndexOptions FancyIndexing VersionSort
#AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
#AddIconByType (TXT,/icons/text.gif) text/*
#AddIconByType (IMG,/icons/image2.gif) image/*
#AddIconByType (SND,/icons/sound2.gif) audio/*
#AddIconByType (VID,/icons/movie.gif) video/*
#AddIcon /icons/binary.gif .bin .exe
#AddIcon /icons/binhex.gif .hqx
#AddIcon /icons/tar.gif .tar
#AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
#AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
#AddIcon /icons/a.gif .ps .ai .eps
#AddIcon /icons/layout.gif .html .shtml .htm .pdf
#AddIcon /icons/text.gif .txt
#AddIcon /icons/c.gif .c
#AddIcon /icons/p.gif .pl .py
#AddIcon /icons/f.gif .for
#AddIcon /icons/dvi.gif .dvi
#AddIcon /icons/uuencoded.gif .uu
#AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
#AddIcon /icons/tex.gif .tex
#AddIcon /icons/bomb.gif core
#AddIcon /icons/back.gif ..
#AddIcon /icons/hand.right.gif README
#AddIcon /icons/folder.gif ^^DIRECTORY^^
#AddIcon /icons/blank.gif ^^BLANKICON^^
#DefaultIcon /icons/unknown.gif
AddDescription GZIP compressed document .gz
AddDescription tar archive .tar
AddDescription GZIP compressed tar archive .tgz
ReadmeName README.html
HeaderName HEADER.html
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t
AddEncoding x-compress Z
AddEncoding x-gzip gz tgz
AddLanguage ca .ca
AddLanguage cs .cz .cs
AddLanguage da .dk
AddLanguage de .de
AddLanguage el .el
AddLanguage en .en
AddLanguage eo .eo
AddLanguage es .es
AddLanguage et .et
AddLanguage fr .fr
AddLanguage he .he
AddLanguage hr .hr
AddLanguage it .it
AddLanguage ja .ja
AddLanguage ko .ko
AddLanguage ltz .ltz
AddLanguage nl .nl
AddLanguage nn .nn
AddLanguage no .no
AddLanguage pl .po
AddLanguage pt .pt
AddLanguage pt-BR .pt-br
AddLanguage ru .ru
AddLanguage sv .sv
AddLanguage zh-CN .zh-cn
AddLanguage zh-TW .zh-tw
LanguagePriority zh-CN en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-TW
ForceLanguagePriority Prefer Fallback
#AddDefaultCharset ISO-8859-1
AddDefaultCharset GB2312
AddCharset ISO-8859-1 .iso8859-1 .latin1
AddCharset ISO-8859-2 .iso8859-2 .latin2 .cen
AddCharset ISO-8859-3 .iso8859-3 .latin3
AddCharset ISO-8859-4 .iso8859-4 .latin4
AddCharset ISO-8859-5 .iso8859-5 .latin5 .cyr .iso-ru
AddCharset ISO-8859-6 .iso8859-6 .latin6 .arb
AddCharset ISO-8859-7 .iso8859-7 .latin7 .grk
AddCharset ISO-8859-8 .iso8859-8 .latin8 .heb
AddCharset ISO-8859-9 .iso8859-9 .latin9 .trk
AddCharset ISO-2022-JP .iso2022-jp .jis
AddCharset ISO-2022-KR .iso2022-kr .kis
AddCharset ISO-2022-CN .iso2022-cn .cis
AddCharset Big5 .Big5 .big5
# For russian, more than one charset is used (depends on client, mostly):
AddCharset WINDOWS-1251 .cp-1251 .win-1251
AddCharset CP866 .cp866
AddCharset KOI8-r .koi8-r .koi8-ru
AddCharset KOI8-ru .koi8-uk .ua
AddCharset ISO-10646-UCS-2 .ucs2
AddCharset ISO-10646-UCS-4 .ucs4
AddCharset UTF-8 .utf8
AddCharset GB2312 .gb2312 .gb
AddCharset utf-7 .utf7
AddCharset utf-8 .utf8
AddCharset big5 .big5 .b5
AddCharset EUC-TW .euc-tw
AddCharset EUC-JP .euc-jp
AddCharset EUC-KR .euc-kr
AddCharset shift_jis .sjis
#以CGI方式安装PHP
#ScriptAlias /__php_dir__/ /apache/cgiphp5/
#AddType application/x-httpd-php .php4 .php .htm .php3 .inc .fire
#Action application/x-httpd-php /__php_dir__/php.exe
#以apache的模块方式运行php
LoadModule php4_module /apache/php/sapi/php4apache.dll
PHPINIDir /apache/php/php.ini
AddType application/x-httpd-php .php .htm .php3
AddType application/x-httpd-php-source .phps
#支持fcgi
#LoadModule fastcgi_module modules/mod_fastcgi.dll
#AddHandler fastcgi-script .fcgi .fpl
AddType application/x-tar .tgz
#AddEncoding x-compress .Z
#AddEncoding x-gzip .gz .tgz
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddHandler cgi-script .cgi .pl
#AddHandler send-as-is asis
#AddHandler imap-file map
AddHandler type-map var
#AddType text/html .shtml
#AddOutputFilter INCLUDES .shtml
#ErrorDocument 500 The server made a boo boo.
#ErrorDocument 404 /apache/yyfzx/soft
#ErrorDocument 404 /apache/yyfzx/soft
#ErrorDocument 402 http://www.example.com/subscription_info.html
BrowserMatch Mozilla/2 nokeepalive
BrowserMatch MSIE 4.0b2; nokeepalive downgrade-1.0 force-response-1.0
BrowserMatch RealPlayer 4.0 force-response-1.0
BrowserMatch Java/1.0 force-response-1.0
BrowserMatch JDK/1.0 force-response-1.0
BrowserMatch Microsoft Data Access Internet Publishing Provider redirect-carefully
BrowserMatch ^WebDrive redirect-carefully
BrowserMatch ^WebDAVFS/1.[012] redirect-carefully
BrowserMatch ^gnome-vfs redirect-carefully
#<Location /server-status>
# SetHandler server-status
# Order deny,allow
# Deny from all
# Allow from .51web.net
#</Location>
#<Location /server-info>
# SetHandler server-info
# Order deny,allow
# Deny from all
# Allow from .51web.net
#</Location>
<IfModule mod_ssl.c>
Include conf/ssl.conf
</IfModule>
#以下是关于虚拟机的配置
NameVirtualHost 218.87.169.209:80
<VirtualHost 218.87.169.209:80>
RewriteEngine On
RewriteRule ^/index.htm$ /index.php
RewriteRule ^/soft/([0-9] ).htm$ /download.php?soft=$1
RewriteRule ^/sort/([0-9-_] ).htm$ /list.php?list=$1
RewriteRule ^/sort/index.htm$ /type.php
RewriteRule ^/a-z/([0-9] ).htm$ /az.php?id=$1
DocumentRoot /apache/mayidown
ServerName mayidown.3322.org
</VirtualHost>
//以 #开头的就是解释用.启动的时候不加载的.我提供了一个虚拟主机给大家参考重写URL功能
(http://www.fanqiang.com)

b) vsftpd.conf的详细设定

原文地址:
http://www.uplinux.com/www/net/02/117.shtml

作者:施文建

内容:

vsftpd 配置手册

......

5、VSFTPD的设置选项

  VSFTPD的配置文件/etc/vsftpd/vsftpd.conf是个文本文件。以“#”字符开始的行是注释行。每个选项设置为一行, 格式为“option=value”,注意“=”号两边不能留空白符。除了这个主配置文件外,还可以给特定用户设定个人配置文件,具体介绍见后。
  VSFTPD包中所带的vsftpd.conf文件配置比较简单,而且非常偏执狂的(文档自称Smile)。我们可以根据实际情况对其进行一些设置,以使得VSFTPD更加可用。

5.1、连接选项

  本部分主要是一些与建立FTP链接相关的选项。

5.1.1、监听地址与控制端口

  listen_address=ip address
  此参数在VSFTPD使用单独(standalone)模式下有效。此参数定义了在主机的哪个IP地址上监听FTP请求,即在哪个IP地址上 提供FTP服务。对于只有一个IP地址的主机,不需要使用此参数。对于多址主机,不设置此参数,则监听所有IP地址。默认值为无。

  listen_port=port_value
  指定FTP服务器监听的端口号(控制端口),默认值为21。此选项在standalone模式下生效。

5.1.2、FTP模式与数据端口

  FTP 分为两类,PORT FTP和PASV FTP,PORT FTP是一般形式的FTP。这两种FTP在建立控制连接时操作是一样的,都是由客户端首先和FTP服务器的控制端口(默认值为21)建立控制链接,并通过 此链接进行传输操作指令。它们的区别在于使用数据传输端口(ftp-data)的方式。PORT FTP由FTP服务器指定数据传输所使用的端口,默认值为20。PASV FTP由FTP客户端决定数据传输的端口。PASV FTP这种做法,主要是考虑到存在防火墙的环境下,由客户端与服务器进行沟通(客户端向服务器发出数据传输请求中包含了数据传输端口),决定两者之间的数 据传输端口更为方便一些。

  port_enable=YES|NO
  如果你要在数据连接时取消PORT模式时,设此选项为NO。默认值为YES。

  connetc_from_port_20=YES|NO
  控制以PORT模式进行数据传输时是否使用20端口(ftp-data)。YES使用,NO不使用。默认值为NO,但RHL自带的vsftpd.conf文件中此参数设为YES。

  ftp_data_port=port number
  设定ftp数据传输端口(ftp-data)值。默认值为20。此参数用于PORT FTP模式。

  port_promiscuous=YES|NO
  默认值为NO。为YES时,取消PORT安全检查。该检查确保外出的数据只能连接到客户端上。小心打开此选项。

  pasv_enable=YES|NO
  YES,允许数据传输时使用PASV模式。NO,不允许使用PASV模式。默认值为YES。

  pasv_min_port=port number
  pasv_max_port=port number
  设定在PASV模式下,建立数据传输所可以使用port范围的下界和上界,0 表示任意。默认值为0。把端口范围设在比较高的一段范围内,比如50000-60000,将有助于安全性的提高。

  pasv_promiscuous=YES|NO
  此选项激活时,将关闭PASV模式的安全检查。该检查确保数据连接和控制连接是来自同一个IP地址。小心打开此选项。此选项唯一合理的用法是存在于由安全隧道方案构成的组织中。默认值为NO。

  pasv_address=
  此选项为一个数字IP地址,作为PASV命令的响应。默认值为none,即地址是从呼入的连接套接字(incoming connectd socket)中获取。

5.1.3 ASCII模式

  默认情况下,VSFTPD是禁止使用ASCII传输模式。即使FTP客户端使用asc命令,指明要使用ASCII模式,但是,VSFTPD表面上接受了asc命令,而在实际传输文件时,还是使用二进制方式。下面选项控制VSFTPD是否使用ASCII传输模式。

  ascii_upload_enable=YES|NO
  控制是否允许使用ascii模式上传文件,YES允许,NO不允许,默认为NO。

  ascii_download_enable=YES|NO
  控制是否允许使用ascii模式下载文件,YES允许,NO不允许,默认为NO。

5.2、性能与负载控制

5.2.1、超时选项

  idle_session_timeout=
  空闲(发呆)用户会话的超时时间,若是超出这时间没有数据的传送或是指令的输入,则会强迫断线。单位为秒,默认值为300。

  data_connection_timeout=
  空闲的数据连接的超时时间。默认值为300 秒。

  accept_timeout=numerical value
  接受建立联机的超时设定,单位为秒。默认值为60。

  connect_timeout=numerical value
  响应PORT方式的数据联机的超时设定,单位为秒。默认值为60。以上两个选项针对客户端的,将使客户端空闲1分钟后自动中断连接,并在中断1分钟后自动激活连接。

5.2.2 负载控制

  max_clients=numerical value
  此参数在VSFTPD使用单独(standalone)模式下有效。此参数定义了FTP服务器最大的并发连接数,当超过此连接数时,服务器拒绝客户端连接。默认值为0,表示不限最大连接数。

  max_per_ip=numerical value
  此参数在VSFTPD使用单独(standalone)模式下有效。此参数定义每个IP地址最大的并发连接数目。超过这个数目将会拒绝连接。此选项的设置将影响到象网际快车这类的多进程下载软件。默认值为0,表示不限制。

  anon_max_rate=value
  设定匿名用户的最大数据传输速度value,以Bytes/s为单位。默认无。

  local_max_rate=value
  设定用户的最大数据传输速度value,以Bytes/s为单位。默认无。此选项对所有的用户都生效。此外,也可以在用户个人配置文件中使用此选项,以指定特定用户可获得的最大数据传输速率。
  步骤如下:
  ①在vsftpd.conf中指定用户个人配置文件所在的目录,如:
  user_config_dir=/etc/vsftpd/userconf
  ②生成/etc/vsftpd/userconf目录。
  ③用户个人配置文件是在该目录下,与特定用户同名的文件,如:
  /etc/vsftpd/userconf/xiaowang
  ④在用户的个人配置文件中设置local_max_rate参数,如:
  local_max_rate=80000
  以上步骤设定FTP用户xiaowang的最大数据传输速度为80KBytes/s。

  VSFTPD 对于速度控制的变化范围大概在80%到120%之间。比如我们限制最高速度为100KBytes/s, 但实际的速度可能在80KBytes/s 到120KBytes/s 之间。当然,若是线路带宽不足时,速率自然会低于此限制。

5.3 用户选项

  VSFTPD的用户分为三类:匿名用户、本地用户(local user)以及虚拟用户(guest)。

5.3.1、匿名用户

  anonymous_enable=YES|NO
  控制是否允许匿名用户登录,YES允许,NO不允许,默认值为YES。

  ftp_username=
  匿名用户所使用的系统用户名。默认下,此参数在配置文件中不出现,值为ftp。

  no_anon_password=YES|NO
  控制匿名用户登入时是否需要密码,YES不需要,NO需要。默认值为NO。
  
  deny_email_enable=YES|NO
  此参数默认值为NO。当值为YES时,拒绝使用banned_email_file参数指定文件中所列出的e-mail地址进行登录的匿名用 户。即,当匿名用户使用banned_email_file文件中所列出的e-mail进行登录时,被拒绝。显然,这对于阻击某些Dos攻击有效。当此参 数生效时,需追加banned_email_file参数

  banned_email_file=/etc/vsftpd.banned_emails
  指定包含被拒绝的e-mail地址的文件,默认文件为/etc/vsftpd.banned_emails。

  anon_root=
  设定匿名用户的根目录,即匿名用户登入后,被定位到此目录下。主配置文件中默认无此项,默认值为/var/ftp/。

  anon_world_readable_only=YES|NO
  控制是否只允许匿名用户下载可阅读文档。YES,只允许匿名用户下载可阅读的文件。NO,允许匿名用户浏览整个服务器的文件系统。默认值为YES。

  anon_upload_enable=YES|NO
  控制是否允许匿名用户上传文件,YES允许,NO不允许,默认是不设值,即为NO。除了这个参数外,匿名用户要能上传文件,还需要两个条件:一,write_enable参数为YES;二,在文件系统上,FTP匿名用户对某个目录有写权限。

  anon_mkdir_write_enable=YES|NO
  控制是否允许匿名用户创建新目录,YES允许,NO不允许,默认是不设值,即为NO。当然在文件系统上,FTP匿名用户必需对新目录的上层目录拥有写权限。

  anon_other_write_enable=YES|NO
  控制匿名用户是否拥有除了上传和新建目录之外的其他权限,如删除、更名等。YES拥有,NO不拥有,默认值为NO。

  chown_uploads=YES|NO
  是否修改匿名用户所上传文件的所有权。YES,匿名用户所上传的文件的所有权将改为另外一个不同的用户所有,用户由chown_username参数指定。此选项默认值为NO。

  chown_username=whoever
  指定拥有匿名用户上传文件所有权的用户。此参数与chown_uploads联用。不推荐使用root用户。

5.3.2、本地用户

  在使用FTP服务的用户中,除了匿名用户外,还有一类在FTP服务器所属主机上拥有账号的用户。VSFTPD中称此类用户为本地用户(local users),等同于其他FTP服务器中的real用户。

  local_enable=YES|NO
  控制vsftpd所在的系统的用户是否可以登录vsftpd。默认值为YES。

  local_root=
  定义所有本地用户的根目录。当本地用户登入时,将被更换到此目录下。默认值为无。

  user_config_dir=
  定义用户个人配置文件所在的目录。用户的个人配置文件为该目录下的同名文件。个人配置文件的格式与vsftpd.conf格式相同。例如定义 user_config_dir=/etc/vsftpd/userconf,并且主机上有用户xiaowang,lisi,那我们可以在 user_config_dir的目录新增名为xiaowang、lisi的两个文件。当用户lisi 登入时,VSFTPD则会读取user_config_dir下lisi这个文件中的设定值,应用于用户lisi。默认值为无。

5.3.3、虚拟用户

  guest_enable=YES|NO
  若是启动这项功能,所有的非匿名登入者都视为guest。默认值为关闭。

  guest_username=
  定义VSFTPD的guest用户在系统中的用户名。默认值为ftp。

c) smb.conf的详细设定

原文地址:
http://www.douzhe.com/linuxtips/1550.html
http://www.douzhe.com/linuxtips/1561.html

作者:王波(http://www.douzhe.com/linuxtips/1550.html)

内容(节选自http://www.douzhe.com/linuxtips/1550.html):

配置samba

......

#======================= Global Settings =====================================
[global]
  [global]部分定义了伺服器本身使用的配置参数,以及其他共享资源部分使用的预设配置参数,因此相当重要。
# workgroup = NT-Domain-Name or Workgroup-Name, eg: REDHAT4
workgroup = MYGROUP
  工作组设置本地网路使用工作组名字(或者是NT域名字),这对于将正确进行浏览数据中非常重要。 否则,Windows客户就不能从其网路邻居中发现这个Samba伺服器。
# server string is the equivalent of the NT Description field
server string = Samba Server
  server string是对于本地伺服器的简单描述,这些信息将作为这台伺服器的属性,返回给Browser, 显示在Windows客户中作为对这个伺服器的描述。
# This option is important for security. It allows you to restrict
# connections to machines which are on your local network. The
# following example restricts access to two C class networks and
# the "loopback" interface. For more examples of the syntax see
# the smb.conf man page
; hosts allow = 192.168.1. 192.168.2. 127.
  hosts allow参数用于限制可以访问这台samba伺服器的客户机的IP地址范围,通过指定一系列网路地址,使得只有这些网路中的电脑才能访问这台伺服器提供 的资源,以提供安全限制。预设情况下,这行配置被注释了,使得所有的客户都可以访问这台电脑,这样就存在一定的安全问题。
# If you want to automatically load your printer list rather
# than setting them up individually then you'll need this
load printers = yes

# you may wish to override the location of the printcap file
; printcap name = /etc/printcap

# on SystemV system setting printcap name to lpstat should allow
# you to automatically obtain a printer list from the SystemV spool
# system
; printcap name = lpstat

# It should not be necessary to specify the print system type unless
# it is non-standard. Currently supported print systems include:
# bsd, sysv, plp, lprng, aix, hpux, qnx
; printing = bsd
  这些设置是用于设置samba伺服器的印表机资源,load printer=yes就允许samba伺服器对外共享服务器的印表机。由于不同的Unix系统中会使用不同的打印系统和不同的打印设置档案,因此需要设 置正确的 printcap和printing类型,对于使用BSD打印系统的FreeBSD来讲,打印系统为BSD,使用的设置档案为 printcap,这些是预设设置,不需要改动。对于使用Unix System V打印系统的Samba,则需要重新进行 设置。
# Uncomment this if you want a guest account, you must add this to /etc/passwd
# otherwise the user "nobody" is used
; guest account = pcguest
  由于Mircrosoft客户没有用户的概念,因此有时会用没有用户和密码的请求访问伺服器,就需要将这个没有用户的请求映射为系统中的某个 用户,Samba伺服器才能安全的访问系统。guest account 就定义这样的请求在Unix下对应的用户权限。为了安全的原因,不能让这个帐户在系统中有可写的权限,通常可以增加一个专用帐户,如pcguest。如果 这个设置被注释的情况下,系统预设使用nobody执行 Windows客户的请求。一些使用者建议不要使用nobody用户,因为系统中的很多程序预设都使用它,因 此就会有安全问题。
# this tells Samba to use a separate log file for each machine
# that connects
log file = /var/log/log.%m

# Put a capping on the size of the log files (in Kb).
max log size = 50
  这里定义samba的日志档案为/var/log目录下的以log为前缀的档案,%m用于代表从访问的NetBIOS 电脑名,如果使用的用户级认证,还可以使用%U表示不同的登录用户。例如从一台名字为win95c的计算机访问samba伺服器的日志,将记录在 /var/log/log.win95c档案中。max log size定义每个日志档案的存 储限制。
# Security mode. Most people will want user level security. See
# security_level.txt for details.
security = user
# Use password server option only with security = server
; password server = <NT-Server-Name>

# You may wish to use password encryption. Please read
# ENCRYPTION.txt, Win95.txt and WinNT.txt in the Samba documentation.
# Do not enable this option unless you have read those documents
; encrypt passwords = yes
  在SMB协议中,有多个不同的认证方式,包括简单的共享级认证和用户级认证。Unix为多用户操作系统,预设就使用用户级认证方式。当使用用 户级认证的时候,Samba伺服器使用Unix操作系统的用户和密码(来自/etc/passwd )对用户进行认证,这是一种独立的认证方式。而有时候希望所有的伺服器使用同一个认证数据库进行统一认证,因此就导致出现了基于域的统一认证模式。在一个 域中,用户只需要通过域控制器进行认证即可,域中其他SMB伺服器就 将认可域控制器的认证。
  为了使Samba伺服器支持域认证方式,可以有两种不同的设置方式,一种为真正的域认证,另一种为伺服器认证方式,将Samba伺服器配置 为通过伺服器验证用户,这需要指定security=server,以及指定password server的名字为NT的域控制器。认证伺服器的方式不能事先域认证方式提供的一些特征,但它的适用范围并不仅限于域,使用工作组的网路也能通过统一的 认证伺服器来使用统一认证模式。设置域认证方式在后面进行详细解释。
  在Windows NT 4及Windows 98之后,客户和伺服器之间进行认证时,密码不再以明文的方式 在网路中传输了。为了支持加密密码传输,需要设置encrypt passwords选项。同样,这也需要其他复杂的 设置。
# Using the following line enables you to customise your configuration
# on a per machine basis. The %m gets replaced with the netbios name
# of the machine that is connecting
; include = /usr/local/etc/smb.conf.%m
  系统管理员可以为每个特定的电脑定制一个特定的配置档案,那里的设置将覆盖smb.conf中的缺 省设置。这样就可以针对不同的电脑提供不同的配置。
# Most people will find that this option gives better performance.
# See speed.txt and the manual pages for details
socket options = TCP_NODELAY
  socket参数用于配置对TCP的处理方式,以适合Microsoft客户的特征。Microsoft习惯为每个很短的会话都建立单独的连 接,而不是使用一个连接进行多次传输,这样在传输中就需要进行多次连接会话设定过程,对性能有一定影响。为了改善性能,需要设置TCP_NODELAY或 IPTOS_LOWDELAY选项。
# Configure Samba to use multiple interfaces
# If you have multiple network interfaces then you must list them
# here. See the man page for details.
; interfaces = 192.168.12.2/24 192.168.13.2/24
  如果电脑上有多个网路界面,那么就需要让samba向多个界面广播b-node广播包,以及为这些 界面提供资源服务,否则samba就会只向某一个界面提供网路服务。当然也可以设置这个参数,使得samba 只服务于某个指定的网路,而不是伺服器连接所有的网路。
# Browser Control Options:
# set local master to no if you don't want Samba to become a master
# browser on your network. Otherwise the normal election rules apply
; local master = no

# OS Level determines the precedence of this server in master browser
# elections. The default value should be reasonable
; os level = 33

# Domain Master specifies Samba to be the Domain Master Browser. This
# allows Samba to collate browse lists between subnets. Don't use this
# if you already have a Windows NT domain controller doing this job
; domain master = yes

# Preferred Master causes Samba to force a local browser election on startup
# and gives it a slightly higher chance of winning the election
; preferred master = yes
# Use only if you have an NT server on your network that has been
# configured at install time to be a primary domain controller.
; domain controller = <NT-Domain-Controller-SMBName>
  这些设置选项主要用于SMB网路中进行浏览时,设置samba伺服器的行为。预设情况不让samba伺服器参加broswser的推举过程, 为了使得samba伺服器能成为browser,就需要设定local master =yes。然后samba服务就可以根据os level设置的权重进行推举,预设的os level为0,这个权重不会赢得推举。但可以取消注释,将os level设置为33,这将在与所有Windows电脑(包括Windows NT)的推举竞赛中获得胜利,因为NT server的权重为32。设置比33更高的权重,只是在不同的samba 伺服器之间进行选择时才有意义。
  由于Unix及Samba伺服器在同样硬体配置下具有更高的网路性能,因此一般情况下,使用Samba伺服器作Browser更佳。当然可 能在Samba伺服器启动之前,网路中都已经存在了Browser了,一般情况下不必重新进行推举过程,让网路中的现有Browser继续发挥作用。如果 希望Samba伺服器总是成为Browser,可以设置当Samba伺服器启动时,迫使网路中重新进行推举过程,这需要设定perfered master参数。
  通常Samba能够胜任master Browser的角色,然而在多个子网的情况时,网路上就会存在Local master Browser和Domain master Browser。以上的设置只能使Samba成为 Local master Browser,预设Samba并不参加Domain master Brower的推举 。设置Samba伺服器成为Domain master Browser就必须使用domain master参数进 行设置,这对于使用工作组方式进行跨子网浏览意义重大。
  但是如果网路使用的是NT的域方式,就要使用NT的域控制器作为Domain master Browser ,不要设置与NT域控制器同一个子网中的Samba伺服器的domain brower与browser功能,以免它和域控制器竞争。不让Samba伺服器和NT域控制器竞争的原因是由于Windows NT中域控制器还涉及域认证(不是认证域用户,而是认证域上的合法成员电脑),SMB协议中各种复杂功能交错混合,浏览和认证两种不同的功能竟也混合在一 起。由于域控制器完成的域认证任务,Samba伺服器不能够完成,因此为了避免与NT域控制器相互冲突,最好 使用域控制器作Domain master Browser。
  让Samba伺服器了解目前域中存在的域控制器的方法是指定在设置档案中指定域基本控制器PDC(primary Domain Controller)的NetBIOS名字,这需要使用domain controller参 数进行设置。
# Enable this if you want Samba to be a domain logon server for
# Windows95 workstations.
; domain logons = yes

# if you enable domain logons then you may want a per-machine or
# per user logon script
# run a specific logon batch file per workstation (machine)
; logon script = %m.bat
# run a specific logon batch file per username
; logon script = %U.bat

# Where to store roving profiles (only for Win95 and WinNT)
# %L substitutes for this servers netbios name, %U is username
# You must uncomment the [Profiles] share below
; logon path = /%LProfiles/%U
  当用户通过一台Windows 9x客户机使用用户级认证访问网路时,他可以选择登录进网路中的域。这意味着他不但要在SMB伺服器中进行验证,而且会执行伺服器中相应目录中的登录脚 本,以自动执行一些相关设置。通常这种登录 功能是由Windows NT伺服器来执行的,然而Samba伺服器也能完成这个任务,但必须设定domain logons 参数。此后就可以对不同的客户电脑或不同用户指定相应的登录脚本。这个功能还必须要求在本配置档案后面设置 netlogon共享选项,以便客户机能访问相应的登录脚本。
  除了登录脚本之外,Windows NT中为了支持移动用户在不同地点进行漫游,也提供了针对每个用户的描述其使用环境的Profile档案,Samba伺服器也可以通过logon path来支持对windows客户机这种漫游能力的支持。这样当Windows客户机使用漫游功能的时候,客户机会自动将用户的配置档案保存到伺服器 上,此后每次登录进域的时候都重新下载这个配置档案,设置Windows桌面环境。
# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable it's WINS Server
; wins support = yes
# WINS Server - Tells the NMBD components of Samba to be a WINS Client
# Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
; wins server = w.x.y.z

# WINS Proxy - Tells Samba to answer name resolution queries on
# behalf of a non WINS capable client, for this to work there must be
# at least one WINS Server on the network. The default is NO.
; wins proxy = yes

# DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names
# via DNS nslookups. The built-in default for versions 1.9.17 is yes,
# this has been changed in version 1.9.18 to no.
dns proxy = no
  上面的这些选项是用于设置NetBIOS名字解析方式,wins support选项使得nmdb能对外表现 为一个NBNS伺服器。wins server用于指定一个外部名字伺服器的地址(可以为NT上的wins伺服器或另一个Samba伺服器),使得nmbd能用做NBNS客户端,通过访问 该wins名字伺服器解析NetBIOS名字。
  此外,还有一些不使用名字伺服器进行解析的NetBIOS客户,如果名字伺服器位于另一个子网上,那么它们就无法正确解析名字,而 Samba可以使用wins proxy帮助它们使用名字伺服器解析地址。例如一个WINS服务器在另一个子网上,本地子网内的Samba伺服器配置了wins server的地址,其他Windows客户没有设置wins伺服器地址,它们使用b-node广播方式查询名字,在这台Samba伺服器设置了wins proxy能力之后,它就能代替wins伺服器回应客户请求。因此要用作wins代理,就必须本身能使用名字伺服器进行解析,就要 求先设置wins server参数。
  此外,NetBIOS名字解析也可以扩展到通过DNS查询进行帮助,使用dns proxy设置就能让Samba 伺服器通过dns进行查询,回应NetBIOS名字查询请求。
* [homes]个人目录共享
#============================ Share Definitions ==============================
[homes]
comment = Home Directories
browseable = no
writable = yes
  [homes]部分使得每个Unix用户通过SMB客户登录上来的时候,可以共享使用他自己的个人目录。这个 共享资源具备特别属性,当用户登录上之后,共享名就不是homes,而是被伺服器映射为用户自己的标识符。
  设置这个特别的共享选项,就允许每个用户访问自己的个人目录,而不必为每个用户都配置一个共享资源部分。正由 于系统会自动映射,因此就不需要定义要共享的档案目录路径,而在其它档案资源共享选项中,都需要使用path参数进行 定义。
  由于Samba系统会自动将homes共享名改变为用户的个人标识符,因此要设定browseable=no ,设置homes本身这个名字不出现在资源列表中。writable为用户写权限设置,由于是在用户的个人目录下,用 户可以具备写权限。
* [netlogon]与[Profiles]
# Un-comment the following and create the netlogon directory for Domain Logons
; [netlogon]
; comment = Network Logon Service
; path = /usr/local/samba/lib/netlogon
; guest ok = yes
; writable = no
; share modes = no
  当允许Samba伺服器支持客户的网路登录功能之后(设置domain logon),就需要设置 [netlogon]部分(删除注释符号),为guest用户打开登录路径的访问权限,以保证每个用户都能访问其自己的登录脚本。由于需要使用guest 对应的Unix帐户访问登录脚本,这个登录路径及其下面的脚本档案都要允许该Unix帐号可 以读取。
  建立这个目录之后,要设定正确的权限,并且创建这个目录下对应各个电脑或用户的登录脚本,以提供给客户正确的登录脚本。
# Un-comment the following to provide a specific roving profile share
# the default is to use the user's home directory
;[Profiles]
; path = /usr/local/samba/profiles
; browseable = no
; guest ok = yes
  当支持Windows电脑漫游能力时,可以设定[Profiles]部分,并为相应的路径建立目录,及分配权限。 来为Window电脑用户设置桌面环境。
* [Printers]印表机设置
# NOTE: If you have a BSD-style print system there is no need to
# specifically define each individual printer
[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
# Set public = yes to allow user 'guest account' to print
guest ok = no
writable = no
printable = yes
  这个部分就用于设置将printcap中定义的所有印表机使用的相关设置,预设情况下允许所有的合法客户使用 所有的印表机。BSD风格的打印系统,不需要任何设置就能正确共享所有的印表机,当然也可以使用printer参数指 定具体的印表机以提供共享。而path参数定义的是印表机缓冲区的位置。guest ok、writeable用于设 置正确的权限,而 printable用于设置打印属性。
  由于Windows的打印驱动已经将要打印的档案转化为印表机支持的那种描述语言,因此这些打印档案不再需要 任何过滤器进行转换。因此需要在printcap中定义一个不使用任何过滤器、直接将打印文档输出到印表机端口的打印 机选项。
* 其他专有共享目录
# This one is useful for people to share files
;[tmp]
; comment = Temporary file space
; path = /tmp
; read only = no
; public = yes

# A publicly accessible directory, but read only, except for people in
# the "staff" group
;[public]
; comment = Public Stuff
; path = /home/samba
; public = yes
; writable = yes
; printable = no
; write list = @staff

# Other examples.
#
# A private printer, usable only by fred. Spool data will be placed in fred's
# home directory. Note that fred must have write access to the spool directory,
# wherever it is.
;[fredsprn]
; comment = Fred's Printer
; valid users = fred
; path = /homes/fred
; printer = freds_printer
; public = no
; writable = no
; printable = yes

# A private directory, usable only by fred. Note that fred requires write
# access to the directory.
;[fredsdir]
; comment = Fred's Service
; path = /usr/somewhere/private
; valid users = fred
; public = no
; writable = yes
; printable = no

# a service which has a different directory for each machine that connects
# this allows you to tailor configurations to incoming machines. You could
# also use the %U option to tailor it by user name.
# The %m gets replaced with the machine name that is connecting.
;[pchome]
; comment = PC Directories
; path = /usr/pc/%m
; public = no
; writable = yes

# A publicly accessible directory, read/write to all users. Note that all files
# created in the directory by users will be owned by the default user, so
# any user with access can delete any other user's files. Obviously this
# directory must be writable by the default user. Another user could of course
# be specified, in which case all files would be owned by that user instead.
;[public]
; path = /usr/somewhere/else/public
; public = yes
; only guest = yes
; writable = yes
; printable = no

# The following two entries demonstrate how to share a directory so that two
# users can place files there that will be owned by the specific users. In this
# setup, the directory should be writable by both users and should have the
# sticky bit set on it to prevent abuse. Obviously this could be extended to
# as many users as required.
;[myshare]
; comment = Mary's and Fred's stuff
; path = /usr/somewhere/shared
; valid users = mary fred
; public = no
; writable = yes
; printable = no
; create mask = 0765

d) sendmail.mc的详细设定

地址:
http://www.amazepc.com/gugong/gugong/html/sendmail%B4%F3%C8%AB.html

作者: ?

内容(节选):

Sendmail大全

......

divert

通常总是设置为divert(-1)让m4在输出中去掉一些垃圾。

OSTYPE OSTYPE

定义使用的操作系统类型,当然在我们的情况下就是linux,但是一定要注意m4程序中 引号的用法,一个反引号和一个正引号才代表把对应的东西括起来。

define

定义一些全局设置,对于Linux系统,设置了OSTYPE之后,可以定义下面的一些全局 参数,如果不定义,就使用缺省值。例如:

define(ALIAS_FILE,/etc/aliases)

变量名 说明(方括号中为缺省值)

ALIAS_FILE [/etc/aliases]

别名文件的位置。如果有多个别名文件,需要把它们用引号括起来(别忘了引号规则 !)。

confCR_FILE [/etc/mail/relay-domains]

缺省的域定义文件,在这个域中定义的域中机器可以通过你的服务器进行邮件发送。

HELP_FILE [/usr/lib/sendmail.hf]

此文件中含有对SMTP的HELP命令进行响应时要列出的信息。

QUEUE_DIR [/var/spool/mqueue]

邮件队列文件所在目录。

STATUS_FILE [/etc/sendmail.st]

sendmail的状态信息文件。

LOCAL_MAILER_PATH [/bin/mail]

用于投递本地邮件的程序。

LOCAL_MAILER_FLAGS [rmn9]

local mailer要用到的标志,永远包含标志lsDFM。

LOCAL_MAILER_ARGS [mail -d $u]

在投递本地邮件时所传送的参数。

LOCAL_MAILER_MAX [没有]

如定义了此参数,则为此邮件服务器所能接收最大单个邮件大小。

LOCAL_MAILER_CHARSET [没有]

如果定义了此参数,则被转化为MIME格式的从其他地址到local mailer的含有8位字符 的信息将被标为此字符集。

LOCAL_SHELl_PATH [/bin/sh]

用于投递利用管道功能处理的邮件的shell.

LOCAL_SHELL_FLAGS [eu9]

prog mailer用到的标志。在此标志中永远包含标志lsDFM.

LOCAL_SHELL_DIR [$z:/]

shell运行时所要查找的目录路径。

USENET_MAILER_PATH [/usr/lib/news/inews]

用于投递电子新闻组的程序名称。

USENET_MAILER_FLAGS [rlsDFMmn]

usenet mailer的投递标志。

USENET_MAILER_ARGS [-m -h -n]

usenet mailer的命令行参数。

USENET_MAILER_MAX [100000]

usenet mailer所能接收的最大信息大小。

SMTP_MAILER_FLAGS [没有]

SMTP mailer附加标志。对所有基于SMTPmailer其默认标志为mDFMUX;基于esmtp的邮差 (mailer)加上a标志;而基于"smtp8"的邮差则加上8。

SMTP_MAILER_MAX [没有]

使用smtp,smtp8或esmtp传输的单个邮件最大容量。

SMTP_MAILER_CHARSET [没有]

如果定义了此参数,则被转化为MIME格式的从其他地址到任一个smtp mailer的含有8 位字符的信息将被标为此字符集。

POP_MAILER_PATH [/usr/lib/mh/spop]

pop邮差的路径名。

POP_MAILER_FLAGS [Penu]

pop邮差附加标志。同时总是加上标志lsDFM。

POP_MAILER_ARGS [pop $u]

传给pop邮差的参数。

PROCMAIL_MAILER_PATH [/usr/local/bin/procmail]

procmail程序的路径名。此外FEATURE(local procmail)也用到此参数。

PROCMAIL_MAILER_FlAGS [SPhnu9]加给Procmail邮差的标志。同时总是加上"DFM"标志 。

PROCMAIL_MAILER_MAX [没有]

procmail所接收的最大单个邮件容量。如果你对某些人发送巨大的邮件感到困扰,启 用这个选项。

FEATURE

定义sednamil的一些运行参数,通常对我们来说最重要的一些选项是:

use_cw_file

读取文件/etc/sendmail.cw以确定这台机器应该替哪些机器接受邮件。此主机的别名 。当你使用 MX记录将此主机定义为其他主机的邮件交换机时需要使用这个特性。例如: FEATURE(use_cw_file)

relay_hosts_only

通常情况下,sendmail为sendmail.cf中明确列出的域(一般是localhost)和/etc/ mail/relay-domains中定义的域进行投递代理。缺省下这两处定义的都是域的名字。如 果你定义了这个参数,那么这两处的内容将被解释为主机名字。

use_ct_file

读取文件/etc/sendmail.ct以取得系统“信任”的用户名字,这些用户可以使用-f设 置其发信信封上的from地址而不产生警告信息。

redirect

使用REDIRECT特性,这个特性允许你对某些已经搬迁的用户发出重定向信息。(见下 一节)。例如:

FEATURE(redirect)

mailertable

包含一个用于覆盖到特定域路由(routing)的"mailer table".此特性参数定义可以是 一个关键词定义。如未指定任何参数, 其定义通常是:

FEATURE(mailertable,`hash -o /etc/mailertable)

domaintable

包含一个用于提供域名映象的"domain table",当改变你自已的域名时可能有用(如 你公司由oldname.com改为newname.com)。其定义通常是:

FEATURE(domiaintable,`hash -o /etc/domaintable)

always_add_domain

在本地发送邮件时也加上其主机域名。例如:

FEATURE(always_add_domain)

allmasquerade

如果使用了伪装(masquerading,使用MASQUERADE_AS),则此特性将使接收者的地址也伪 装为来自所伪装为主机。

limitd_masquerade

通常情况下$w所列出的所有主机将被伪装。如果使用了此特性,则只对那些$m所列出 的主机进行伪装。

masquerade_entire_domain

如使用了伪装且设置了MASQUERADE_DOMAIN,此特性将引起 地址重写,使所要伪装的网 域整个被隐藏。所有含有被伪装域名的主机用伪装域名(通常是MASQUERADE_AS)进行重写 。

masquerade_envelope

用此特性告知sendmail将信封和信件头中上的发送者和接收者进行伪装。

定义了有关masq的选项之后,就可以使用伪装了,可以直接将伪装命令写入mc模板, 示例如下:

MASQUERADE_AS(masq.com)

MASQUERADE_DOMAIN(foo.org)

这意味着我们的someone@foo.org发信的时候,sendmail将会把它的信封伪装为some one@masq.com。这对于统一整个域的电子邮件是非常重要的。

virtusertable

允许在同一个主机上使用多个虚拟域。参考下一节。例如:

FEATURE(`virtusertable,`hash –o /etc/mail/virtusertable)

nullclient

这是一个特殊情况--它生成一个除了支持将所有的邮件通过本地的基于SMTP的网络转 递到一个中心邮件HUB之外不含任何内容的配置文件。其参数是此邮件HUB的主机名。唯 一可与nullclient一起使用的其他特性是"nocanonify"(这样可以使非完全地址可通过S MTP连接进行发送;通常情况下地址将使用伪装名字转变为完全邮件名称,此伪装名字默 认值为邮件HUB主机的名字)。 在此特性使用是不应定义任何邮差。当然也不进行别名 处理或转寄。

local_procmail

使用procmail作为本地邮差。

smrsh

对到程序的邮件使用使用sendmail发行版所带的SendMail Restricted SHell (smrsh )而不是/bin/sh。由于sendmail是以root权限执行,某个发送到恶意程序的邮件可以破 坏系统,只要利用别名转向使得邮件被转发到对应的程序,因此缺省下sendmail用smrs h来处理邮件转发到程序的请求。这可以提高本地系统管理员控制对那些通过邮件运行程 序的行为,例如

FEATURE(`smrsh,`/usr/sbin/smrsh)

注意有些程序无法通过smrsh运行(例如majordomo的wrapper程序),这是出于安全 性的考虑,smrsh不准用户程序使用一些setuid功能。如果你一定要使用这些程序,清将 smrsh定义成其他shell程序,如sh。

access_db

本地存取控制文件的名字,缺省是/etc/mail/access.db,也可以用命令行指出,例 如:

FEATURE(`access_db)

或者 或者

FEATURE(`access_db,`hash –o /etc/mail/access)

mailertable

允许使用mailertable文件。这个文件定义对某确定的域使用什么样的邮差。例如:

FEATURE(`mailertable’,`hash –o /etc/mail/mailertable)。

blacklist_recipients

允许你用前面定义的access_db来禁止某个地方来的邮件,或是某个人的邮件,等等 。

relay_based_on_MX

是否允许别人用你的机器当成MX交换器。如果你设置了这个选项,那么任何人只要在 域名服务器中将你的机器设置成为他的MX交换就可以用你的机器转发电子邮件。这个功 能意味着:你的机器替它接受电子邮件,再提交给它;一般来说这个功能是不必要的; 如果你一定要使用这个选项,记住你可能被庞大的邮件流量吞没。但是在一种情况下这 个功能又是不可缺少的:假如你的系统有防火墙,只有邮件服务器能够对外连接,那么 这个功能是使网络内部其他主机能够接受自己电子邮件的唯一方法。

DOMAIN

这个关键字一般用来定义邮件中继,假如你的系统里面除了Internet互连之外还有类 似Decnet,UUCP之类的东西,那么你就需要设置DOMAIN来保证非internet的邮件被正确 中继。对于一般的系统,不需要定义这个属性。

MAILER

定义可以使用的投递程序(邮差)。

例如:

MAILER(smtp)

定义smtp投递。

MAILER(local)

定义局部投递。

如果你想做邮件服务,这样两个邮差是必须的。

e) tcp端口对照表(0~1457)

0=Reserved
1=tcpmux
2=compressnet
3=compressnet
4=Unassigned
5=Remote Job Entr
6=Unassigned
7=Echo
8=Unassigned
9=Discard
10=Unassigned
11=Active Users
12=Unassigned
13=Daytime
14=Unassigned
15=Unassigned
16=Unassigned
17=Quote of the Day
18=Message Send Protocol
19=Character Generator
20=FTP (Data)
21=FTP (Control)
22=Unassigned
23=Telnet
24=Private mail-system
25=SMTP
26=Unassigned
27=NSW User System FE
28=Unassigned
29=MSG ICP
30=Unassigned
31=MSG Authentication
32=Unassigned
33=Display Support Protocol
34=Unassigned
35=Private printer server
36=Unassigned
37=Time
38=Route Access Protocol
39=Resource Location Protocol
40=Unassigned
41=Graphics
42=Host Name Server
43=Who Is
44=MPM FLAGS Protocol
45=Message Processing Module (recv)
46=mpm-snd, MPM (default send)
47=ni-ftp
48=Digital Audit Daemon
49=login, Login Host Protocol
50=re-mail-ck, Remote Mail Checking Protocol
51=IMP Logical Address Maintenance
52=xns-time, XNS Time Protocol
53=domain, Domain Name Server
54=xns-ch, XNS Clearinghouse
55=ISI Graphics Language
56=XNS Authentication
57=Private terminal access
58=XNS Mail
59=Private file service
60=Unassigned
61=NI MAIL
62=ACA Services
63=Unassigned
64=Communications Integrator (CI)
65=TACACS-Database Service
66=Oracle SQL*NET
67=Bootstrap Protocol Server
68=Bootstrap Protocol Client
69=Trivial File Transfer
70=Gophergopher
71=Remote Job Service
72=Remote Job Service
73=Remote Job Service
74=Remote Job Service
75=any private dial out service
76=Distributed External Object Store
77=any private RJE service
78=vettcpvettcp
79=Finger server
80=HTTP
81=HOSTS2 Name Server
82=XFER Utility
83=MIT ML Device
84=Common Trace Facility
85=MIT ML Device
86=Micro Focus Cobol
87=Private terminal link
88=Kerberos
89=SU/MIT Telnet Gateway
90=DNSIX Securit Attribute Token Map
91=MIT Dover Spooler
92=Network Printing Protocol
93=Device Control Protocol
94=Tivoli Object Dispatcher
95=SUPDUPsupdup
96=DIXIE Protocol Specification
97=Swift Remote Vitural File Protocol
98=TAC Newstacnews
99=Metagram Relay
100=newacct [unauthorized use]
101=NIC Host Name Server
102=ISO-TSAP
103=Genesis Point-to-Point Trans Net
104=ACR-NEMA Digital Imag. & Comm. 300
105=Mailbox Name Nameserver
106=3COM-TSMUX3com-tsmux
107=Remote Telnet Service
108=SNA Gateway Access Server
109=Post Office Protocol - Version 2
110=Post Office Protocol - Version 3
111=SUN RPC
112=McIDAS Data Transmission Protocol
113=Authentication Service
114=Audio News Multicast
115=Simple File Transfer Protocol
116=ANSA REX Notify
117=UUCP Path Service
118=SQL Servicessqlserv
119=Network News Transfer Protocol
120=CFDPTKTcfdptkt
121=Encore Expedited Remote Pro.Call
122=SMAKYNETsmakynet
123=Network Time Protocol
124=ANSA REX Trader
125=Locus PC-Interface Net Map Ser
126=Unisys Unitary Login
127=Locus PC-Interface Conn Server
128=GSS X License Verification
129=Password Generator Protocol
130=cisco FNATIVE
131=cisco TNATIVE
132=cisco SYSMAINT
133=Statistics Service
134=INGRES-NET Service
135=Location Service
136=PROFILE Naming System
137=NETBIOS Name Service
138=NETBIOS Datagram Service
139=NETBIOS Session Service
140=EMFIS Data Service
141=EMFIS Control Service
142=Britton-Lee IDM
143=Interim Mail Access Protocol v2
144=NewSnews
145=UAAC Protocoluaac
146=ISO-IP0iso-tp0
147=ISO-IPiso-ip
148=CRONUS-SUPPORT
149=AED 512 Emulation Service
150=SQL-NETsql-net
151=HEMShems
152=Background File Transfer Program
153=SGMPsgmp
154=NETSCnetsc-prod
155=NETSCnetsc-dev
156=SQL Service
157=KNET/VM Command/Message Protocol
158=PCMail Serverpcmail-srv
159=NSS-Routingnss-routing
160=SGMP-TRAPSsgmp-traps
161=SNMP
162=SNMP TRAP
163=CMIP/TCP Manager
164=CMIP/TCP Agent
165=Xeroxxns-courier
166=Sirius Systems
167=NAMPnamp
168=RSVDrsvd
169=Send
170=Network PostScript
170=Network PostScript
171=Network Innovations Multiplex
172=Network Innovations CL/1
173=Xyplexxyplex-mux
174=MAILQ
175=VMNET
176=GENRAD-MUXgenrad-mux
177=X Display Manager Control Protocol
178=NextStep Window Server
179=Border Gateway Protocol
180=Intergraphris
181=Unifyunify
182=Unisys Audit SITP
183=OCBinderocbinder
184=OCServerocserver
185=Remote-KIS
186=KIS Protocolkis
187=Application Communication Interface
188=Plus Five's MUMPS
189=Queued File Transport
189=Queued File Transport
190=Gateway Access Control Protocol
190=Gateway Access Control Protocol
191=Prospero Directory Service
191=Prospero Directory Service
192=OSU Network Monitoring System
193=srmp, Spider Remote Monitoring Protocol
194=irc, Internet Relay Chat Protocl
195=DNSIX Network Level Module Audit
196=DNSIX Session Mgt Module Audit Redir
197=Directory Location Service
198=Directory Location Service Monitor
199=SMUX
200=IBM System Resource Controller
201=at-rtmp AppleTalk Routing Maintenance
202=at-nbp AppleTalk Name Binding
203=at-3 AppleTalk Unused
204=AppleTalk Echo
205=AppleTalk Unused
206=AppleTalk Zone Information
207=AppleTalk Unused
208=AppleTalk Unused
209=Trivial Authenticated Mail Protocol
210=ANSI Z39.50z39.50
211=Texas Instruments 914C/G Terminal
212=ATEXSSTRanet
213=IPX
214=VM PWSCSvmpwscs
215=Insignia Solutions
216=Access Technology License Server
217=dBASE Unix
218=Netix Message Posting Protocol
219=Unisys ARPsuarps
220=Interactive Mail Access Protocol v3
221=Berkeley rlogind with SPX auth
222=Berkeley rshd with SPX auth
223=Certificate Distribution Center
224=Reserved (224-241)
241=Reserved (224-241)
242=Unassigned#
243=Survey Measurement
244=Unassigned#
245=LINKlink
246=Display Systems Protocol
247-255 Reserved
256-343 Unassigned
344=Prospero Data Access Protocol
345=Perf Analysis Workbench
346=Zebra serverzserv
347=Fatmen Serverfatserv
348=Cabletron Management Protocol
349-370 Unassigned
371=Clearcaseclearcase
372=Unix Listservulistserv
373=Legent Corporation
374=Legent Corporation
375=Hasslehassle
376=Amiga Envoy Network Inquiry Proto
377=NEC Corporation
378=NEC Corporation
379=TIA/EIA/IS-99 modem client
380=TIA/EIA/IS-99 modem server
381=hp performance data collector
382=hp performance data managed node
383=hp performance data alarm manager
384=A Remote Network Server System
385=IBM Application
386=ASA Message Router Object Def.
387=Appletalk Update-Based Routing Pro.
388=Unidata LDM Version 4
389=Lightweight Directory Access Protocol
390=UISuis
391=SynOptics SNMP Relay Port
392=SynOptics Port Broker Port
393=Data Interpretation System
394=EMBL Nucleic Data Transfer
395=NETscout Control Protocol
396=Novell Netware over IP
397=Multi Protocol Trans. Net.
398=Kryptolankryptolan
399=Unassigned#
400=Workstation Solutions
401=Uninterruptible Power Supply
402=Genie Protocol
403=decapdecap
404=ncednced
405=ncldncld
406=Interactive Mail Support Protocol
407=Timbuktutimbuktu
408=Prospero Resource Manager Sys. Man.
409=Prospero Resource Manager Node Man.
410=DECLadebug Remote Debug Protocol
411=Remote MT Protocol
412=Trap Convention Port
413=SMSPsmsp
414=InfoSeekinfoseek
415=BNetbnet
416=Silverplattersilverplatter
417=Onmuxonmux
418=Hyper-Ghyper-g
419=Arielariel1
420=SMPTEsmpte
421=Arielariel2
422=Arielariel3
423=IBM Operations Planning and Control Start
424=IBM Operations Planning and Control Track
425=ICADicad-el
426=smartsdpsmartsdp
427=Server Location
429=OCS_AMU
430=UTMPSDutmpsd
431=UTMPCDutmpcd
432=IASDiasd
433=NNSPnnsp
434=MobileIP-Agent
435=MobilIP-MN
436=DNA-CMLdna-cml
437=comscmcomscm
439=dasp, Thomas Obermair
440=sgcpsgcp
441=decvms-sysmgtdecvms-sysmgt
442=cvc_hostdcvc_hostd
443=https
444=Simple Network Paging Protocol
445=Microsoft-DS
446=DDM-RDBddm-rdb
447=DDM-RFMddm-dfm
448=DDM-BYTEddm-byte
449=AS Server Mapper
450=TServertserver
512=exec, Remote process execution
513=login, remote login
514=cmd, exec with auto auth.
514=syslog
515=Printer spooler
516=Unassigned
517=talk
519=unixtime
520=extended file name server
521=Unassigned
522=Unassigned
523=Unassigned
524=Unassigned
526=newdate
530=rpc courier
531=chatconference
532=readnewsnetnews
533=for emergency broadcasts
539=Apertus Technologies Load Determination
540=uucp
541=uucp-rlogin
542=Unassigned
543=klogin
544=kshell
545=Unassigned
546=Unassigned
547=Unassigned
548=Unassigned
549=Unassigned
550=new-who
551=Unassigned
552=Unassigned
553=Unassigned
554=Unassigned
555=dsf
556=remotefs
557-559=rmonitor
560=rmonitord
561=dmonitor
562=chcmd
563=Unassigned
564=plan 9 file service
565=whoami
566-569 Unassigned
570=demonmeter
571=udemonmeter
572-599 Unassigned ipc server
600=Sun IPC server
607=nqs
606=Cray Unified Resource Manager
608=Sender-Initiated/Unsolicited File Transfer
609=npmp-trapnpmp-trap
610=npmp-localnpmp-local
611=npmp-guinpmp-gui
634=ginadginad
666=Doom Id Software
704=errlog copy/server daemon
709=EntrustManager
729=IBM NetView DM/6000 Server/Client
730=IBM NetView DM/6000 send/tcp
731=IBM NetView DM/6000 receive/tcp
741=netGWnetgw
742=Network based Rev. Cont. Sys.
744=Flexible License Manager
747=Fujitsu Device Control
748=Russell Info Sci Calendar Manager
749=kerberos administration
751=pump
752=qrh
754=send
758=nlogin
759=con
760=ns
762=quotad
763=cycleserv
765=webster
767=phonephonebook
769=vid
771=rtip
772=cycleserv2
774=acmaint_dbd
775=acmaint_transd
780=wpgs
786=Concertconcert
800=mdbs_daemon
996=Central Point Software
997=maitrd
999=puprouter
1023=Reserved
1024=Reserved
1025=network blackjack
1030=BBN IAD
1031=BBN IAD
1032=BBN IAD
1067=Installation Bootstrap Proto. Serv.
1068=Installation Bootstrap Proto. Cli.
1080=SOCKS
1083=Anasoft License Manager
1084=Anasoft License Manager
1155=Network File Access
1222=SNI R&D network
1248=hermes
1346=Alta Analytics License Manager
1347=multi media conferencing
1347=multi media conferencing
1348=multi media conferencing
1349=Registration Network Protocol
1350=Registration Network Protocol
1351=Digital Tool Works (MIT)
1352=/Lotus Notelotusnote
1353=Relief Consulting
1354=RightBrain Software
1355=Intuitive Edge
1356=CuillaMartin Company
1357=Electronic PegBoard
1358=CONNLCLIconnlcli
1359=FTSRVftsrv
1360=MIMERmimer
1361=LinX
1362=TimeFliestimeflies
1363=Network DataMover Requester
1364=Network DataMover Server
1365=Network Software Associates
1366=Novell NetWare Comm Service Platform
1367=DCSdcs
1368=ScreenCastscreencast
1369=GlobalView to Unix Shell
1370=Unix Shell to GlobalView
1371=Fujitsu Config Protocol
1372=Fujitsu Config Protocol
1373=Chromagrafxchromagrafx
1374=EPI Software Systems
1375=Bytexbytex
1376=IBM Person to Person Software
1377=Cichlid License Manager
1378=Elan License Manager
1379=Integrity Solutions
1380=Telesis Network License Manager
1381=Apple Network License Manager
1382=udt_os
1383=GW Hannaway Network License Manager
1384=Objective Solutions License Manager
1385=Atex Publishing License Manager
1386=CheckSum License Manager
1387=Computer Aided Design Software Inc LM
1388=Objective Solutions DataBase Cache
1389=Document Manager
1390=Storage Controller
1391=Storage Access Server
1392=Print Managericlpv-pm
1393=Network Log Server
1394=Network Log Client
1395=PC Workstation Manager software
1396=DVL Active Mail
1397=Audio Active Mail
1398=Video Active Mail
1399=Cadkey License Manager
1400=Cadkey Tablet Daemon
1401=Goldleaf License Manager
1402=Prospero Resource Manager
1403=Prospero Resource Manager
1404=Infinite Graphics License Manager
1405=IBM Remote Execution Starter
1406=NetLabs License Manager
1407=DBSA License Manager
1408=Sophia License Manager
1409=Here License Manager
1410=HiQ License Manager
1411=AudioFileaf
1412=InnoSysinnosys
1413=Innosys-ACLinnosys-acl
1414=IBM MQSeriesibm-mqseries
1415=DBStardbstar
1416=Novell LU6.2novell-lu6.2
1417=Timbuktu Service 1 Port
1417=Timbuktu Service 1 Port
1418=Timbuktu Service 2 Port
1419=Timbuktu Service 3 Port
1420=Timbuktu Service 4 Port
1421=Gandalf License Manager
1422=Autodesk License Manager
1423=Essbase Arbor Software
1424=Hybrid Encryption Protocol
1425=Zion Software License Manager
1426=Satellite-data Acquisition System 1
1427=mloadd monitoring tool
1428=Informatik License Manager
1429=Hypercom NMSnms
1430=Hypercom TPDUtpdu
1431=Reverse Gosip Transport
1432=Blueberry Software License Manager
1433=Microsoft-SQL-Server
1434=Microsoft-SQL-Monitor
1435=IBM CISCibm-cics
1436=Satellite-data Acquisition System 2
1437=Tabulatabula
1438=Eicon Security Agent/Server
1439=Eicon X25/SNA Gateway
1440=Eicon Service Location Protocol
1441=Cadis License Management
1442=Cadis License Management
1443=Integrated Engineering Software
1444=Marcam License Management
1445=Proxima License Manager
1446=Optical Research Associates License Manager
1447=Applied Parallel Research LM
1448=OpenConnect License Manager
1449=PEportpeport
1450=Tandem Distributed Workbench Facility
1451=IBM Information Management
1452=GTE Government Systems License Man
1453=Genie License Manager
1454=interHDL License Manager
1454=interHDL License Manager
1455=ESL License Manager
1456=DCAdca
1457=Valisys

分享到:
评论

相关推荐

    ftp服务部署及使用,/etc/vsftpd/vsftpd.conf

    ftp服务部署及使用,/etc/vsftpd/vsftpd.conf

    vsftpd-3.0.5-1.el8.x86_64.rpm

    sed -i 's|anonymous_enable=YES|anonymous_enable=NO|g' /etc/vsftpd/vsftpd.conf sed -i 's|listen=NO|listen=YES|g' /etc/vsftpd/vsftpd.conf sed -i 's|listen_ipv6=YES|listen_ipv6=NO|g' /etc/vsftpd/vsftpd....

    vsftpd-3.0.5.el 7.9.zip

    sed -i 's|anonymous_enable=YES|anonymous_enable=NO|g' /etc/vsftpd/vsftpd.conf sed -i 's|listen=NO|listen=YES|g' /etc/vsftpd/vsftpd.conf sed -i 's|listen_ipv6=YES|listen_ipv6=NO|g' /etc/vsftpd/vsftpd....

    vsftpd-3.0.5-1.el6.x86_64.rpm

    sed -i 's|anonymous_enable=YES|anonymous_enable=NO|g' /etc/vsftpd/vsftpd.conf sed -i 's|listen=NO|listen=YES|g' /etc/vsftpd/vsftpd.conf sed -i 's|listen_ipv6=YES|listen_ipv6=NO|g' /etc/vsftpd/vsftpd....

    vsftp3.0.4适用于el7(centos7.x),规避3.0.2版本的漏洞

    cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf.bak 4) 如果运行了vsftpd,则先停止: systemctl stop vsftpd 5) 安装升级vsftpd 3.0.4 rpm -Uvh vsftpd-3.0.4-1.el7.x86_64.rpm rpm -Uvh vsftpd-...

    Linux操作系统:配置匿名账号FTP服务器.pptx

    /etc/vsftpd/vsftpd.conf 配置FTP服务器主要工作要通过修改此文件来完成。 2 PAM配置文件 etc/pam.d/vsftpd 主要用来加强vsftpd服务器的用户认证。 3 用户配置文件 /etc/vsftpd/user_list 主要根据主配置文件配置...

    vsftp-arm64

    rm -rf /home/vsftpd/ docker run -d --name vsftpd --net=host -v /home/vsftpd:/etc/vsftpd -v /home/ftpusr:/home/ftpusr -v /home/ftpserver:/home/ftpserver --restart=always lstcml/vsftpd docker ps ...

    构建基于虚拟用户的vsftpd服务器应用

    安装: [root@server ~]# yum install -y vsftpd .../etc/vsftpd/ftpusers /etc/vsftpd/user_list /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd_conf_migrate.sh /usr/sbin/vsftpd ....... [root@server ~]# /e

    vsftpd.conf

    chroot_list_file=/etc/vsftpd/chroot_list allow_writeable_chroot=YES listen=NO #config ssl ssl_enable=YES allow_anon_ssl=NO force_local_data_ssl=YES force_local_logins_ssl=YES force_anon_logins_ssl=...

    Linux操作系统:配置本地账号FTP服务器.pptx

    vim /etc/vsftpd/vsftpd.conf local enable=YES 设置不允许匿名账户FTP服务器 进入vsftpd主配置文件: vim /etc/vsftpd/vsftpd.conf 不允许匿名用户登录: nonymous_enable=NO #不允许匿名用户登录 local_enable=YES...

    web test LoadRunner FTP / vsftpd / vsftp / WebUploader 0.1.5 / shangchuan

    NULL 博文链接:https://lindows.iteye.com/blog/2153084

    linux vsftpd搭建步骤 亲测可用

    db_load -T -t hash -f /etc/vsftpd/vuser_passwd.txt /etc/vsftpd/vuser_passwd.db 注:(每添加一用户和秘密就得生成一次)  编辑认证文件,全部注释掉原来语句,再增加以下两句 [root@ftp /]# cat /etc/pam.d/...

    嵌入式FTP服务器(vsftpd)移植手册

    嵌入式FTP服务器(vsftpd)移植手册

    Linux操作系统:FTP服务的安装与启动.pptx

    FTP服务器的安装与启动 01 测试ftp服务 02 准备工作 03 查询系统是否安装vsftpd 04 安装vsftpd 目录: Contents 05 编辑主配置文件 06 启动服务器 准备工作 配置ip地址 配置selinux 将enforcing 改为 disabled 关闭...

    Linux-FTP配置说明及安装源文件

    #如果把上面的sense=deny改为allow后,也就是说只有/etc/vsftpd/ftpusers中的用户才能够访问ftp服务器了。这里提供了一个配置思路, 以供在实际环境中使用。 20.3.12 特定用户不能登录方法二 #编辑下列文件 vi /etc...

    LINUX FTP设置方法

    #如果把上面的sense=deny改为allow后,也就是说只有/etc/vsftpd/ftpusers中的用户才能够访问ftp服务器了。这里提供了一个配置思路, 以供在实际环境中使用。 20.3.12 特定用户不能登录方法二 #编辑下列文件 vi /...

    Linux FTP服务配置

    VSFTP主配置文件路径:/etc/vsftpd/vsftpd.conf,重要参数: anonymous_enable=yes/no 是否允许匿名用户访问 anon_upload_enable=yes/no 是否允许匿名用户上传文件 anon_mkdir_write_enable=yes/no 是否允许匿名用户...

    CentOS7服务器环境下vsftpd安装及配置方法

    本文实例讲述了CentOS7服务器环境下vsftpd安装及配置.../etc/vsftpd/vsftpd.conf.bak [root@localhost ~]# rm -fr /etc/vsftpd/ 1x:重新安装 [root@localhost home]#yum -y install vsftpd [root@localhost home]

Global site tag (gtag.js) - Google Analytics