vsftpd-1.1.3配製例項之四:VIRTUAL_HOSTS(轉)
vsftpd-1.1.3配製例項之四:VIRTUAL_HOSTS(轉)[@more@] 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/xinetd.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>
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8225414/viewspace-957034/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- vsftpd-1.1.3配製例項之五:VIRTUAL_USERS(轉)FTP
- vsftpd-1.1.3配製例項之一:INTERNET_SITE(轉)FTP
- vsftpd-1.1.3配製例項之二:INTERNET_SITE_NOINETD(轉)FTP
- vsftpd-1.1.3配製例項之三:PER_IP_CONFIG(轉)FTP
- vsftpd-1.1.3配製檔案vsftpd.conf(轉)FTP
- 基本複製應用例項(轉)
- CSS 例項之翻轉圖片CSS
- CSS3繪製平行四邊形程式碼例項CSSS3
- unix freebsd 配製檔案(轉)
- 網路拓撲例項之VRRP負載分擔(四)VR負載
- APIHOOK例項剖析 (轉)APIHook
- 【SpringCloud】(四):建立Eureka Server例項SpringGCCloudServer
- 單例與單例項之爭單例
- 資料流圖繪製例項
- canvas繪製扇形程式碼例項Canvas
- canvas繪製星星程式碼例項Canvas
- canvas 繪製雞蛋程式碼例項Canvas
- ■ 例項學習 PHP 之表單處理篇 (轉)PHP
- 演示中斷處理的例項(例項六)(轉)
- canvas 例項之鬧鐘Canvas
- 【例項】之ckpt機制
- ASM之建立ASM例項ASM
- JS 建立例項物件的四種模式JS物件模式
- JVM指令分析例項四(陣列、switch)JVM陣列
- js四捨五入程式碼例項JS
- 基本的 HTML 標籤 - 四個例項HTML
- oracle單例項轉RACOracle單例
- (轉)MySQL優化例項MySql優化
- 網站綜合例項(轉)網站
- [轉]BDB例項程式碼
- 網站綜合例項 (轉)網站
- AsmL例項研究(二) (轉)ASM
- DL4J實戰之四:經典卷積例項(GPU版本)卷積GPU
- 製作PHP的RPM包例項PHP
- canvas繪製網格程式碼例項Canvas
- css繪製圓形程式碼例項CSS
- svg繪製半圓程式碼例項SVG
- canvas繪製笑臉程式碼例項Canvas