如何通过后台运行的Perl脚本触发apache用户启动Linux中的XServer?
的 Perl 脚本通过 WINE 启动 MS Office
我正在尝试使用由 apache 托管并由其他应用程序触发 。我在日志文件中收到以下错误消息
“应用程序尝试创建窗口,但无法加载驱动程序。 确保您的 X 服务器正在运行并且 $DISPLAY 设置正确”。
如果我使用 root 用户直接在 shell 提示符下运行脚本,那么 WINE 会
正确启动 XServer 并执行 MS MSoffice,如果我设置了 xhost +local:apache 在 shell 提示符下也可以正常工作
我如何从 apache 用户启动 XServer?
I am trying to launch MS Office through WINE using a Perl script hosted by apache
and and triggered by other application. I am getting the following error message in
log files "Application trying to create a window but no driver could not be loaded.
Make sure that your X server is running and that $DISPLAY is set correctly".
If I run the script directly on shell prompt using root user then WINE starts
XServer properly and execute MS MSoffice in addition to that if I set xhost +local:apache on shell prompt then also it works fine.
How can I start the XServer from apache user?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
每个 httpd 工作线程启动一个 X 服务器是一个极其糟糕的主意。如果您坚持这样做,请使用 Xvfb。
我的建议是让一个单独的守护进程处理文档转换/创建,并使用消息队列来传递作业。
It is an exceedingly bad idea to start a X server per httpd worker. If you insist on doing this though, use Xvfb.
My recommendation would be to have a separate daemon handle the document conversion/creation, and use a message queue to pass it jobs.