HTML/PERL/CGI on my own machine?
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Debian support > Linux Debian support > HTML/PERL/CGI on my own machine?




Pages (2): [1] 2 »   Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    HTML/PERL/CGI on my own machine?  
Dave Murray


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-25-07 06: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





[ Post a follow-up to this message ]



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


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-25-07 06: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.







[ Post a follow-up to this message ]



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


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-25-07 12:14 PM

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 ;-)





[ Post a follow-up to this message ]



    Re: HTML/PERL/CGI on my own machine?  
Pat McDonnell


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-25-07 06: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






[ Post a follow-up to this message ]



    Re: HTML/PERL/CGI on my own machine?  
Dave Murray


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-26-07 06: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





[ Post a follow-up to this message ]



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


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-26-07 06: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"






[ Post a follow-up to this message ]



    Re: HTML/PERL/CGI on my own machine?  
Dave Murray


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-26-07 06: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





[ Post a follow-up to this message ]



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


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-27-07 06: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?






[ Post a follow-up to this message ]



    Re: HTML/PERL/CGI on my own machine?  
Dave Murray


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-27-07 06: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





[ Post a follow-up to this message ]



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


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-27-07 12:14 PM

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.x
ml
> 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.





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 06:14 PM.      Post New Thread    Post A Reply      
Pages (2): [1] 2 »   Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register