httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dirk-Willem van Gulik <di...@webweaving.org>
Subject Re: [users@httpd] Launching X-Server based apps
Date Thu, 06 Mar 2003 19:02:34 GMT


On Wed, 5 Mar 2003, Shawn W. Devlin wrote:

> I have a program that requires X that I need to launch from a cgi, not
> as a cgi. The program crunches some data and generates some charts. It
> runs without interacting with a user. I don't want the program's display
> shown to the caller of the cgi script. The cgi script will launch the
> app, wait for it to exit, then grab the output and send that back to the
> user.
>
> When I initially set this up, the program would not run because it could
> not attach to an X server. I used xhosts to grant the webserver
> permission to access X. When I call the cgi script from the same box it
> now works but it does not run when I call the cgi script from another
> box. I believe this is because the other box has not been granted access
> to X.
..
> Does anyone know of a way to launch X based apps from a cgi?

You will need to set up the DISPLAY variable in your script. Then you will
need to allow the user which runs as apache access to the screen you
specify in the DISPLAY variable. Do a 'man xhost' to see some info on this
(though there are several other methods). If you want the screen used by
your cgi to be 'private' to apache - you may want to use a virtual screen
buffer, like Xvfb - which do not run against the normal vga/screen card -
but simply run 'headless'. Typical settings are DISPLAY=:0.0 for your
normal screen and DISPLAY=:1.0 for a Xvfb attached to screen 1.

Dw



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message