How to turn Puppy on a thumb drive into a web server

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
NerdWithNoLife
Posts: 8
Joined: Wed 10 Nov 2010, 18:35

How to turn Puppy on a thumb drive into a web server

#1 Post by NerdWithNoLife »

Here is a simple way to turn any machine with a thumb drive into a remotely configurable (by ssh) web server. I’m sure issues immediately come into your mind upon reading that.

So let me start by saying no, this isn’t the most secure/efficient thing to do on a large scale. But a web developer testing out a new site on the fly, someone wishing to send non-mission critical files to a friend, or wishing to share on a nonpublic intranet may find a use here. Also I mention a thumb drive as they are cheap, but any attached writable media would work. (An old laptop with an unusable hard drive could be instantly useful.)

I recommend lucid puppy 5.2.8. If you are planning on using usb, you may wish to remaster the disk with pmedia=usbflash in isolinux.cfg, or update menu.lst in the same way to minimize writes to the drive. Also I’d recommend having your save file on a separate partition from the web directory to keep it from filling up. Now simply install mini-httpd from the debian package at this link and sshd from this post. Then you’ll need to edit the following:

Code: Select all

geany /etc/mini-httpd.conf
Change line 8 to host=192.168.1.x (the ip address of this server), and line 25 to the path on the folder you’re sharing. Next,

Code: Select all

geany /etc/default/mini-httpd
Change line 7 to START=1

Now you’ll want a script in /usr/sbin to simply contain:

Code: Select all

#!/bin/sh
/etc/init.d/sshd start & /etc/init.d/mini-httpd start
Now just execute that script and you should be up and running! Simply ssh in with gFTP to upload files.

Some additional notes on security: the default root password is woofwoof, (it asks for ssh access), and you may want to change that. If you were using this to share large files publicly, map from some other high numbered port (49152–65535 are reserved for private/dynamic use) back to the staticly configured ip on the server’s port 80 (web traffic) and 22 (ssh). Non default is a good thing. To access from the public internet you’d then type:

your.public.ip.address:[remapped_port_number]/

from a browser to see the files. If you’re running dd-wrt in your router, you could also use a dns updating service like freedns.afraid.org to account for a changing dynamic ip from your ISP.

User avatar
Amgine
Posts: 231
Joined: Thu 22 Sep 2011, 01:27
Location: Washington State

#2 Post by Amgine »

Cool! Thanks for the info..

Another cool one..

For a tempory file server use python

cd into the directory you wish to share If you do not know what directory your in use

Code: Select all

pwd
example

Code: Select all

cd /root/my-documents

Code: Select all

python -m SimpleHTTPServer


Do not share your root folder "Home"!!!

to access your now shared files type your ip-address and include :8000 at the end. http://192.168.0.2:8000
You can also access it via: http://127.0.0.1:8000

If you wish to change the port that's used start the program via:

Code: Select all

python -m SimpleHTTPServer 8080

Post Reply