Tiny Core Base > CorePlus

autostart SimpleHTTPServer

(1/2) > >>

okanagansage:
Hello, I'm trying to set-up a wyse V10L as a headless machine with python's SimpleHTTPServer running automatically at boot. I'm trying to set this up for a local electronics recycling depot. I'm going to attach a dedicated wireless router to the side of it so they can easily just plug it in (and the router) to share files with customers who're on site (tutorials and documents on repurposing pc's, etc). I have no experience with web servers. 

The wyse is running tinycore off of a live-usb that I made using a coreplus cd on a laptop. The live-usb is sdb since the internal drive has not been touched. I've installed openssh and configured it to autostart for administration purposes. That involved editing /opt/bootlocal.sh and /opt/.filetool.lst . After reboot, openssh autostarts fine.

I figure I could get the SimpleHTTPServer running the same way by adding 'cd /home/Documents && python -m SimpleHTTPServer' to /opt/bootlocal.sh and adding lines to /opt/.filetool.lst  ... but I don't know what lines to add to .filetool.lst.  I've got the 'locate' command by installing findutils but I get no results by searching for SimpleHTTPServer. On lubuntu I can use locate to find /usr/lib/python2.7/SimpleHTTPServer.py but on tinycore I get nothing. Even if I try to locate just python there is no output. I've manually gone through a bunch of directories to find SimpleHTTPServer.py but have had no luck.

If anyone could point me in the right direction it would be greatly appreciated.
Paul

Edit: It's midnight now so I'm gonna crash but I'll keep keep an eye out for replies.

Juanito:
to locate files created after you do something, load the findutils extension and:
--- Code: ---$ touch mymarker
$ do something
$ sudo find / -not -type 'd' -cnewer mymarker | grep -v "\/proc\/" | grep -v "^\/sys\/" | tee files
$ vi files
--- End code ---

curaga:
If you just need a web server, you'll save tens of megabytes by using busybox-httpd instead of python.

Rich:
Hi okanagansage
Are you sure you installed  python.tcz?

--- Quote ---On lubuntu I can use locate to find /usr/lib/python2.7/SimpleHTTPServer.py but on tinycore I get nothing.
--- End quote ---
On Tinycore it would be under:

--- Code: ---usr/local/lib/python2.7/SimpleHTTPServer.py
--- End code ---

okanagansage:
@Rich:
When I look in:
apps (program) > apps (button) > maintenance > onboot maintenance 
python.tcz is in the list.

In /usr/local/lib there is no python files/folders, but in /usr/local/tce.installed there is a file called python with the contents:

--- Code: ---#!/bin/sh
tar xzf /usr/local/share/python/files/files.tar.gz -C /
ln -sf /usr/local/bin/python2.7 /usr/bin/python
--- End code ---

I'm just going to see if I understand this. Python is being extracted, then a link is being created between the files /usr/local/bin/python2.7 and /usr/bin/python .
If I look in /usr/local/bin I can see python2.7 and it's text is in green where the vast majority of other files in there have blue-ish green text. I'm guessing the green text indicates that the file itself is linked to a file elsewhere.

So at this point python is only running when I run the command in the terminal, right? My question is how do I get SimpleHTTPServer to start on boot and serve whatever I have in ~/Documents ?
.........................................................
In /opt/bootlocal.sh I have just the line for openssh:
/usr/local/etc/init.d/openssh start

In /opt/.filetool.lst I have:
opt
home
etc/shadow
usr/local/etc/ssh/ssh_config
usr/local/etc/ssh/sshd_config
...........................................................
@curaga
I was trying to use SimpleHTTPServer because it is the only 'server' I've ever used. It serves access to the folder of my choosing without me having to know any html or whatever. Like I said in my original post, I have practically no experience with servers. I have a little experience with linux but very little experience with tinycore.
...................................................
@juanito
I tried your find command with SimpleHTTPServer instead of mymarker and I get 'no such file or directory'.

Navigation

[0] Message Index

[#] Next page

Go to full version