Apache has a virtual host that allows users to enter different URLs to access different pages,
In fact, ftp can achieve the same effect, but in the implementation process, the methods used are different;
The topology is as follows:
C (192.168.1.0/24) ------- FTP --------- c (192.168.0.0/24)
To make the access results of users in two CIDR blocks different, perform the following operations:
# Useradd-d/var/ftp2-s/sbin/nologin ftp2
# Chmod-R 755/var/ftp2
# Chown-R root: root/var/ftp2
# Mkdir-m 755/var/ftp2/pub
# Chown ftp2.root/var/ftp2/pub
# Cp/etc/vsftpd. cof/etc/vsftpd. vsftpd1.conf
# Vim/etc/vsftpd. conf
Listen_address = 192.168.1.103
# Vim/etc/vsftpd/vsftpd1.conf
Listen_address = 192.168.0.103
Ftp_username = ftp2
Local_root =/var/ftp2
# Service vsftpd restart
Verification:
# Setenforce 0 // disable selinux
# Lftp-u ftp 192.168.1.103
# Lftp-u ftp2 192.168.0.103
If you do not disable selinux
You can use the following method to set the settings to achieve the same effect.
# Chcon -- reference =/var/ftp/var/ftp2
You can use the following command to set it.
# Setsepool ftp_home_dir = on
In this way, you can add multiple ftp sites as needed based on your network deployment.
Author: "IT dream-qi-sharing"