How do you upload/edit files on your web development server? - linux

For a long time now I have been using a local XAMPP installation on my OS X machine for all my web development. Because updating/maintaing XAMPP is such a pain, I set up an Ubuntu server for my web development.
I would like to know what you think is the best/easiest way to connect to your main development server to edit the files. What protocol do you use (smb, webdav, fdp, ldap, etc.)? Also, do you leave the files on your machine and let the server read the files form your hard drive (e.g. smb via a smb) or do you leave the files on the server?

I would go with SMB as your means of file transfer. How you do this is up to you. It depends on how often your files are accessed, how often they are updated, etc. If you plan on updating the files often (i.e. if you are in a rapid dev phase) then you can link them like you talked about. If the updating is infrequent and the amount of requests are high, upload them to the server. This will decrease the amount of stress on your LAN as the files are requested; in the other method the route would have been modem -- SMB server -- SMB share -- SMB server -- modem, wheras this way it is modem -- SMB server -- modem.

I use an Ubuntu Virtual Machine running the web server, git and vim. So I backup everything my Vim configuration and server config. For me is the fastest way to recover from a crash in example.
Also, you can use vim through ssh by
vim scp://myuser#server.com//home/myuser/file
A simpler example is to view source with an editor syntax, indent
vim http://domain.com
You can save ssh credentials too

I normally use Aptana (an Eclipse derivative) over ssh/sftp to edit the files directly on my server.
If you need to transfer files I suggest using something like FileZilla which will let you connect over ftp or ssh/sftp.

I used to map a SMB share of my LAMP server and edit the PHP files directly with Dreamweaver. Worked really well.
Lol, i'm the first one in the testimonial here. Oh memories.

Related

To transfer files to device using FTP, is it necessary to have a server running on it?

For some time now I've been trying to send files to a Embedded Linux device via FTP without success. I even previously put a question in SO talking about my problem, and I still haven't got any further in solving it.
One thing I noticed, though, is that most FTP examples in the web includes a server-client relationship; the client connects itself to the server that is constantly listening in some IP-Port and the file transfer begins. Now when studying the examples using QNetworkAcessManager to send a file (generally to HTTP), they never mentioned the "other side requirements", what is leading me to believe I'm missing the necessary FTP server running in my Embedded Linux device.
So my question is more like a confirmation of my suspicions: if I want to transfer a file from my Desktop to my device using FTP, do I need to have a FTP server constantly running on that device? If yes, how that should change my code? For instance, should I abandon QNetworkAcessManager in favour of a QTcpClient usage? IOW what else should I know to make the file transfer system work using Qt? (In fact should I even bother myself with FTP at all instead of just using a normal QTcpServer?)
FTP is a protocol with 2 parties, the client and the server. Both must comply to the specification of FTP before file transfer can take place.
So yes there has to be a FTP deamon (the server) running the on the other device.
It doesn't have to run constantly just whenever you want to transfer files.

How to copy files on remote Windows to local Linux on a Linux machine?

Currently, I'm working on a local Linux machine. I'm trying to use scp or similar Linux command-line tools to copy files from a remote Windows machine to my local Linux. I did some searching and found that most of the solutions are for local Windows cases (like putty and winscp), which don't really help.
Please advise.Thank you.
[UPDATE] Solved by installing cygwin's sshd service on Windows.
If you really want to use SCP, you will need an SCP server (actually an SSH server) on the Windows machine.
For example freeSSHd.
You will need to choose one of the options based on your own needs, there are a number of similar tools and freeSSHd was the first in the list on Google. I've used the Bitvise SSH Server in the past but it is only free for non-commercial use.
They are usually very easy to set up. You install them the usual way and run them for the first time. Depending on the tool, they may pick up your existing Windows users or you may need to manually create some users with passwords within the tool. Then, armed with your PC's IP address, you should be able to connect to the PC using SSH from the Linux command line.
If the windows system has a shared folder you should be able access that with smbclient which is part of the terrific samba project.
Usually somthing like:
smbclient //winmachine/share
Possibly using the -U username options to specifiy the username on the windows box.
Once connected, you can use cd to change folders, and get to retrieve files.
If there is no file share.... I dunno. Create one?
Syntax for copying from remote Windows 10 machine with built-in SSH server. Note forward slashes and drive style. Domain is not necessary.
scp user#domain#example.com:c:/path/to/file.txt .

Is there a Configuration Software for Linux Servers on the market?

I'm currently working on a Linux (Web-) Server configuration tool, which will allow you to easily manage all Your server-configurations in an graphical intuitive solution.
My tool is written in c# and is designed for windows.
The system will connect to a remote Linux-based Server over SSH and will then be able to configure the Domains/Subdomains, email accounts, ftp accounts, php/ settings, nginx/apache settings ... (all remote per ssh)
no aditional software/configuration needed
the system will be able to read the current config and will allow you to easily manage the configuration
I've made an short video of the product: http://www.youtube.com/watch?v=E8buUyOvZrQ
I came from froxlor(php server configuration), which I don't like at all. Because I'm using the server for myself and don't the master/client concept.
So my Question is:
Is there an equivalent Product already on the market?
Because if so, I can stop working on my own product.
Edit
Is there a tool wich works without client Installation? (not php or in any way web-based)
Webmin is a web-based interface for system administration for Unix:
http://www.webmin.com/
I built something similar awhile ago and it was a basic WinForms dashboard that managed Linux boxes by interfacing with them via SharpSSH. This was awhile ago, but judging by their soure forge page it is still maintained.

Syncing files (code) on a local machine with a remote server

Almost all the code I write is usually run on a high-performance server. Lately I've been just remotely coding via NoMachine NX (similar to VNC) remote desktop and the latency in scrolling through code and typing has become unbearable.
Is there any suggestions on how I can setup a folder locally which syncs with the high-performance server every time I save a file? Something similar to Dropbox but I can apply to any folder.
Needs to work with Mac OS X and Linux Ubuntu.
syncs with the high-performance server every time I save a file
You don't want this. What you should do instead is use a DVCS on both sides, and then push the changes to the server once they've been tested. A makefile can help with the actual push action (among others).
Mount the remote drive on your local machine.
If your working machine is osx and you don't feel confident with the terminal then http://panic.com/transmit/ might be a good solution.

Is it safe to use a virtual server as dev environment, symlinking to files on the host?

I used to use MAMP (or just a local Apache/PHP/MySQL stack) to work on web projects. I've since graduated to a live Ubuntu server which is much closer to the production environments for the sites I work on.
Now I'm trying to take this a step further to optimize my workflow. My goal is to have a Linux server running in VirtualBox that automounts a local folder share (from the host) and uses a symlink to gain access to the files (i.e. client:/var/www/dev is a symlink to host:/Users/charlie/dev/).
I don't want to keep my files stored on the virtual server if it can be avoided. I prefer having direct local access to the files and not having to wait for buffering issues between the host and the client. i.e., if I have several files that are located on the client open in my IDE and I close my laptop, as soon as I open it there's a bit of a buffer issue. My IDE has open project(s) that reference folders and files located on a network share that isn't yet available. In the few seconds it takes for the virtual machine to wake up, OSX is already reporting that the share can't be found and was disconnected, the IDE chokes up, etc.
So what am I asking? Well, is this safe / are there obvious pitfalls I'm not seeing / better ways to do this?
Edit: For anyone that stumbles upon this post, the final setup is a Linux virtual machine running in VirtualBox on a Mac with NFS and a symlink from my Apache web root to my mount.
I used NFS Manager (http://www.bresink.com/osx/NFSManager.html) to setup the NFS Server on my host computer with user mapping to my primary account. This ensures that when my VM mounts the NFS share it can do whatever it needs (reading, writing, modifying). Then I added this line to /etc/fstab on my VM to automount the share on boot: "123.456.89.1:/Users/charlie/nfs_share /mnt/nfs_share nfs" (where 123 is my host IP on the virtual NAT).
The result is a killer development environment where I can use Finder, Aptana (or whatever your editor of choice is) Photoshop, etc to work on files locally and simultaneously test them out in my "real" Apache/Lighttpd/MySQL/PHP environment!
I am using the exact same setup for accessing my documents folder between my Ubuntu host and the windows guest. Idem on my iMac. The only issues are when editing on the 2 platforms are the CR/LS, but that will be no issue on your setup.

Resources