X11 for apache user

Posted by fuenfundachtzig on Server Fault See other posts from Server Fault or by fuenfundachtzig
Published on 2010-10-25T13:07:20Z Indexed on 2011/02/05 15:27 UTC
Read the original article Hit count: 285

We are using inkscape to convert SVG images uploaded to our server via a web form. For this inkscape offers a batch mode via the -z option, but this batch mode has a flaw: When inkscape is run by the apache user, it breaks saying

$ inkscape -z -W drawing.svg
X11 connection rejected because of wrong authentication.
The application 'inkscape' lost its connection to the display localhost:11.0;
most likely the X server was shut down or you killed/destroyed
the application.

If you do the same as a normal user you also get errors:

Xlib: connection to "localhost:11.0" refused by server
Xlib: PuTTY X11 proxy: MIT-MAGIC-COOKIE-1 data did not match
(inkscape:24050): Gdk-CRITICAL **: gdk_display_list_devices: assertion `GDK_IS_DISPLAY (display)' failed
301.27942

But at least inkscape gives the correct answer (here the number stating the width of the image).

Does somebody know how to make this also work for the apache user? Does it make sense to authorize apache to use X (if so how)? In any case it doesn't feel like the right solution...

© Server Fault or respective owner

Related posts about apache

Related posts about x11