Accessing files through FTP using browser in linux

The following will work with Ubuntu Linux, use appropriate commands for other distros.

One way of accessing log files and other files from server, is to setup an FTP server so that it can serve log files and other files. The user should be able to access the server’s log files using a browser by accessing a url [eg: ftp://abcd.com]

NOTE: make sure the port 20 is opened or setup Apache to do appropriate proxying.

1. download and setup an ftp server, in this example we use vsftpd
2. after the setup is complete modify its configuration file in /etc/vsftpd.conf
1. Add the following config settings:
1. to give anonymous access:
1. anonymous_enable=YES
no_anon_password=YES
2. to enable browser to be used as an ftp client, the ftp should support passive mode
1. pasv_enable=YES
pasv_max_port=51000
pasv_min_port=50000
port_enable=YES
3. to change the default directory, and enable custom directory to be served by ftp server
1. local_root=/home/[user]/tools/tomcat7/logs
anon_root=/home/[user]/tools/tomcat7/logs

Restart the server to make the changes affected:
sudo service vsftpd restart

No comments: