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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- CSS 例項之翻轉圖片CSS
- 網路拓撲例項之VRRP負載分擔(四)VR負載
- UML類圖繪製例項
- JFreeChart圖表製作例項
- 如何將獨立例項轉換成叢集例項EU
- canvas繪製扇形程式碼例項Canvas
- E-R圖繪製例項
- 資料流圖繪製例項
- 製作PHP的RPM包例項PHP
- canvas 例項之鬧鐘Canvas
- JVM指令分析例項四(陣列、switch)JVM陣列
- JS 建立例項物件的四種模式JS物件模式
- 基本的 HTML 標籤 - 四個例項HTML
- DL4J實戰之四:經典卷積例項(GPU版本)卷積GPU
- canvas繪製網格程式碼例項Canvas
- css繪製圓形程式碼例項CSS
- Python例項:僅繪製圖例而不繪製實際的圖形Python
- Web安全之CSRF例項解析Web
- canvas繪製機器貓程式碼例項Canvas
- canvas繪製拋物線程式碼例項Canvas線程
- SVG拖動繪製矩形程式碼例項SVG
- canvas繪製箭頭效果程式碼例項Canvas
- CSS 例項之開啟大門CSS
- Spring MVC之例項初體驗SpringMVC
- Vue原始碼探祕(四)(例項掛載$mount)Vue原始碼
- keras轉tensorflow lite【方法二】直接轉:簡單模型例項Keras模型
- div前後翻轉效果程式碼例項
- CSS3旋轉效果程式碼例項CSSS3
- canvas繪製圓形鐘錶程式碼例項Canvas
- Dreamweaver網頁製作教程:表格設計例項網頁
- Excel vba 例項(1) - 批量製作工資表頭Excel
- 例項QT程式 —— Qt自繪製小時鐘QT
- guava之ImmutableMap使用例項及好處Guava
- CSS 例項之文字的凸起與凹陷CSS
- Docker Compose例項之nginx反向代理GitLabDockerNginxGitlab
- oracle之 單例項監聽修改埠Oracle單例
- 初探富文字之CRDT協同例項
- 初探富文字之OT協同例項
- jquery經典例項之回到頂部jQuery