Cannot launch simple applications (notepad, java) using Apache and PERL(CGI)

Discussion in 'Perl Misc' started by JDS, May 24, 2004.

  1. JDS

    JDS Guest

    Hi:

    Introduction:
    -------------
    I need to launch an Xwindows application and a java application from a
    web-page running on Apache. The first is an exe file and the second is
    a java file. I have a simple perl script to run these. These run fine
    and the perl script launches the 2 applications (seperately), but I am
    unable to get them to launch from an IE browser running on apache:
    ----------------------------
    #!c:/perl/bin/perl.exe -w
    use strict;
    use CGI;

    my $q = new CGI;
    print $q->header( "text/plain" );
    system "cmd.exe /c test.bat";
    #system "xapp ";
    ----------------------------

    test.bat is as follows:
    -----test.bat-------
    CALL notepad
    REM CALL java -jar myapp.jar
    --------------------

    DETAILS:
    --------
    1. I can run on windows 2000 from the DOS prompt as follows:
    *xwindows application (xapp.exe)
    c:> xapp
    *Java application.
    c:> test.bat
    This brings up the GUI for my java application.
    2. The perl script above works and launches the applications in a
    seperate window. However, it waits for the application to finish- does
    not spawn a thread and forget about them.
    QUESTION: How can I do that? e.g. the notepad application is launched
    and control returns irrespective of what the user does in the
    application. Currently, the DOS prompt freezes till the user exists
    the application and retruns.

    3. The above script does not run through the web-browser (IE running
    apache). I had expected a seperate window to be launched for notepad,
    or the xapp or the java application, but that does not happen.
    QUESTION: I am lost. It looked like a simple problem and this must
    have been experience before by folks. Would appreciate guidance
    through this.

    Thanks,

    Jai.
     
    JDS, May 24, 2004
    #1
    1. Advertising

  2. JDS wrote:

    > Hi:
    >
    > Introduction:
    > -------------
    > I need to launch an Xwindows application and a java application from a
    > web-page running on Apache.


    You want to run programs from a browser? Browsers interpret HTML &
    occasionally run Javascript. You may be able to do this from javascript.

    gtoomey
     
    Gregory Toomey, May 24, 2004
    #2
    1. Advertising

  3. JDS

    JDS Guest

    The applications that need to run are:
    1. An X-windows application.
    2. A Java Application.

    Currently, I do understand the fact that the application that will
    start will run on the server side. I also know that the java
    application will need to be made into an applet and the X-windows
    application will be also replaced by a web-based application. However,
    I want to give a demo show what will eventually happen. In this case,
    there is only one machine involved- the Apache server and the java
    application and the x-windows application currently all run on the
    same windows host.

    What beats me is the fact that I cannot launch an application on the
    same machine- I should be able to run the 4 lines of code to start a
    notepad through the webserver. At this point, it is sufficient for my
    demo purposes to be able to launch an application using Apache and
    Perl as mentioned in my email.

    Hope this explains the motivation.

    Thanks,
    Jai.


    Johan Louwers <> wrote in message news:<>...
    > What exactly do you want to do?
    >
    > The things you tell in your mail are running applications ... what
    > kind of applications.... where is the application output send to?
    >
    >
    > Regards,
    > Johan Louwers.
    >
    >
    > On 23 May 2004 20:51:20 -0700, (JDS) wrote:
    >
    > >Hi:
    > >
    > >Introduction:
    > >-------------
    > >I need to launch an Xwindows application and a java application from a
    > >web-page running on Apache. The first is an exe file and the second is
    > >a java file. I have a simple perl script to run these. These run fine
    > >and the perl script launches the 2 applications (seperately), but I am
    > >unable to get them to launch from an IE browser running on apache:
    > >----------------------------
    > >#!c:/perl/bin/perl.exe -w
    > >use strict;
    > >use CGI;
    > >
    > >my $q = new CGI;
    > >print $q->header( "text/plain" );
    > >system "cmd.exe /c test.bat";
    > >#system "xapp ";
    > >----------------------------
    > >
    > >test.bat is as follows:
    > >-----test.bat-------
    > >CALL notepad
    > >REM CALL java -jar myapp.jar
    > >--------------------
    > >
    > >DETAILS:
    > >--------
    > >1. I can run on windows 2000 from the DOS prompt as follows:
    > >*xwindows application (xapp.exe)
    > >c:> xapp
    > >*Java application.
    > >c:> test.bat
    > >This brings up the GUI for my java application.
    > >2. The perl script above works and launches the applications in a
    > >seperate window. However, it waits for the application to finish- does
    > >not spawn a thread and forget about them.
    > >QUESTION: How can I do that? e.g. the notepad application is launched
    > >and control returns irrespective of what the user does in the
    > >application. Currently, the DOS prompt freezes till the user exists
    > >the application and retruns.
    > >
    > >3. The above script does not run through the web-browser (IE running
    > >apache). I had expected a seperate window to be launched for notepad,
    > >or the xapp or the java application, but that does not happen.
    > >QUESTION: I am lost. It looked like a simple problem and this must
    > >have been experience before by folks. Would appreciate guidance
    > >through this.
    > >
    > >Thanks,
    > >
    > >Jai.
     
    JDS, May 24, 2004
    #3
  4. JDS

    gnari Guest

    "JDS" <> wrote in message
    news:...

    [snip top posting]
    [remove non-existent newsgroup from header]

    >
    > What beats me is the fact that I cannot launch an application on the
    > same machine- I should be able to run the 4 lines of code to start a
    > notepad through the webserver. At this point, it is sufficient for my
    > demo purposes to be able to launch an application using Apache and
    > Perl as mentioned in my email.
    >


    I do not know about Apache under windows, but under real operating
    systems, there is the issue of privilege. the cgi scripts may not
    have the required priviledges to launch a windows application.

    gnari
     
    gnari, May 24, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. JDS
    Replies:
    4
    Views:
    8,278
    ForestHonerkamp
    Nov 11, 2008
  2. George

    Launch file in Notepad

    George, May 12, 2005, in forum: Python
    Replies:
    17
    Views:
    815
    Roger Upole
    May 13, 2005
  3. Replies:
    0
    Views:
    500
  4. Replies:
    2
    Views:
    440
  5. Replies:
    5
    Views:
    183
Loading...

Share This Page