Pages

Wednesday, June 16, 2010

Simplest and Easiest Web Server

There are a lot of different ways to share data between Linux and Windows. We can use NFS, Samba, Ftp, Secureftp, http and so on. However, sometimes all of those methods are not suitable for some particular conditions. For example, I have a Fax Server running on Debian Linux. The server is not powerful enough to deploy a separate server role to handle file sharing. Its main purpose is to receive and send the fax message through modem. It even does not have firewall.
One day, a user need to get some data from the server. For me, as long as server is running ssh service, I can get what I want by using sftp or scp. For user, it may be totally different universe. If I try to teach my user how to use sftp and scp at that time, he will complain,"Please,Mr.IT, don't make my life difficult.......".
Here is how I slipped out of difficulty by using a module of Python programming language.I ssh to server and on console I type:
ip add | grep inet ; python -m SimpleHTTPServer
This command will show ip addresses of server. All I need to do is asking my user to open up the browser and type myserver's ipaddress:8000. Now he can download the data on server to his computer easily. I included the screenshot to show you how it looks like in browser.
From

No comments:

Post a Comment