HTML/PERL/CGI on my own machine? - Debian

This is a discussion on HTML/PERL/CGI on my own machine? - Debian ; I have some HTML files that take input and with: and call a perl script that does some logic then: print " Fret Board \n"; print " \n"; etc. which serves up an html page. At least that's what it ...

+ Reply to Thread
Results 1 to 11 of 11

Thread: HTML/PERL/CGI on my own machine?

  1. HTML/PERL/CGI on my own machine?

    I have some HTML files that take input and with:


    and call a perl script that does some logic then:

    print "Fret Board\n";
    print "\n";
    etc.

    which serves up an html page.

    At least that's what it did when I had it on my old ISPs server. My new
    ISP does not permit server side applications. I'd like to use this stuff
    on my own pc. When I try to run it it outputs the perl source to a new
    browser tab instead of running it.

    I tried installing apache and running it without options. I see several
    instances of it sleeping:

    PID TTY TIME CMD
    4638 ? 00:00:00 apache
    4639 ? 00:00:00 apache
    4640 ? 00:00:00 apache
    4641 ? 00:00:00 apache
    4642 ? 00:00:00 apache
    4643 ? 00:00:00 apache
    4645 pts/2 00:00:00 ps

    It didn't help.

    What do I need to do to make this work for my on my pc?

    Dave

  2. Re: HTML/PERL/CGI on my own machine?

    On 08/24/2007 09:48 PM, Dave Murray wrote:
    > [...]
    > At least that's what it did when I had it on my old ISPs server. My new
    > ISP does not permit server side applications. I'd like to use this stuff
    > on my own pc. When I try to run it it outputs the perl source to a new
    > browser tab instead of running it.
    > [...]


    You would have to configure Apache to allow CGI scripts, and then you'd
    have to give the scripts the proper permissions and put them in the
    proper location.

    Typically, the Apache manual can be accessed through
    http://localhost/manual/. It will show you how to use the various
    directives; Alias, ScriptAlias and others; to configure Apache to run
    CGI scripts.



  3. Re: HTML/PERL/CGI on my own machine?

    On 08/24/2007 11:08 PM, Mumia W. wrote:
    > On 08/24/2007 09:48 PM, Dave Murray wrote:
    >> [...]

    >
    > You would have to configure Apache to allow CGI scripts, [...]


    Or you could just install boa. Apache is legendary for the complexity of
    its configuration.

    I just installed boa, and configuring it to do CGI was as easy as
    singing a commercial jingle about hot dogs ;-)

  4. Re: HTML/PERL/CGI on my own machine?


    You'll need to put the scripts in your server's cgi-bin directory, and chmod
    them so the webserver execute them. On my server, that directory
    is /usr/lib/cgi-bin , but check how Apache's configured. HTH.

    Dave Murray wrote:

    > I have some HTML files that take input and with:
    >
    >
    > and call a perl script that does some logic then:
    >
    > print "Fret Board\n";
    > print "\n";
    > etc.
    >
    > which serves up an html page.
    >
    > At least that's what it did when I had it on my old ISPs server. My new
    > ISP does not permit server side applications. I'd like to use this stuff
    > on my own pc. When I try to run it it outputs the perl source to a new
    > browser tab instead of running it.
    >
    > I tried installing apache and running it without options. I see several
    > instances of it sleeping:
    >
    > PID TTY TIME CMD
    > 4638 ? 00:00:00 apache
    > 4639 ? 00:00:00 apache
    > 4640 ? 00:00:00 apache
    > 4641 ? 00:00:00 apache
    > 4642 ? 00:00:00 apache
    > 4643 ? 00:00:00 apache
    > 4645 pts/2 00:00:00 ps
    >
    > It didn't help.
    >
    > What do I need to do to make this work for my on my pc?
    >
    > Dave



    --
    Posted via a free Usenet account from http://www.teranews.com


  5. Re: HTML/PERL/CGI on my own machine?

    Mumia W. wrote:
    > On 08/24/2007 11:08 PM, Mumia W. wrote:
    >> On 08/24/2007 09:48 PM, Dave Murray wrote:
    >>> [...]

    >>
    >> You would have to configure Apache to allow CGI scripts, [...]

    >
    > Or you could just install boa. Apache is legendary for the complexity of
    > its configuration.
    >
    > I just installed boa, and configuring it to do CGI was as easy as
    > singing a commercial jingle about hot dogs ;-)


    Thanks. I just installed boa. I'm glad that you found it easy to
    configure. So far for me, no joy.

    The error log says that the server started on port 80. The access log is
    empty.

    Something isn't right about the configuration. I hope to figure it out.

    Dave

  6. Re: HTML/PERL/CGI on my own machine?

    On 08/25/2007 08:16 PM, Dave Murray wrote:
    > Mumia W. wrote:
    >> On 08/24/2007 11:08 PM, Mumia W. wrote:
    >>> On 08/24/2007 09:48 PM, Dave Murray wrote:
    >>>> [...]
    >>>
    >>> You would have to configure Apache to allow CGI scripts, [...]

    >>
    >> Or you could just install boa. Apache is legendary for the complexity
    >> of its configuration.
    >>
    >> I just installed boa, and configuring it to do CGI was as easy as
    >> singing a commercial jingle about hot dogs ;-)

    >
    > Thanks. I just installed boa. I'm glad that you found it easy to
    > configure. So far for me, no joy.
    >
    > The error log says that the server started on port 80. The access log is
    > empty.
    >
    > Something isn't right about the configuration. I hope to figure it out.
    >
    > Dave


    Read "man boa" and make your configuration changes in /etc/boa/boa.conf.

    As root, you can restart boa by issuing "/etc/init.d/boa restart"


  7. Re: HTML/PERL/CGI on my own machine?

    Mumia W. wrote:
    > On 08/25/2007 08:16 PM, Dave Murray wrote:
    >> Mumia W. wrote:
    >>> On 08/24/2007 11:08 PM, Mumia W. wrote:
    >>>> On 08/24/2007 09:48 PM, Dave Murray wrote:
    >>>>> [...]
    >>>>
    >>>> You would have to configure Apache to allow CGI scripts, [...]
    >>>
    >>> Or you could just install boa. Apache is legendary for the complexity
    >>> of its configuration.
    >>>
    >>> I just installed boa, and configuring it to do CGI was as easy as
    >>> singing a commercial jingle about hot dogs ;-)

    >>
    >> Thanks. I just installed boa. I'm glad that you found it easy to
    >> configure. So far for me, no joy.
    >>
    >> The error log says that the server started on port 80. The access log
    >> is empty.
    >>
    >> Something isn't right about the configuration. I hope to figure it out.
    >>
    >> Dave

    >
    > Read "man boa" and make your configuration changes in /etc/boa/boa.conf.
    >
    > As root, you can restart boa by issuing "/etc/init.d/boa restart"
    >


    Thanks. I've done that. It seems correct to me so I have no idea what
    change must be made. Clearly, something is not correct since it doesn't
    work.

    Dave

  8. Re: HTML/PERL/CGI on my own machine?

    On 08/26/2007 10:12 AM, Dave Murray wrote:
    > Mumia W. wrote:
    >> [...]
    >> Read "man boa" and make your configuration changes in /etc/boa/boa.conf.
    >>
    >> As root, you can restart boa by issuing "/etc/init.d/boa restart"
    >>

    >
    > Thanks. I've done that. It seems correct to me so I have no idea what
    > change must be made. Clearly, something is not correct since it doesn't
    > work.
    >
    > Dave


    What doesn't work?


  9. Re: HTML/PERL/CGI on my own machine?

    Mumia W. wrote:
    > On 08/26/2007 10:12 AM, Dave Murray wrote:
    >> Mumia W. wrote:
    >>> [...]
    >>> Read "man boa" and make your configuration changes in /etc/boa/boa.conf.
    >>>
    >>> As root, you can restart boa by issuing "/etc/init.d/boa restart"
    >>>

    >>
    >> Thanks. I've done that. It seems correct to me so I have no idea what
    >> change must be made. Clearly, something is not correct since it
    >> doesn't work.
    >>
    >> Dave

    >
    > What doesn't work?
    >


    Thank you for your continuing interest in helping me with this.

    /var/www/dc_fb.html (owner/group www-data) (permissions -rw-r--r--)

    collects data and has



    /var/www/cgi-bin/fb.cgi (owner/group www-data) (permissions -rwxr-xr-x)

    has

    #!/usr/bin/perl
    --logic and such--
    print "Content-type: text/html\n\n";
    print "\n";
    --more cgi output--

    When I "submit" from the html file instead of executing the perl and
    outputing the cgi, it downloads fb.cgi and opens it in an editor.

    The properties for the .cgi has open with text editor. I have tried to
    add "opens with" perl, but get "Could not add application to the
    application database".

    I am certain that boa is running;

    /var/log/boa/error_log shows:

    [26/Aug/2007:15:34:48 +0000] caught SIGHUP, restarting
    [26/Aug/2007:15:34:48 +0000] re-reading configuration files
    [26/Aug/2007:15:34:48 +0000] successful restart

    interestingly it also has:

    127.0.0.1 - - [26/Aug/2007:16:05:39 +0000] request "GET /crossdomain.xml
    HTTP/1.1" ("/var/www/crossdomain.xml"): document open: No such file or
    directory

    and /var/log/boa/access_log shows:

    127.0.0.1 - - [26/Aug/2007:16:05:39 +0000] "GET /crossdomain.xml
    HTTP/1.1" 404 0 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.6)
    Gecko/20070725 Firefox/2.0.0.6"

    I don't know what happened there; nothing that I remember consciously
    doing.It is not from trying to submit with the html file. But it seems
    to be evidence that boa is running, so perhaps it has somethin to do
    with my html/cgi (which did work when I had it on my old isp's server)

    Regards,
    Dave

  10. Re: HTML/PERL/CGI on my own machine?

    On 08/26/2007 10:53 PM, Dave Murray wrote:
    >
    > Thank you for your continuing interest in helping me with this.
    >
    > /var/www/dc_fb.html (owner/group www-data) (permissions -rw-r--r--)
    >
    > collects data and has
    >
    >
    >
    > /var/www/cgi-bin/fb.cgi (owner/group www-data) (permissions -rwxr-xr-x)
    >
    > has
    >
    > #!/usr/bin/perl
    > --logic and such--
    > print "Content-type: text/html\n\n";
    > print "\n";
    > --more cgi output--
    >
    > When I "submit" from the html file instead of executing the perl and
    > outputing the cgi, it downloads fb.cgi and opens it in an editor.
    >
    > The properties for the .cgi has open with text editor. I have tried to
    > add "opens with" perl, but get "Could not add application to the
    > application database".
    >
    > I am certain that boa is running;
    >
    > /var/log/boa/error_log shows:
    >
    > [26/Aug/2007:15:34:48 +0000] caught SIGHUP, restarting
    > [26/Aug/2007:15:34:48 +0000] re-reading configuration files
    > [26/Aug/2007:15:34:48 +0000] successful restart
    >
    > interestingly it also has:
    >
    > 127.0.0.1 - - [26/Aug/2007:16:05:39 +0000] request "GET /crossdomain.xml
    > HTTP/1.1" ("/var/www/crossdomain.xml"): document open: No such file or
    > directory
    >
    > and /var/log/boa/access_log shows:
    >
    > 127.0.0.1 - - [26/Aug/2007:16:05:39 +0000] "GET /crossdomain.xml
    > HTTP/1.1" 404 0 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.6)
    > Gecko/20070725 Firefox/2.0.0.6"
    >
    > I don't know what happened there; nothing that I remember consciously
    > doing.It is not from trying to submit with the html file. But it seems
    > to be evidence that boa is running, so perhaps it has somethin to do
    > with my html/cgi (which did work when I had it on my old isp's server)
    >
    > Regards,
    > Dave


    The request of /crossdomain.xml probably has to do with an extension
    that you installed into Firefox; ignore it, and don't bother
    reconfiguring Firefox because the problem is in boa's configuration.

    Boa.conf has this section which might need to be changed:

    > # Uncomment the next line if you want .cgi files to execute from anywhere
    > #AddType application/x-httpd-cgi cgi
    >


    So I uncommented the line, and CGI scripts work for me.

    Another option, which would be better for you probably, would be to
    change the ScriptAlias directive in boa.conf to point to the location of
    your cgi-bin directory.

    If you do that, you won't need to uncomment the "AddType
    application/x-httpd-cgi cgi" line.

    Whenever you access a script, and you see its source instead of its
    output, that means that the web server isn't configured to execute those
    kinds of scripts from that location on the filesystem. The server must
    be reconfigured when this happens.

    Read /etc/boa/boa.conf again and read the documentation in
    /usr/share/doc/boa.

  11. Re: HTML/PERL/CGI on my own machine?

    Mumia W. wrote:
    > On 08/26/2007 10:53 PM, Dave Murray wrote:
    >>
    >> Thank you for your continuing interest in helping me with this.
    >>
    >> /var/www/dc_fb.html (owner/group www-data) (permissions -rw-r--r--)
    >>
    >> collects data and has
    >>
    >>
    >>
    >> /var/www/cgi-bin/fb.cgi (owner/group www-data) (permissions -rwxr-xr-x)
    >>
    >> has
    >>
    >> #!/usr/bin/perl
    >> --logic and such--
    >> print "Content-type: text/html\n\n";
    >> print "\n";
    >> --more cgi output--
    >>
    >> When I "submit" from the html file instead of executing the perl and
    >> outputing the cgi, it downloads fb.cgi and opens it in an editor.
    >>
    >> The properties for the .cgi has open with text editor. I have tried to
    >> add "opens with" perl, but get "Could not add application to the
    >> application database".
    >>
    >> I am certain that boa is running;
    >>
    >> /var/log/boa/error_log shows:
    >>
    >> [26/Aug/2007:15:34:48 +0000] caught SIGHUP, restarting
    >> [26/Aug/2007:15:34:48 +0000] re-reading configuration files
    >> [26/Aug/2007:15:34:48 +0000] successful restart
    >>
    >> interestingly it also has:
    >>
    >> 127.0.0.1 - - [26/Aug/2007:16:05:39 +0000] request "GET
    >> /crossdomain.xml HTTP/1.1" ("/var/www/crossdomain.xml"): document
    >> open: No such file or directory
    >>
    >> and /var/log/boa/access_log shows:
    >>
    >> 127.0.0.1 - - [26/Aug/2007:16:05:39 +0000] "GET /crossdomain.xml
    >> HTTP/1.1" 404 0 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US;
    >> rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6"
    >>
    >> I don't know what happened there; nothing that I remember consciously
    >> doing.It is not from trying to submit with the html file. But it seems
    >> to be evidence that boa is running, so perhaps it has somethin to do
    >> with my html/cgi (which did work when I had it on my old isp's server)
    >>
    >> Regards,
    >> Dave

    >
    > The request of /crossdomain.xml probably has to do with an extension
    > that you installed into Firefox; ignore it, and don't bother
    > reconfiguring Firefox because the problem is in boa's configuration.
    >
    > Boa.conf has this section which might need to be changed:
    >
    >> # Uncomment the next line if you want .cgi files to execute from anywhere
    >> #AddType application/x-httpd-cgi cgi
    >>

    >
    > So I uncommented the line, and CGI scripts work for me.



    I have already tried that without sucess.

    >
    > Another option, which would be better for you probably, would be to
    > change the ScriptAlias directive in boa.conf to point to the location of
    > your cgi-bin directory.


    I hve tried that already too.


    > If you do that, you won't need to uncomment the "AddType
    > application/x-httpd-cgi cgi" line.
    >
    > Whenever you access a script, and you see its source instead of its
    > output, that means that the web server isn't configured to execute those
    > kinds of scripts from that location on the filesystem. The server must
    > be reconfigured when this happens.
    >
    > Read /etc/boa/boa.conf again and read the documentation in
    > /usr/share/doc/boa.



    I guess that that is next.

    Thanks,
    Dave

+ Reply to Thread