欢迎光临
我们一直在努力

Webmin使用教程:图形配置Linux服务器

建站超值云服务器,限时71元/月

  烈火网(LieHuo.Net)教程 对于很多习惯使用windows的用户,在刚接触Linux的时候,要使用命令行配置Linux服务器可能会感觉难以适应。今天我们来讲解一下,Linux下的图形配置工具—Webmin,通过这款工具,用户可以很方便的使用web界面对Linux服务器进行配置。

  一、配置bind dns服务器

  1、 系统—〉“软件包”—〉搜索并安装相应的“软件包”(upload file &install package)

  2、 在webmin的“硬件”—〉“网络配置”—〉选择“dns客户”—〉将“解析顺序”改为–“dns、hosts”—〉按“保存”后返回

  选择“服务”—〉“bind 8 dns服务器”—〉可以看到由“全局服务器选项”、“现有dns区域”和其他部分组成

  bind在默认安装的情况下可作为高速缓存服务器(有root zone、127.0.0的反向、localhost的正向)–〉其安装顺序为bind-9.1.3-4—〉bindconf-1.6.1—〉caching-nameserver7.2-1

  3、 创建主服务器

  在webmin的server中选择“bind dns server”—〉在“现有区域”中选择“新建主区域”—〉“区域类型”选择“正向”,在“域名/网络”域名输入“test.com”,主服务器输入“master.test.com”,email地址输入“root@localhost”—〉按“新建”完成

  在“现有区域”中选择“新建主区域”—〉“区域类型”选择“反向”,在“域名/网络”输入“192.168.0”,主服务器输入“master.test.com”,email地址输入“root@localhost”—〉按“新建”完成

  在主服务器中添加正向地址记录—〉选择“test.com”—〉选择“a记录”—〉在“名称”处输入“www”,在地址处输入“192.168.0.100”—〉按“新增”完成

  也可以添加“名称别称cname记录”、“邮件服务器mx记录”和“辅域名服务器ns记录”

  完成所有的记录添加后返回“bind dns服务器”中按“应用更改”即完成配置的更改

  4、 创建从服务器

  在“现有区域中”选择—〉“新建次区域”—〉选择“正向解析”(forward),输入域名“abc.com”,输入“主服务器”的地址“192.168.0.101”—〉按“新建”后完成—〉按“保存”后返回“bind dns服务器”—〉按“应用更改”使配置生效

  用相同步骤实现“从服务器的反向记录”的设置

  二、postfix邮件服务器的配置

  1、 postfix的安装

  在“webmin”的界面中选择“system”—〉选择“software package”—〉选择“install a new package”—〉“from upload file”—〉“install”安装 postfix-1.1.7-2.i386.rpm、imap-2001a-10.i386.rpm

  2、配置postfix服务器的启动

  在“system”中选择“bootup and shutdown”—〉选择“postfix”—〉将“start at boot time” 改为“yes”—〉按“save”返回

  在“server”中选择“extended internet services”—〉分别选择 “imap”和“pop3”,将“service enable”改为“yes”—〉保存后返回—〉按“applay changes”使设置生效(相当于service xinetd restart)

  3、在dns上注册邮件服务器

  (注意两点:1、在完成添加后需要按“apply changes”使配置生效2、服务器中如写完整的主机名要以“.”结尾)

  4、配置postfix

  在“server”中选择“postfix configuration”—〉选择“general options”—〉设定“what domain to use in outbound”为“use domainname”表示使用当前邮件服务器的域名作为邮件发送者的域名;设定“what domains to receive mail for”为“whole domain”,表示当前邮件服务器接收整个域的所有邮件;设置“network interfaces for receiving mail”为“all”,表示通过所有的网卡来接收邮件;设置“hostname of this mail system”为当前邮件服务器的主机名输入“mail.test.com”;在“local internet domain name”中输入当前主机所在的域名“test.com”;其他项保持默认值—〉按“save and apply”后完成

  5、为邮件服务器添加用户帐号

  在“webmin”的“system”中的“users and groups”—〉选择“local groups”按“create a new group”—〉在“group name”中输入“mailuser”—〉在“local user”中选择“create a new user”—〉在“username”中输入“mailuser1”,在“home directory”中输入“/home/mailuser1”,在“password”中输入“normal password”,在“group membership”中“primary group”的“existing group”选择“mailuser”—〉按“create”按钮完成用户创建

  5、 邮件别名和虚拟域

  邮件别名:

  在“webmin”的“server”中选择“postfix configuration”—〉选择“mail aliases”—〉选择“create a new alias”—〉在“alias options”中设置“alias databases used by the local delivery agent”和“alias databases built by newaliases command”为“hash:/etc/postfix/aliases”—〉选择“create a new alias”—〉在“alias properties edition”页中“name”输入“mailuser3”在“alias to…”中输入“mailuser2”(mailuser3为不存在的账号alias to mailuser2为已存在的账号,所以发给mailuser3的邮件会自动转到mailuser2)

  邮件的虚拟域:

  在“webmin”的“server”的“postfix configuration”中—〉选择“virtual domain”—〉设置“domain mapping lookup tables”为“hash:/etc/postfix/virtual”—〉选择“save and apply”—〉在次进入“virtual domains”选择“new mapping”新建一个映射—〉在“edit a map”中设置“name”为“@newtest.com”,“maps to…”为“@test.com”(表示把所有发往@newtest.com的信映射到@test.com)–〉按“save mapping”保存

#p#副标题#e#  三、wu-ftpd服务器

  1、 ftp服务器的安装

  “webmin”—〉“system”—〉“software package”—〉“from uploaded file”—〉安装“wu-ftpd-2.6.2-5.i386.rpm”和“anonftp-4.0-9.i386.rpm”

  2、 wu-ftpd服务器的启动设置

  “webmin”—〉“server”—〉“extended internet services”—〉选择“ftp”—〉修改“service enabled?”为“yes”—〉选择“save”保存当前设置—〉在“extended internet services”页中按“apply changes”使设置生效

  3、 设置anonymous账号规则

  “webmin”—〉“server”—〉“wu-ftp server”—〉选择“anonymous ftp”—〉设置“anonymous ftp root directories”为“/var/ftp”(如空缺表示当前ftp用户的主目录,见/etc/passwd)–〉按“save”保存设置,用客户端测试成功

  4、 设置guest账号

  添加账号ftpuser1:

  “webmin”—〉“system”—〉“users and groups”—〉选择“create a new user”—〉设置“username”为“ftpuser1”,“shell”为“/sbin/nologin”,“home directory”为“/home/ftpuser/user1”,“password”为“normail password”,“copy files to home directory”设置为“no”(表示不将/etc/skel目录下的文件复制到用户主目录)—〉选择“create”创建用户完成

  设置guest账号:

  “webmin”—〉“server”—〉“wu-ftp server”—〉选择“users and classes”—〉“unix users and uids to treat as guests”默认设置为“*”(表示所有用户帐号都默认为guest类型)—〉按“保存”返回—〉用客户端测试成功

  5、 设置real账号

  添加账号ftpuser2:

  “webmin”—〉“system”—〉“users and groups”—〉选择“create a new user”—〉设置“username”为“ftpuser2”,“shell”为“/sbin/nologin”,“home directory”为“/home/ftpuser/user2”,“password”为“normal password”,并输入口令—〉按“create”创建用户完成

  设置real账号:

  “webmin”—〉“server”—〉“wu-ftp server”—〉选择“users and classes”—〉在“unix groups and uids not to treat as guest”输入账号“ftpuser2”—〉按“save”保存后返回—〉用客户端测试成功

  6、设置wu-ftpd服务器的访问控制(很可能考)

  (1) 用ip地址进行访问控制

  在可能登录的目录中编辑一个文件如:/var/ftp/ipdeny,内容为“sorry, your ip address is blocked”

  在“webmin”—〉“servers”—〉“wu-ftp server”—〉选择“limits and access control”—〉在“deny access from”添加“deny from address”为“192.168.0.2”,“error message file”为“/var/ftp/ipdeny”—〉按“save”后保存—〉在客户端测试完成

  (2) 使用class进行访问控制

  在可能登录的目录中编辑一个文件如:/var/ftp/toomany,内容为“sorry,too many users now.please try again later.”

  “webmin”—〉“servers”—〉“wu-ftp server”—〉“users and classes”定义类名“unknownuser”,“user types”为“anonymous”,“matching address”为“!192.168.0.0/24”—〉按“save”后保存—〉在“limits and access control”中设置并发用户连接数限制“concurrent user limits”中“apply to class”选择“unknownuser”,“maximum users”为“15”,“at times”为“any time”,“error message file”为“/var/ftp/toomany”—〉按“save”后保存返回—〉在客户端测试通过

  还可以设置“file and data transfer limits”中“limit type”为“files per session”,“maximum”为“5”,“apply to class”为“unknownuser”

  四、apache服务器的配置

  1、 apache的安装与启动

  “webmin”—〉“system”—〉“software package”—〉“from uploaded file”—〉选择“install”安装“apache-1.3.20-16.i386.rpm”

  启动:选择“system”—〉“bootup and shutdown”—〉选择“httpd”—〉将“start at boot time?”改为“yes”—〉按“save”保存(选择“start selected”来启动服务)

  2、 apache的配置界面

  “webmin”—〉“servers”—〉“apache webserver”可以看到有三部分组成“global configuration”、“virtual servers”、“create a new virtual server”

  3、在apache中创建基于域名的虚拟主机

  “webmin”—〉“servers”—〉“apache webserver”—〉“create a new virtual server”—〉设置ip“address”为“192.168.0.100”,“document root”为“/home/ftpuser/user1”,“server name”为“ftpuser1.test.com”—〉选择“create”完成创建—〉在“apache webserver”页按“apply changes”使修改的配置生效—〉在客户端访问测试通过(事先要做好域名)

  4、在apache中创建基于ip地址的虚拟主机

  绑定多个ip地址:

  “webmin”—〉“hardware”—〉“network configuration”—〉“network interfaces”—〉选择“interfaces active now”的“add a new interfaces”—〉输入“name”为“eth0:0”,“ip address”为“192.168.0.101”—〉按“create”完成创建

  “webmin”—〉“servers”—〉“apache webserver”—〉“create a new virtual server”—〉设置ip“address”为“192.168.0.101”,“document root”为“/home/ftpuser/user2”,“server name”为“ftpuser2.test.com”—〉选择“create”完成创建—〉在“apache webserver”页按“apply changes”使修改的配置生效—〉在客户端访问测试通过(事先做好域名)

  5、apache中的访问限制

  基于用户名/密码的访问控制:

  选择“virtual server”的“ftpuser1.test.com”—〉在“create per-directory, files or location options”设置“type”为“directory”,“path”为“/home/ftpuser/user1”,按“create”完成创建—〉选择已创建的“directory /home/ftpuser/user1”—〉选择“access control”—〉设置“authentication realm name”为“ftpuser1.test.com”,“authentication type”为“basic”,“restrict access by login”为“all valid users”,“text file authentication”中的“user text file”为“/etc/httpd/conf/accesscontrolfile”—〉按“save”完成—〉再次进入“access control”页设置“edit users”添加用户“httpuser1”—〉按“apply changes”使设置生效—〉在客户端访问测试通过

  基于客户端主机ip地址的访问控制

  同上选择“ftpuser2.test.com”—〉设置directory“/home/ftpuser/user2”—〉选择创建的“directory /home/ftpuser/user2”的“access control”—〉选择“resist access”的“access checking order”为“allow then deny”—〉添加“action”“allow”“all requests”和“deny”“request from ip”“192.168.0.2”—〉通过客户端访问验证通过

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » Webmin使用教程:图形配置Linux服务器
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址