LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-24-2008, 01:48 PM   #1
johnson_steve
Senior Member
 
Registered: Apr 2005
Location: BrewCity, USA (Milwaukee, WI)
Distribution: Xubuntu 9.10, Gentoo 2.6.27 (AMD64), Darwin 9.0.0 (arm)
Posts: 1,152

Rep: Reputation: 46
echo text from an apache served web page to a fifo file?


OK. I have a multi-media server running gentoo Linux. it has an apache web server that I use to serve media to my iPod touch. I would like to add a page that allows me to control mplayer ( running on the server displaying to my tv ) from the safari web browser on my iPod so that I could use it as a remote. I have mplayer configured as a slave and it gets it's input from a fifo file. so if I were to:
Code:
echo "pause" > /var/tmp/mplayer_remote
it will pause the movie playing on my tv. What I would like to do is some how echo various commands into this fifo file when I 'click' one of the images on a web page hosted from the same computer that is running mplayer.

I was hoping some of you with more experience coding web pages could give me some examples of how to do this.
 
Old 07-24-2008, 04:03 PM   #2
nathacof
Member
 
Registered: Aug 2004
Location: Bear, DE, USA
Distribution: Slackware 11, CentOS 5.2, Ubuntu
Posts: 124

Rep: Reputation: 17
What web programming language are you able to work in?

This probably could be done with a cgi script if the user your server is running as has access to the /var/tmp/mplayer_remote file.
 
Old 07-25-2008, 10:24 AM   #3
johnson_steve
Senior Member
 
Registered: Apr 2005
Location: BrewCity, USA (Milwaukee, WI)
Distribution: Xubuntu 9.10, Gentoo 2.6.27 (AMD64), Darwin 9.0.0 (arm)
Posts: 1,152

Original Poster
Rep: Reputation: 46
Well I had never worked with any kind of cgi script before, but I found out how to use bash scripting for cgi. It's still a little primitive but now I have a basic webpage with the icons I made in gimp arranged in a table. when I click one of these 'buttons' it calls a bash script in my cgi-bin directory and passes it the arguments to echo into the fifo file. the bash script also automagicly redirects you to the Remote.html. it's not as fast as I like you have to wait about half a sec between button presses but it works and I can now control mplayer with my ipod touch. It took a bit of experimenting to find out that apache runs my cgi scripts in a chrooted environment (probably a good thing) so I had to relocate my fifo file to: /var/www/localhost/cgi-bin/tmp/mplayer_remote

thanks for your suggestion to look into cgi scripts.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
authentication for my apache web page linuxguy08 Linux - Server 1 05-20-2008 10:57 AM
Firefox no longer displays web page text. swamprat Linux - Software 2 04-29-2008 11:00 AM
Display a text file from hard drive into a web page EgosZ Linux - Networking 6 04-04-2005 10:51 PM
web page with apache regnier Linux - Networking 3 02-15-2005 09:49 PM
set focus on a text form of a web page? codec Programming 2 12-31-2004 04:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration