Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 29 Aug 2014, 18:19
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
How to turn Puppy on a thumb drive into a web server
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [2 Posts]  
Author Message
NerdWithNoLife

Joined: 10 Nov 2010
Posts: 8

PostPosted: 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
View user's profile Send private message 
Amgine


Joined: 21 Sep 2011
Posts: 233
Location: Washington State

PostPosted: 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
Code:
pwd


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
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [2 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

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.0479s ][ Queries: 11 (0.0036s) ][ GZIP on ]