|
Home > Archive > Linux Debian support > August 2007 > HTML/PERL/CGI on my own machine?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
HTML/PERL/CGI on my own machine?
|
|
| Dave Murray 2007-08-25, 1:15 am |
| I have some HTML files that take input and with:
<form method="GET" action="cgi-bin/xyz.cgi">
and call a PERL script that does some logic then:
<form method="GET" action="cgi-bin/fb.cgi">
print "<TITLE>Fret Board</TITLE>\n";
print "<head>\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
| |
| Mumia W. 2007-08-25, 1:15 am |
| 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.
| |
| Mumia W. 2007-08-25, 7:14 am |
| 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 ;-)
| |
| Pat McDonnell 2007-08-25, 1:14 pm |
|
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:
> <form method="GET" action="cgi-bin/xyz.cgi">
>
> and call a PERL script that does some logic then:
> <form method="GET" action="cgi-bin/fb.cgi">
> print "<TITLE>Fret Board</TITLE>\n";
> print "<head>\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
| |
| Dave Murray 2007-08-26, 1:15 am |
| Mumia W. wrote:
> On 08/24/2007 11:08 PM, Mumia W. wrote:
>
> 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
| |
| Mumia W. 2007-08-26, 1:15 am |
| On 08/25/2007 08:16 PM, Dave Murray wrote:
> Mumia W. wrote:
>
> 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"
| |
| Dave Murray 2007-08-26, 1:14 pm |
| Mumia W. wrote:
> On 08/25/2007 08:16 PM, Dave Murray 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
| |
| Mumia W. 2007-08-27, 1:14 am |
| On 08/26/2007 10:12 AM, Dave Murray wrote:
> Mumia W. wrote:
>
> 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?
| |
| Dave Murray 2007-08-27, 1:14 am |
| Mumia W. wrote:
> On 08/26/2007 10:12 AM, Dave Murray wrote:
>
> 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
<form method="GET" action="cgi-bin/fb.cgi">
/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 "<html>\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
| |
| Mumia W. 2007-08-27, 7:14 am |
| 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
>
> <form method="GET" action="cgi-bin/fb.cgi">
>
> /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 "<html>\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.
| |
| Dave Murray 2007-08-27, 7:14 pm |
| Mumia W. wrote:
> On 08/26/2007 10:53 PM, Dave Murray wrote:
>
> 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:
>
>
> 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
|
|
|
|
|