English 中文(简体)
我如何在服务器方面利用巨头进行挖掘?
原标题:How can I play a wav sound on the server side using cgi?

我怎么能够从一个(bash)CGI的手稿中指挥,在服务器的侧上做一个 w光灯?

最佳回答

你可以像Nak所描述的那样,执行你的指挥线音响角色,但这可能不会因为使用人Pharma的许可而发挥作用。 缺席,阿帕奇作为www-data:www-data(或apache:apache或www:www on some distros)管理。 作为一种快速固定/测试,你可以把阿帕奇作为用户,允许通过修改你/etc/apache2/apache2,进入机器上的音响装置。

 User USER_THAT_CAN_PLAY_AUDIO
 Group USER_THAT_CAN_PLAY_AUDIO 

警告:这不是安全的,也不是要成为永久解决办法!

问题回答

这就是我如何这样做。

#!/bin/sh
echo Content-type: text/plain
echo ""
echo "Server is playing sine.wav!"
aplay -q sine.wav

I stumbled over this old question looking how to solve the same problem: to have my personal Apache webserver warning me when someone makes a specific request (in my case a call for chat without the need to have any IM running).

www.un.org/Depts/DGACM/index_spanish.htm 下面的解决办法是我在Slackware 14.1 上的用意:根据你的说法,

  • 增加以下条目:<代码>UserRunningApache ALL=(ALL)NOPASSWD: /usr/bin/play (UserRunningApache是您阿帕奇使用的用户名称)

  • 在PHP网页上,你希望打上一个声音的添加:system (“sudo /usr/bin/play SOUND.WAV”;

如果你不想让阿帕奇能够查阅<条码>/usr/bin的复印件,即使仅限于<条码>。 可执行的方案(用于操作/usr/bin/play),但必须相应修改上述最后两项指示。





相关问题
Using SimplePie with CodeIgniter and XAMPP

I am using CodeIgniter 1.7.2 with XAMPP 1.7.2 on a Windows computer. I am trying to make use of SimplePie. I followed all the instructions I could find: a copy of simplepie.inc is in my applications/...

Multiple Sites with common files

I have developed over 50 sites that all use the exact same files other than CSS and IMAGES, I currently duplicate the files each time I create a new site and upload different css and images. What ...

http server validation

I finish a litle http server, writing from scratch. I would like to be sure that my imlementation is conforme to the HTTP specifications. W3C give us tools for HTML/XML conformance, but i see nothing ...

热门标签