LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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



Reply
 
Search this Thread
Old 06-10-2011, 05:31 AM   #1
softstag
LQ Newbie
 
Registered: Jul 2009
Posts: 9

Rep: Reputation: 0
NFS or FTP for file transfer


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?

Thanks in advance
 
Old 06-10-2011, 06:30 AM   #2
zordrak
Member
 
Registered: Feb 2008
Distribution: Slackware
Posts: 595

Rep: Reputation: 115Reputation: 115
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.
 
Old 06-10-2011, 07:07 AM   #3
softstag
LQ Newbie
 
Registered: Jul 2009
Posts: 9

Original Poster
Rep: Reputation: 0
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.

Any other comments are most welcome!
 
Old 06-10-2011, 12:39 PM   #4
wpeckham
Member
 
Registered: Apr 2010
Location: USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix
Posts: 832

Rep: Reputation: 181Reputation: 181
NFS vs FTP

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.
 
Old 06-11-2011, 02:22 AM   #5
softstag
LQ Newbie
 
Registered: Jul 2009
Posts: 9

Original Poster
Rep: Reputation: 0
Thanks Wpeckham.

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?
 
Old 06-12-2011, 09:10 AM   #6
wpeckham
Member
 
Registered: Apr 2010
Location: USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix
Posts: 832

Rep: Reputation: 181Reputation: 181
FTP, SFTP, NFS, SSHFS, etc

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.
 
1 members found this post helpful.
Old 06-13-2011, 08:00 AM   #7
softstag
LQ Newbie
 
Registered: Jul 2009
Posts: 9

Original Poster
Rep: Reputation: 0
Thanks Wpeckham for the useful advice
 
  


Reply

Tags
ftp, nfs


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
file transfer program in c using FTP client and FTP server renuaseri Linux - Newbie 2 01-29-2011 06:49 AM
Speed of file transfer by NFS arubin Linux - Networking 4 06-22-2008 06:21 PM
Sloow ftp transfer to NFS mounted filesystem peternielsen5 Linux - Server 4 03-04-2008 04:44 AM
NFS Freezes on file transfer nomb Fedora 3 04-03-2007 12:14 AM
NFS file transfer problem via wireless akshunj Linux - Wireless Networking 15 12-19-2004 01:47 PM


All times are GMT -5. The time now is 11:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration