• 软件测试技术
  • 软件测试博客
  • 软件测试视频
  • 开源软件测试技术
  • 软件测试论坛
  • 软件测试沙龙
  • 软件测试资料下载
  • 软件测试杂志
  • 软件测试人才招聘
    暂时没有公告

字号: | 推荐给好友 上一篇 | 下一篇

vsftpd-1.1.3配制实例之四:VIRTUAL_HOSTS

发布: 2007-7-04 12:06 | 作者: admin | 来源:  网友评论 | 查看: 18次 | 进入软件测试论坛讨论

领测软件测试网
  This example shows how you might set up virtual hosts. Virtual hosting is
  where different clients access your machine on different IP addresses (virtual
  IPs) and get redirected to different ftp sites.
  For example, if your machine responds to two IPs - 127.0.0.1 and 127.0.0.2,
  you could have the two different IPs represent two totally different FTP sites.
  For this example, we are going to build on the "INTERNET_SITE" example.
  Step 1) Set up a virtual IP address.
  ifconfig eth0:1 192.168.1.10 up
  (the standard IP address is 192.168.1.2)
  (note - this isn't quite complete, the route for local connects hasn't been
  added, but it will do for now)
  Step 2) Create a user / location for the new virtual site.
  useradd -d /var/ftp_site2 ftp_site2
  chown root.root /var/ftp_site2
  chmod a+rx /var/ftp_site2
  umask 022
  mkdir /var/ftp_site2/pub
  echo "test" > /var/ftp_site2/pub/content
  Step 3) Modify the existing site to respond to the primary IP.
  Edit /etc/x.netd.d/vsftpd, and add the config line:
  bind = 192.168.1.2
  Step 4) Create the new site, responding on the virtual IP.
  cp /etc/xinetd.d/vsftpd /etc/xinetd.d/vsftpd2
  Edit vsftpd2, and change
  - The bind line to refer to the IP address 192.168.1.10
  - Add the line
  server_args = /etc/vsftpd_site2.conf
  This launches this FTP site with a different vsftpd configuration file.
  cp /etc/vsftpd.conf /etc/vsftpd_site2.conf
  Add two lines:
  ftp_username=ftp_site2
  ftpd_banner=This is the alternative FTP site.
  Step 5) Restart xinetd and test!
  /etc/rc.d/init.d/xinetd restart
  [chris@localhost vsftpd]$ ftp 192.168.1.2
  Connected to 192.168.1.2 (192.168.1.2).
  220 ready, dude (vsFTPd 1.1.0: beat me, break me)
  Name (192.168.1.2:chris): [chris@localhost vsftpd]$
  [chris@localhost vsftpd]$ ftp 192.168.1.2
  Connected to 192.168.1.2 (192.168.1.2).
  220 ready, dude (vsFTPd 1.1.0: beat me, break me)
  Name (192.168.1.2:chris):
  530 This FTP server is anonymous only.
  Login failed.
  ftp> quit
  221 Goodbye.
  [chris@localhost vsftpd]$ ftp 192.168.1.10
  Connected to 192.168.1.10 (192.168.1.10).
  220 This is the alternative FTP site.
  Name (192.168.1.10:chris):
  530 This FTP server is anonymous only.
  Login failed.
  ftp>
  

文章来源于领测软件测试网 https://www.ltesting.net/


关于领测软件测试网 | 领测软件测试网合作伙伴 | 广告服务 | 投稿指南 | 联系我们 | 网站地图 | 友情链接
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备10010545号-5
技术支持和业务联系:info@testage.com.cn 电话:010-51297073

软件测试 | 领测国际ISTQBISTQB官网TMMiTMMi认证国际软件测试工程师认证领测软件测试网