LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-11-2013, 05:35 PM   #1
V S S Krishna
LQ Newbie
 
Registered: Mar 2013
Posts: 3

Rep: Reputation: Disabled
A Problem about exporting DISPLAY of an application


I am working on a web application which displays the home directory which
is either on the web server or mounted on an NFS partition on the web
server after a user logs in. When I click on a file in the displayed home
directory, based on its type it has to launch the application
corresponding to it. I am able to do this when the appln. is picked up
from the local system. However, if I have to pick up the application from
the web server or an NFS mounted partition on the web server system, I am
unable to figure out how to export DISPLAY to display the appln. window on
the local system. Can anyone suggest a way to export DISPLAY from a web
application program?
 
Old 03-12-2013, 09:59 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,950

Rep: Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693
Quote:
Originally Posted by V S S Krishna View Post
I am working on a web application which displays the home directory which is either on the web server or mounted on an NFS partition on the web server after a user logs in. When I click on a file in the displayed home directory, based on its type it has to launch the application
corresponding to it. I am able to do this when the appln. is picked up from the local system. However, if I have to pick up the application from the web server or an NFS mounted partition on the web server system, I am unable to figure out how to export DISPLAY to display the appln. window on the local system. Can anyone suggest a way to export DISPLAY from a web application program?
Yes, and this has been covered on this site many, MANY times, and is also easily found with a Google search.

On the local system:
  • You need to have an X windows server running, and make sure it will accept incoming connections. How you do this depends on what OS the local system is running. For Linux, make sure that the X server is not running with the "nolisten" parameter, and restart X after you remove it. Then, run "xhost <IP address of remove system>".
On the remote system:
  • Set the DISPLAY variable to be the IP address of the local system, such as "export DISPLAY=<IP address>:0"
  • Run your command/program
You don't give ANY details at all about what's running on your remote system, local system, or what you've done/tried. Without a detailed question, you can't get a detailed answer.
 
Old 03-12-2013, 05:19 PM   #3
V S S Krishna
LQ Newbie
 
Registered: Mar 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
Hello TB0ne,
Thanks for your reply,
I am very sorry for my in-detailed question...

Here is my complete description,

I am using all Linux OS Systems. Here I have one web-server and one NFS-server. I have mounted the NFS-server partition into web-server. The client who can communicate(using a web browser) with the web-server can access those(NFS mounted) files. when client click on that file, based on its type it has to launch the corresponding application. So if client has that application, he can open that file. If client doesn’t have the application, I(resides at web-server) have to run and export the application display from NFS-server to client system.

I(resides at web-server) can get the display of NFS-server. For this I am using "ssh -X username@NFS-server-IP" option. But I can't export that NFS-server appliation display to the client system.

when I use "ssh -X" option, the DISPLAY env variable already set to "localhost:10.0", But when I try with any IP address instead of localhost it showing an error message "can't open display". Even when I tried with the localhost's IP address, it gives me same error message.

I tried with ssh username@NFS-server(with out -X option) and export the DISPLAY to another IP. But It also gives me same error message.

And Even though my client is NOT listing with 'nolisten' option, I got same error message.

please correct me, where I am wrong.
waiting for your valuable reply.....



Thanks & Regards,
V.S.S.Krishna

Last edited by V S S Krishna; 03-12-2013 at 05:24 PM.
 
Old 03-12-2013, 05:50 PM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,950

Rep: Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693
Quote:
Originally Posted by V S S Krishna View Post
I am using all Linux OS Systems. Here I have one web-server and one NFS-server. I have mounted the NFS-server partition into web-server. The client who can communicate(using a web browser) with the web-server can access those(NFS mounted) files. when client click on that file, based on its type it has to launch the corresponding application. So if client has that application, he can open that file. If client doesn’t have the application, I(resides at web-server) have to run and export the application display from NFS-server to client system.

I(resides at web-server) can get the display of NFS-server. For this I am using "ssh -X username@NFS-server-IP" option. But I can't export that NFS-server appliation display to the client system.

when I use "ssh -X" option, the DISPLAY env variable already set to "localhost:10.0", But when I try with any IP address instead of localhost it showing an error message "can't open display". Even when I tried with the localhost's IP address, it gives me same error message.

I tried with ssh username@NFS-server(with out -X option) and export the DISPLAY to another IP. But It also gives me same error message. And Even though my client is NOT listing with 'nolisten' option, I got same error message.
Ok, please re-read the first post. You still don't say what version/distro of Linux, or what application you're trying to run. Again:

On your LOCAL SYSTEM (in your case, the web server)
  • Make sure the X server is accepting incoming connections. Your SSH client has NOTHING to do with this. Run a "ps -ef | grep -i listen", and see what it returns. If you see ANYTHING with "nolisten", chances are its your X server.
  • Run "xhost +" and/or "xhost <IP address of REMOTE SERVER>" In this case, that would be the IP Address of your NFS SERVER. You don't mention anywhere above where you did that, even though it's well documented on this site, and was in the first reply.
Once those things are done, log in to your remote server, using whatever terminal program you'd like.

On your REMOTE SYSTEM (your NFS server)
  • Set the DISPLAY variable to be the IP address of the local system, such as "export DISPLAY=<IP address>:0" Again, the IP address will be the IP Address of your LOCAL (web) SERVER
  • Run your command/program
That's it. Doesn't get much simpler. If it still fails, you haven't done one of the steps mentioned above, or you have some sort of firewall in place that blocks port 6000. Unblock it.
 
1 members found this post helpful.
Old 03-13-2013, 09:09 AM   #5
V S S Krishna
LQ Newbie
 
Registered: Mar 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
Hello TB0ne,

Thank you so much I solved my problem...

After all configurations, I restarted xserver manually. But I didn't work that’s why I posted this problem.

But After restarting the system it works fine...

Thank you so much for your kind help on my problem...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
telnet then exporting DISPLAY jhulik Linux - Newbie 4 05-24-2006 08:12 AM
Exporting display in Fedora 2 sebashkw Fedora 1 09-24-2005 07:16 PM
exporting display mendiratta Linux - Software 0 07-20-2004 08:01 AM
Exporting X Display belorion Linux - General 2 02-25-2004 05:16 AM
Exporting Display podollb Linux - Newbie 8 10-26-2003 10:21 PM


All times are GMT -5. The time now is 02:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration