Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm in the process of setting up 2 Debian servers that are linked on a LAN and both have public and private IPs. Both servers will need to share some files for use within their web applications that they serve. They may need to write as well as read files.
I am using PHP as the scripting, and I see 2 possible solutions for accessing files on one server from another - NFS and FTP. Files will mainly be images of 0.5 - 1.5 Mb. I've done some research, and the advice out there is confusing. Some say NFS is faster, some say FTP. So I wonder if you can help with my quandary? To mount an NFS drive on the other server, or to setup FTP an call directly from within my PHP scripts?
From how you describe it NFS is definitely the way to go, but while there are alternatives I don't think FTP is an appropriate one. sshfs for example would be one way to go - but either way it's still a local mount of a share on a remote server; nfs is probably best if both servers have the same user database.
Thanks for your reply Zordrak. I was thinking NFS as well, but some sites are saying FTP is better. I can see FTP being better where the servers are accessed via the internet. I will take a look at sshfs as well.
FTP should only be used for traffic that will not exit your local network or VPN environment. IT is not suitable for general internet use, as it passes security information (logon and password) in the clear (unencrypted). If your traffic may hit the internet, try sftp or rsync over ssh: these encrypt ALL of the traffic.
NFS, while very useful, is an old insecure protocol that suffers several reliability problems. Again, that should not rule it out if all of the NFS traffic will be local or VPN secured. NFS over 1000BT dedicated links performs nicely.
The file transfer will be on a local network, and secure from the outside world. I guess there is no compelling argument to use one over the other? Unless anyone can think of any?
It depends upon HOW you want to use it.
sftp is easier to automate than ftp, but neither is rocket science.
I have had NFS (and some ftp transfers) kinda 'bork' on very large files.
There are performance issues, but on recent machines on a local LAN they are unimportant.
If the files are all under a gig, use what you find easiest.
If you decide to use an ftp server, check into lftp as the client. It has some powerful options for scripting and automation, and does more than the simple ftp protocol.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.