0

I'm now teaching data bases and all my students get access to a virtual machine running ubuntu. They use FTP as the main way of connecting to the server and uploading their PHP files. Last time I was told that FTP was slow as every change you made you had to open filezilla, send the file and then test if it works. So, now I'm looking for something more automatic, something like GIT where you just push to the server using git push. Any ideas what can be used?

2 Answers2

2

It's likely the most simple solution would be for you to use rsync over ssh.

This requires that each user have an account on the server. For this example, assume that they're wanting to copy files from their local machine, /home/user1/folder to /home/user1/foo on the server. To do this, they'd run the following from their workstation:

$ rsync -avz --progress --delete /home/user1/folder/ user1@server.example.com:/home/user1/foo/"

This will synchronize the workstation directory to the server directory.

There are many, many other options. Git is not a bad one. Using it will require a bit more training, though, as well as setup on the server.

EEAA
  • 109,363
  • 18
  • 175
  • 245
  • The "a bit more training" is likely to be well worth it, too, as you're teaching about version control as a bonus. I'm amazed how many software dev grads I see getting out of colleges w/o having experienced a VCS. – ceejayoz Mar 18 '14 at 02:03
  • @ceejayoz Great point. – EEAA Mar 18 '14 at 02:04
2

A simple alternative, still using FTP, might be to use an FTP client which manifests as a filesystem - for example I use curlftpfs under Linux. Never looked at them, but Webdrive and FTPDrive apparently do something similar under Windows.

A couple of alternative solutions which might do something similar - Setting up the server with SAMBA (if the clients are Windows) or NFS (if the clients run Linux or similar). There is also sshfs clients.

The limitation of the above range of solutions is it is very easy to do work on the live server - which might not be ideal in a production environment.

davidgo
  • 6,222
  • 3
  • 23
  • 41
  • 1
    Not sure it's a great idea to recommend continuing to use FTP when 1) OP is asking for an alternative and 2) FTP is a horrible, insecure file transfer protocol that has no business existing in today's computing environment. :) – EEAA Mar 18 '14 at 02:16
  • Except that the problem he purported to be trying to solve is one of speed of making changes, no changes need to be made to the server to support it, most web providers still allow only FTP access. I also provided 3 alternatives which perform the same goal - SAMBA, NFS and SSHFS - and pointed out the downside. I agree that FTP sucks as a protocol through. – davidgo Mar 18 '14 at 03:22