[R] General X11 Problems

michael watson (IAH-C) michael.watson at bbsrc.ac.uk
Thu Jul 3 13:26:35 CEST 2003


Hi

You may remember a while ago I was having problems with creating jpegs using R over CGI.  I solved this on my LAPTOP (*grins*) by 

- executing "xhost +localhost" from the command line 
- putting "SetEnv DISPLAY=:0.0" in my httpd.conf (apache)

And all worked well.  Now I'm trying to move the whole system onto my shiny new server - and encountering yet more problems with X11() (why, god why???).

Quick rundown - SUSE Linux 8.1, R version 1.7.1, Apache 1.3.27.

>From the COMMAND LINE, as the user my webserver runs as, I get:

>jpeg(file="blah",height=480,width=480)
1633: X11 connection rejected because of wrong authentication.
X connection to localhost:12.0 broken (explicit kill or server shutdown)

>From the COMMAND LINE as root, it works fine :-D

Over CGI, running as webmstr and with SetEnv DISPLAY=:0.0, I get:

Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

Error in X11(paste("jpeg::", quality, ":", filename, sep = ""), width,  : 
	unable to start device JPEG
In addition: Warning message: 
unable to open connection to X11 display`' 
Execution halted

Over CGI, running as webmstr and with SetEnv DISPLAY=:12.0, I get:

Error in X11(paste("jpeg::", quality, ":", filename, sep = ""), width,  : 
	unable to start device JPEG
In addition: Warning message: 
unable to open connection to X11 display`' 
Execution halted

Over CGI, running as webmstr and with no SetEnv command, I get:

Error in X11(paste("jpeg::", quality, ":", filename, sep = ""), width,  : 
	unable to start device JPEG
In addition: Warning message: 
unable to open connection to X11 display`' 
Execution halted


Ahem... so I think the take home message is that I haven't a clue how X11 works or hy it is so awkward.  NOTE I HAVE THIS ALL WORKING ON MY LAPTOP which is an identical setup.  I think what is telling is that the user webmstr can't open X11 displays from R either through the command line or via CGI

Help?

Mick

Michael Watson
Head of Informatics
Institute for Animal Health,
Compton Laboratory,
Compton,
Newbury,
Berkshire RG20 7NN
UK

Phone : +44 (0)1635 578411 ext. 2535
Mobile: +44 (0)7764 490236
E-mail: michael.watson at bbsrc.ac.uk




More information about the R-help mailing list