The time now is Sat 25 May 2013, 08:28
All times are UTC - 4 |
| Author |
Message |
NerdWithNoLife
Joined: 10 Nov 2010 Posts: 8
|
Posted: Sat 12 Jan 2013, 20:50 Post subject:
How to turn Puppy on a thumb drive into a web server |
|
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: | | 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: | | geany /etc/default/mini-httpd |
Change line 7 to START=1
Now you’ll want a script in /usr/sbin to simply contain:
| Code: | #!/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.
|
|
Back to top
|
|
 |
Amgine

Joined: 21 Sep 2011 Posts: 212 Location: Washington State
|
Posted: Sat 12 Jan 2013, 21:00 Post subject:
|
|
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
example
| Code: | | cd /root/my-documents |
| Code: | | 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: | | python -m SimpleHTTPServer 8080 |
|
|
Back to top
|
|
 |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|
[ Time: 0.0476s ][ Queries: 12 (0.0109s) ][ GZIP on ] |