As a javaer, if you encounter any problems, check out the solution in Java. There are many things on earth that can find the perfect solution in Java. Before the FTP server was built using the VSFTPD, it can now be unloaded, it runs in the form of a service, And it contains a lot of things that I don't know.
WGET+TAR-ZXVF download unzip ftpserver, go to bin directory, change ftpd.sh, add Java_home variable.
Input instructions:./ftpd.sh res/conf/ftpd-typical.xml & background run.
Note here that there is a CD $FTPD _home in Ftpd.sh, which makes the current directory of the program $ftpd_home. If the ftpd-typical.xml path is not correct, the "File not found" exception is always reported.
Ftpd.sh needs to provide the configuration file name as a parameter, its behavior depends on the configuration of Ftpd.xml, in general, the use of ftpd-typical is sufficient. If you do not know how to configure Ftpd.xml, you can refer to Ftpd-full.xml, This file lists all the parameters.
By default, the user name and password are admin, the port number is 2121.ftp the default port number is 21.http the default port number is 80.tomcat the default port number is 8080, because the port number within 1024 is not allowed to occupy, and 1024 later can be. So, To occupy a port number of 1024 or less, pass the sudo command.
By default, the user password in user.properties is MD5 encrypted, and you need to change the ftpd-typical.xml if you want to not encrypt it. The anonymous user is read-only to the files on the server, which can set permissions in User.properties.
The problem is not over here, and when you exit the shell, ftpd then stops running. The question is: How can the program continue to run after the Linux shell is closed?
(1) Programme I
CTRL + Z pause the program, BG [job number] runs the program in the background. This step is equivalent to running the program using the [command name]&.
For a program running in the background, it just does not occupy the shell, but it is still a shell subroutine, the shell dies, it still has to kneel. So you need to use the command
Disown-h%1
To put this program "out of the box".
BG is to put the program in the background, FG is to transfer the program to the foreground.
Use the Jobs command to view the current job. Jobs-l View the job list.
When the program is removed using disown, it can be PS-E | grep Bash command to view this program, you can kill it.
(2) Programme II
Sighup is a type of signal in Linux that represents the hang-up signal. When the shell receives the sighup signal, the Shell's sons also receive this signal.
Nohup./haha.sh arg1 arg2 Arg3 &
By default, all output from the haha.sh run is written to the ~/nohup.out file, so be careful to let Nohup run in the background, so add "&".
Then Ps-ex | grep haha, you can see this program.
Close the current shell, reopen one, and still Ps-ex | grep haha, and the discovery is still running.
(3) Programme III
Using Screen/tmux
(4) Programme IV
./haha.sh&!
Using Apache Ftpserver to build an FTP server