Re: [SLUG] running X11 app through Apache
I'm laughing over here guys. Thanks for all your help, but I sorted out the issue. I put a shellscript in place to do the job before I mailed SLUG, and it wasn't working as well. So, just for the record, I decided to set the HOME path in it before doing anything else, and it ran fine. I was counting with the fact that since I started my Apache webserver via the apachectl script, it would get all the enviroment variables from the parent process, which is the shell. Reading the apachectl script, I found these lines: / # pick up any necessary environment variables if test -f /usr/sbin/envvars; then . /usr/sbin/envvars fi / And I don't have /usr/bin/envvars. So it was probably not picking up anything. Anyway, thanks for everything. ps: still, it's odd. On 5/3/05, Matthew Hannigan <[EMAIL PROTECTED]> wrote: > On Tue, May 03, 2005 at 09:27:10AM +1000, Julio Cesar Ody wrote: > > Thanks for the answers so far! > > > > Yeah, it's a bizarre idea. But fact is that I need to perform an > > operation using OpenOffice.org, and even if you run with the > > "-invisible" parameter, it still requires that you have a Xserver, > > Ah, so *that's* the problem. > > Not a new one. Early java versions had this problem too. > Even though you were doing server side stuff, if you used > graphics classes on Unix, you needed an X server. > > The solution then, and now, is to run a headless X server: > Xvfb (X virtual frame buffer). > > Matt > > -- Julio C. Ody http://www.livejournal.com/users/julioody/ -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Re: [SLUG] running X11 app through Apache
On Tue, May 03, 2005 at 09:27:10AM +1000, Julio Cesar Ody wrote: > Thanks for the answers so far! > > Yeah, it's a bizarre idea. But fact is that I need to perform an > operation using OpenOffice.org, and even if you run with the > "-invisible" parameter, it still requires that you have a Xserver, Ah, so *that's* the problem. Not a new one. Early java versions had this problem too. Even though you were doing server side stuff, if you used graphics classes on Unix, you needed an X server. The solution then, and now, is to run a headless X server: Xvfb (X virtual frame buffer). Matt -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Re: [SLUG] running X11 app through Apache
Thanks for the answers so far! Yeah, it's a bizarre idea. But fact is that I need to perform an operation using OpenOffice.org, and even if you run with the "-invisible" parameter, it still requires that you have a Xserver, which in my humble opinion, is a lame idea. The script will run a macro on the command line, and bail out right after. I've set the display variable to point to my xserver's IP address. You can even specify it as a parameter. Works fine if you run it through the shell. I disabled my Xserver's access controls just to make sure I'm getting it right, and when I run the script, I do get an error message on my screen, saying OpenOffice could not run, and that's it. AFAIK, there's no error logs. So I figure I should try to run, say, Firefox through the same script to see what happens. I tried, and Firefox didn't run. No error messages, no logs, nothing. Just didn't run. Then I realized I was not being able to run anything that requires X11 through it. PHP has a memory limit parameter, in php.ini. It's value has to be enough to fit the memory allocated in RAM for the application being called from inside the script. As a desperate measure, I put it to 200MB allowed, to make SURE it could fit OO.org. Well, nothing changed, so I assume that's not the point. So that's exactly where I am now. MAYBE it's something related to the enviroment variables. It would be odd if it is, because I tried to run it from a clean enviroment via shell, and it worked just fine, but I'm still considering the possibility. Any help is appreciated. On 5/2/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > On Mon, May 02, 2005 at 03:57:46PM +1000, Julio Cesar Ody wrote: > > I tried to run a few GUI (X11) applications to run through my > > webserver, but no success so far. They simply don't run, and no error > > appear in any of my logs. Does anybody know how to do it? > > X11 apps need a DISPLAY variable set in the environment and it has > to be a valid X11 display and the program (running as apache) needs > suitable permissions. You can probably get something working by getting > the web server to build a DISPLAY environment variable from the client > IP address and then using the "xhost" at the other end to open up > permissions. The result would be kind of ugly, well very ugly > actually, but it could work. > > - Tel ( http://bespoke.homelinux.net/ ) > -- > SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ > Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html > -- Julio C. Ody http://www.livejournal.com/users/julioody/ -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Re: [SLUG] running X11 app through Apache
On Mon, May 02, 2005 at 10:05:12PM +1000, Angus Lees wrote: > At Mon, 2 May 2005 15:57:46 +1000, Julio Cesar Ody wrote: > > I tried to run a few GUI (X11) applications to run through my > > webserver, but no success so far. They simply don't run, and no error > > appear in any of my logs. Does anybody know how to do it? > The x.org guys seem to have even updated the Xrx browser plugin to > work with newer mozillas.. This reminds me, the vncserver program includes a small web server that sends you a java client and puts an X11 desktop into your browser. Vncserver exists in various incarnations but RedHat gives you the http://www.realvnc.com/ version. Please note the lack of security involved with this method, it does have password protection but no encryption. I've used it to run stuff over an ADSL line and it is livable, not fantastic. If you actually decide you like vnc then there are native clients for just about every platform that give better performance than the java client, you might also think about an ssh tunnel. - Tel ( http://bespoke.homelinux.net/ ) -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Re: [SLUG] running X11 app through Apache
At Mon, 2 May 2005 15:57:46 +1000, Julio Cesar Ody wrote: > I tried to run a few GUI (X11) applications to run through my > webserver, but no success so far. They simply don't run, and no error > appear in any of my logs. Does anybody know how to do it? Heh, its a crazy idea but strangely enough not a new one. A lot of X11R6.3 was devoted to these sorts of ideas. See http://www.broadwayinfo.com/ and have a poke around http://cvs.freedesktop.org/xorg/xc/programs/xrx/ The x.org guys seem to have even updated the Xrx browser plugin to work with newer mozillas.. (Personally I think Xrx would be pretty cool for intranet settings. I'm sure daniels agrees ;) -- - Gus -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Re: [SLUG] running X11 app through Apache
On Mon, May 02, 2005 at 03:57:46PM +1000, Julio Cesar Ody wrote: > I tried to run a few GUI (X11) applications to run through my > webserver, but no success so far. They simply don't run, and no error > appear in any of my logs. Does anybody know how to do it? X11 apps need a DISPLAY variable set in the environment and it has to be a valid X11 display and the program (running as apache) needs suitable permissions. You can probably get something working by getting the web server to build a DISPLAY environment variable from the client IP address and then using the "xhost" at the other end to open up permissions. The result would be kind of ugly, well very ugly actually, but it could work. - Tel ( http://bespoke.homelinux.net/ ) -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
RE: [SLUG] running X11 app through Apache
Julio, It seems what you are trying to do and what you are doing it with are orthogonal. The apache web server is design to take requests via HTTP, process them, and spit them out as HTTP. Usually this means a browser sends a GET or POST request for a URL, and the Apache server returns, HTML or XML which the browser displays. X11 clients (the applications) use the X protocol, interacting directly with the X server (which is the terminal). Mouse and keyboard events are encapsulated in X by the terminal, sent to the client, which does some processing, then sends the graphics draw instructions back to the server. This is totally different to the type of interaction and protocol of a web server. Maybe if you explain specifically what you are trying to do, we might be able to guide you. Martin Martin Visser, CISSP Network and Security Consultant Consulting & Integration Technology Solutions Group - HP Services 410 Concord Road Rhodes NSW 2138 Australia Mobile: +61-411-254-513 Fax: +61-2-9022-1800 E-mail: martin.visserAThp.com This email (including any attachments) is intended only for the use of the individual or entity named above and may contain information that is confidential, proprietary or privileged. If you are not the intended recipient, please notify HP immediately by return email and then delete the email, destroy any printed copy and do not disclose or use the information in it. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Julio Cesar Ody Sent: Monday, 2 May 2005 3:58 PM To: slug Subject: [SLUG] running X11 app through Apache I tried to run a few GUI (X11) applications to run through my webserver, but no success so far. They simply don't run, and no error appear in any of my logs. Does anybody know how to do it? I tried to do it through a PHP script, installed as an Apache module. I'm pretty sure my Apache user has the correct permissions. I managed to run anything just fine by using it on the shell, however, essentially when trying to run via a script (HTTP Request), it just doesn't happen. Any help is appreciated. -- Julio C. Ody -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
[SLUG] running X11 app through Apache
I tried to run a few GUI (X11) applications to run through my webserver, but no success so far. They simply don't run, and no error appear in any of my logs. Does anybody know how to do it? I tried to do it through a PHP script, installed as an Apache module. I'm pretty sure my Apache user has the correct permissions. I managed to run anything just fine by using it on the shell, however, essentially when trying to run via a script (HTTP Request), it just doesn't happen. Any help is appreciated. -- Julio C. Ody -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html