2

I'm trying to create a link that will run a command (more specifically, open an ebook). Is there a way to do this?

3 Answers 3

1

Generally, you can run a command with cgi.

CGI-Scripts have to be in a specific folder that has to be defined in the apache configuration. like

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/

then you can just create a bash script, put it there an execute it by calling in your browser. eg. echo "Hello World" would write the output to your browser.

I'm not shure what you mean by "open an ebook", so if you give me more information about that I might be able to help you with this.

4
  • A CGI is what I was thinking of. I'm specifically trying to run "ebook-viewer %file".
    – Vallery
    Apr 17, 2011 at 23:30
  • And what should that do? Show the ebook in your browser? show it somewhere else? just open it without showing it anywhere? I'm confused
    – sBlatt
    Apr 18, 2011 at 8:22
  • Open it in a viewing application.
    – Vallery
    Apr 23, 2011 at 15:59
  • If you just link it, it should get opened in a pdf viewer in your browser... If you don't have any pdf-viewer locally you might want to use a ssh x tunnel
    – sBlatt
    Apr 24, 2011 at 19:13
1

You can have a local website (.html) with a link

<a href="http://localhost:12345"> start e-book </a>

And you need the portmapper running as a service (

sudo /etc/init.d/portmapper start

) in the background, and configure it, to start the ebook, if somebody tries to access port 12345. A bit complicated, as well as having a webserver running just for this task, but it is possible.

1

Another approach: Have a website with an Java applet, which starts a program. This might be not as easy, because of the sandbox and security restrictions, so you have to lern to sign applets yourself and so on.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .