Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#16099 - 30/08/2000 10:57 Micro http server.
hamzy
journeyman

Registered: 11/08/2000
Posts: 51
Loc: TX, USA
I have compiled a really small web server from here,
and attached it.

If you have installed the ftp server from this post,
then all you need to do is add the following line to the following files.
   /etc/services
micro_http 80/tcp # Micro HTTP server

/etc/inetd.conf
micro_http stream tcp nowait nobody /bin/micro_httpd micro_httpd /


and do the following (in my example micro_http's new name is 9ae0):

   rw
cp /drive0/fids/9ae0 /bin/micro_http
chmod ugo+x /bin/micro_http
cd /
tar -xvzpf /drive0/fids/9aa0 usr/bin/tail
ro

restart/start inetd


However, I am not connected to the network at the moment, but testing from
the command line seems to work.



Attachments
2-15103-micro_httpd (196 downloads)


Top
#16100 - 30/08/2000 20:10 Re: Micro http server. [Re: hamzy]
hamzy
journeyman

Registered: 11/08/2000
Posts: 51
Loc: TX, USA
Sigh, it looks like the default is text/plain
so you cannot transfer the real mp3 files (ex: 1000) without making the default binary. I'll have to fix that.
It also looks like I got some of the instructions wrong.
They should be:

   /etc/services
micro_httpd 80/tcp # Micro HTTP server
/etc/inetd.conf
micro_httpd stream tcp nowait root /bin/micro_httpd micro_httpd /


and do the following (in my example micro_httpd's new name is 9ae0):

   rw
cp /drive0/fids/9ae0 /bin/micro_httpd
chmod ugo+x /bin/micro_httpd
cd /
tar -xvzpf /drive0/fids/9aa0 usr/bin/tail
ro
restart/start inetd




Top
#16101 - 30/08/2000 20:17 Re: Micro http server. [Re: hamzy]
dionysus
veteran

Registered: 16/06/1999
Posts: 1222
Loc: San Francisco, CA
...will this server automatically transfer mp3's that've been symbolically linked? the default ftp server in that package doesn't:(
-mark

...proud to have owned one of the first Mark I units
_________________________
http://mvgals.net - clublife, revisited.

Top
#16102 - 02/09/2000 03:52 Re: Micro http server. [Re: dionysus]
philb
stranger

Registered: 16/08/1999
Posts: 44
I wrote the following script to build .mp3 filenames from the fids directory, maybe it's useful to others?

#!/bin/bash

for fid in `ls /drive0/fids/*1`
do
mp3file=`echo $fid | mawk '{printf("%s\n",substr($0,0,length))}'`

echo "mp3file: $mp3file"

ln $mp3file"0" "`grep title $fid | cut -f2 -d'='`.mp3"
echo `grep title $fid | cut -f2 -d'='`

done

I hard link the files as I am running micro_http in a chrooted Debian system.

The only problem I have is that the webserver doesn't handle space chars in filenames/URLs, I have tried both Netscape and IE clients (IE replaces spaces with ), still no luck.

Works fine for filenames with no spaces though.

Philb


Top
#16103 - 02/09/2000 06:42 Re: Micro http server. [Re: philb]
dionysus
veteran

Registered: 16/06/1999
Posts: 1222
Loc: San Francisco, CA
...Pretty much the same as Bobo's slightly-altered script here:
#!/bin/sh
# bobo's dirty wrapper script
# [email protected]

# target dir for symlinks:
target="/drive0/mp3s"

files=`ls -1 *0`

for i in $files
do
fidname=$(echo $i | sed s/.$/1/)
mp3name=$i
album=$(cat $fidname | grep -i source= | sed s/source=//i)
title=$(cat $fidname | grep -i title= | sed s/title=//i)
artist=$(cat $fidname | grep -i artist= | sed s/artist=//i)
if !(test -d "$target/$album/"); then
mkdir "$target/$album/"
fi
verz=$(pwd)
echo "creating symlink: /$album/$title.mp3"
ln "$verz/$mp3name" "$target/$album/$artist - $title.mp3"
done

...the problem w/ hardlinking comes into play with two-drive empeg's..half my music is in one drive, the other half is on the other.. and unfortunately, some of the tags/fids are even split, with the music being on one partition, and the tag info being on the other.. (that part's actually easy to fix.. ) if the web server followed symbolic links though, you could compile the list in one place and the web browser shouldn't know the differnce...

I don't know though; am I the only person who gets nervous opening an http server on a public/fast IP connection?:)
-mark


...proud to have owned one of the first Mark I units
_________________________
http://mvgals.net - clublife, revisited.

Top
#16104 - 02/09/2000 08:40 Re: Micro http server. [Re: hamzy]
Blacksun
new poster

Registered: 01/05/2000
Posts: 17
Does someone know why I get the Error below, when i make a http request to my empeg?
----
Index of ./
sh: tail: command not found
----

It seems that the shell can't find tail, but I installed it in usr/bin.
Anyone have some hint's?

thank's Mirko


.: i love my empeg!!
_________________________
.: i love my empeg!!

Top
#16105 - 02/09/2000 08:57 Re: Micro http server. [Re: Blacksun]
dionysus
veteran

Registered: 16/06/1999
Posts: 1222
Loc: San Francisco, CA
looks like you're missing/don't have in your path the tail command..
-mark

MK2: 36gb
Tivo 90gb
Computer: 120gb disk space
...I think drive manufactureres love me!
_________________________
http://mvgals.net - clublife, revisited.

Top
#16106 - 02/09/2000 11:05 Re: Micro http server. [Re: dionysus]
Blacksun
new poster

Registered: 01/05/2000
Posts: 17
it seems all ok.
My Path settings look like that:
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/empeg/bin

and the tail command is in /usr/bin
-rwxr-xr-x 1 root root 17028 Feb 21 1999 tail

Where do you have your tail command?

thank's Mirko

.: i love my empeg!!
_________________________
.: i love my empeg!!

Top
#16107 - 02/09/2000 15:14 Re: Micro http server. [Re: dionysus]
hamzy
journeyman

Registered: 11/08/2000
Posts: 51
Loc: TX, USA
It looks like it does. However, it still defaults to text which is a bad, bad, bad thing!

/me slaps micro_httpd


Top
#16108 - 02/09/2000 15:17 Re: Micro http server. [Re: Blacksun]
hamzy
journeyman

Registered: 11/08/2000
Posts: 51
Loc: TX, USA
Can you run tail from the command line? Ex:

empeg:/# tail /etc/passwd
blah:blah:blah
empeg:/#


Top
#16109 - 02/09/2000 17:31 Re: Micro http server. [Re: dionysus]
PaulWay
addict

Registered: 03/08/1999
Posts: 451
Loc: Canberra, Australia
Another (perhaps better) usage of a micro HTTP server on an empeg would be to be a MP3 stream server - e.g. shoutcast. Anyone had a look at the protocol specs for that? It'd have to be integrated into the player s/w too to either smash the stream down to some desired smaller bitrate (I don't know if the streaming protocols support VBR) or re-encode the raw audio. WinAmp can do it, but it's probably a floating point encoder or something.

Any possibilities?

Save the whales. Feed the hungry. Free the mallocs.
_________________________
Owner of Mark I empeg 00061, now better than ever - (Thanks, Rod!) - and Karma 3930000004550

Top
#16110 - 03/09/2000 03:35 Re: Micro http server. [Re: PaulWay]
rob
carpal tunnel

Registered: 21/05/1999
Posts: 5335
Loc: Cambridge UK
We have lots of shoutcast experience.

Rob



Top
#16111 - 03/09/2000 13:26 Re: Micro http server. [Re: hamzy]
Blacksun
new poster

Registered: 01/05/2000
Posts: 17
I can run tail from the command prompt.

empeg:/# tail /etc/group
root:*:0:
ftp:*:1:
nogroup:*:2:nobody
tty:*:5:
empeg:/#

Is there a permission problem?

.:Mirko



.: i love my empeg!!
_________________________
.: i love my empeg!!

Top
#16112 - 03/09/2000 19:20 Re: Micro http server. [Re: rob]
hamzy
journeyman

Registered: 11/08/2000
Posts: 51
Loc: TX, USA
Can you share?


Top
#16113 - 03/09/2000 19:50 Re: Micro http server. [Re: hamzy]
hamzy
journeyman

Registered: 11/08/2000
Posts: 51
Loc: TX, USA
Ok. I made one change. If it sees "/fids/" in the path and the filename ends in "0", it will say that its an mp3 file. It looks like it already handles filenames that end in "mp3".

Now, keep in mind that this is only one of many web servers out there. I would like to see more ported to the empeg.



Attachments
2-15752-micro_httpd.tgz (95 downloads)


Top
#16114 - 03/09/2000 19:58 Re: Micro http server. [Re: Blacksun]
hamzy
journeyman

Registered: 11/08/2000
Posts: 51
Loc: TX, USA
Could be. Do you know how to tell?
But /etc/inetd.conf says the micro_httpd will run as root, so if you can execute tail from the command line, I don't know what is wrong.

Try this. Type:
micro_httpd / <and hit enter>
get / 1.0 <and hit enter>
<hit enter>

You should see something like this:

HTTP/1.0 200 Ok
Server: micro_httpd
Date: Mon, 04 Sep 2000 21:53:45 GMT
Content-type: text/html
Last-modified: Sun, 03 Sep 2000 22:04:17 GMT
Connection: close

<HTML><HEAD><TITLE>Index of ./</TITLE></HEAD>
<BODY BGCOLOR="#99cc99"><H4>Index of ./</H4>
<PRE>
drwxr-xr-x 1024 Sep 3 20:25 <A HREF="bin/">bin/</A>
drwxr-xr-x 1024 Sep 2 09:14 <A HREF="dev/">dev/</A>
drwxr-xr-x 1024 Sep 4 20:59 <A HREF="drive0/">drive0/</A>
drwx------ 1024 Jun 2 1999 <A HREF="drive1/">drive1/</A>
drwxr-xr-x 1024 Jun 23 14:09 <A HREF="empeg/">empeg/</A>
drwxr-xr-x 1024 Sep 2 20:55 <A HREF="etc/">etc/</A>
drwxr-xr-x 2048 Sep 2 20:47 <A HREF="lib/">lib/</A>
drwxr-xr-x 12288 Aug 4 14:57 <A HREF="lost+found/">lost+found/</A>
drwxr-xr-x 1024 Jun 2 1999 <A HREF="mnt/">mnt/</A>
dr-xr-xr-x 0 Sep 4 10:53 <A HREF="proc/">proc/</A>
lrwxrwxrwx 3 Aug 4 14:57 <A HREF="sbin">sbin</A> -> bin/
lrwxrwxrwx 10 Aug 4 14:57 <A HREF="swapfile">swapfile</A> -> ./dev
/hda6
drwxrwxrwx 1024 Sep 4 21:50 <A HREF="tmp/">tmp/</A>
drwxr-xr-x 1024 Sep 3 20:04 <A HREF="usr/">usr/</A>
drwxr-xr-x 1024 Sep 2 14:31 <A HREF="var/">var/</A>
</PRE>
<HR>
<ADDRESS><A HREF="http://www.acme.com/software/micro_httpd/">micro_httpd</A></AD
DRESS>
</BODY></HTML>


Top
#16115 - 04/09/2000 00:50 Re: Micro http server. [Re: hamzy]
rob
carpal tunnel

Registered: 21/05/1999
Posts: 5335
Loc: Cambridge UK
I'm not sure what the plans are with respect to shoutcast and the car player, or what the licencing issues are (if any). Hugo would be a better person to comment on this.

Rob



Top
#16116 - 04/09/2000 09:14 Re: Micro http server. [Re: Blacksun]
schofiel
carpal tunnel

Registered: 25/06/1999
Posts: 2993
Loc: Wareham, Dorset, UK
This looks as if you have a script that pipes some other command's output to tail, the whole shebang being executed by sh, and sh has not been told to continue on single error. You should look at the command you are feeding tail with.

One of the few remaining Mk1 owners... #00015
_________________________
One of the few remaining Mk1 owners... #00015

Top
#16117 - 13/10/2000 07:01 Re: Micro http server. [Re: rob]
jwtadmin
enthusiast

Registered: 05/09/2000
Posts: 210
Loc: Ipswich, MA
Hugo... Any comments on this old post?
I just showed a friend the displayserver (Found here) running on my empeg. And he asked about streaming the audio.
It would seem that this has been done by Empeg Ltd. with the diamond rio home player. What about the Empeg.....

Any plans to add this to the player software? Say while it's on a home network stream it out to a player or a PC??

John

_________________________
___ John Turner "It's easier to ask for forgiveness than to ask for permission"

Top
#16118 - 14/10/2000 09:25 Re: Micro http server. [Re: jwtadmin]
altman
carpal tunnel

Registered: 19/05/1999
Posts: 3457
Loc: Palo Alto, CA
No immediate plans for such streaming, though it may get added in a future version; it'd be nice for 128k ricochet users ;)

Hugo



Top
#16119 - 16/10/2000 06:27 Re: Micro http server. [Re: altman]
Mark Petersen
journeyman

Registered: 19/09/1999
Posts: 97
Loc: Denmark, Kbh Ø
what about that the empeg can conect to a streaming service and play it,
as there is no radio avalible while it is sitting on your desk.

Mark
wait for mk III with a USB Host/slave
(USB->GPS)(USB->Bluetooth)(USB->You name it)
_________________________
Mark wait for mk III with a USB Host/slave (USB->GPS)(USB->Bluetooth)(USB->You name it)

Top
#16120 - 17/10/2000 05:39 Re: Micro http server. [Re: altman]
anti
member

Registered: 10/07/2000
Posts: 117
Loc: BaWue, Germany, Europe
If I remeber correctly there is an arm icecast .deb.

How hard would it be to let the player stream to a (pseudo) "input"-device or a fifo?
And then just use shout to ... well, shout.


_________________________
-------------------- MKII 08000073 40GB BLUE

Top