05-27-2003
I have a related question, somehow I don't know why all my posts to alt.apache.configuration were blocked (no I didn't spam --- and I didn't have ever posted to that newsgroup).
I would like to use a TCL script as a CGI script. However, somehow Apache returns the type as application/x-tcl that prevents it from being handled properly by browsers (marked below).
===========================
cbkihong@cbkihong:~/public_html/cgi-bin> telnet localhost 80
Trying ::1...
Connected to localhost.
Escape character is '^]'.
GET /~cbkihong/cgi-bin/ip.tcl HTTP/1.0
HTTP/1.1 200 OK
Date: Tue, 27 May 2003 10:35:07 GMT
Server: Apache/2.0.43 (Unix) mod_perl/1.99_07-dev Perl/v5.8.0 DAV/2
PHP/4.3.1
Content-Length: 91
Connection: close
Content-Type: application/x-tcl <<<<-------------------
Content-Type: text/html
<html>
<body>
<p>Your IP address is ::1</p>
</body>
</html>
Connection closed by foreign host.
===============================================================
This makes the browser not interpreting it as html and generating a file
save dialog instead, although the script has already been executed and the script
generates the text/html content-type line. How can I make apache use the
content-type line generated by my script instead just like the case for Perl?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
If I have a Perl CGI script (script01), which fills an array(s) with information and outputs a HTML page with a link to another CGI page (script02); is there anyway to pass the array(s) from "script01" to "script02" when the page visitor clicks the link?
Hope that makes sense!
:) (2 Replies)
Discussion started by: WIntellect
2 Replies
2. Shell Programming and Scripting
Hi all,
I'm developing a system which requires me to run a ksh script from within a cgi script. What sort of syntax will I need to do this, I'm sure it's simple but can't find out how anywhere!
Thanks. (1 Reply)
Discussion started by: hodges
1 Replies
3. Shell Programming and Scripting
All,
I would like to run a cgi script in cygwin which i have installed in WinXP.
My CYGWIN directory structure is
/var/www/
drwxrwx---+ 2 user Users 0 Nov 23 16:24 cgi-bin
drwxrwx---+ 3 user Users 0 Oct 22 17:21 htdocs
drwxrwx---+ 3 user Users 0 Oct 22 17:22 icons
and another... (1 Reply)
Discussion started by: jambesh
1 Replies
4. Shell Programming and Scripting
Hi
I am new to this Scripting process and would like to know How can i write a ksh script that will call other ksh scripts and write the output to a file and/or email.
For example
-------
Script ABC
-------
a.ksh
b.ksh
c.ksh
I need to call all three scripts execute them and... (2 Replies)
Discussion started by: pacifican
2 Replies
5. Web Development
I have interesting problem.
https:/host/some/x.cgi
- this script has run twice when I call this url
But
http:/host/some/x.cgi
work fine, only once.
Output is text/plain.
If I change output format to the Content-type text/html,
then both urls works fine - executed only once. (2 Replies)
Discussion started by: kshji
2 Replies
6. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
This is a problem I am having with my 2 semester senior project. I have a LAMP server running Ubuntu 9.10 with... (8 Replies)
Discussion started by: JMooney5115
8 Replies
7. Shell Programming and Scripting
i ran the below in ksh...
nohup <script> &
it is runnign in background.
now how do i see if the above command is success...
i also need to bring the command to foreground and view the run details.
pls advise how to do that... (1 Reply)
Discussion started by: billpeter3010
1 Replies
8. UNIX for Beginners Questions & Answers
Hi
I have written a script and I want it to be run from web with the help of CGI. can you please guide me .
below script is working fine if run from backend but not sure how I should run through web.
#!/bin/bash
string1=look
string2=0
string3=.sdn.dnb
echo -n "enter... (3 Replies)
Discussion started by: scriptor
3 Replies
9. Shell Programming and Scripting
Hi I was hoping some one could help me with a problem I have with a .cgi script I am running in the korn shell.
I have created a web form that user fill out to gather information that I use a .cgi and sed script to translate into a xml file which is further processed by another program.
All is... (6 Replies)
Discussion started by: Paul Walker
6 Replies
10. UNIX for Beginners Questions & Answers
Hello,
I want to run this script on my CentOS 6 via browser :
________________________________________________________________________________________________
#!/bin/sh
echo Username?
read MY_NAME
echo Provisional file name?
read MY_FILE
echo File NAME you want to save?
read MY_FILE2... (16 Replies)
Discussion started by: juta2020
16 Replies
LEARN ABOUT DEBIAN
mojo::server::cgi
Mojo::Server::CGI(3pm) User Contributed Perl Documentation Mojo::Server::CGI(3pm)
NAME
Mojo::Server::CGI - CGI server
SYNOPSIS
use Mojo::Server::CGI;
my $cgi = Mojo::Server::CGI->new;
$cgi->unsubscribe('request')
$cgi->on(request => sub {
my ($cgi, $tx) = @_;
# Request
my $method = $tx->req->method;
my $path = $tx->req->url->path;
# Response
$tx->res->code(200);
$tx->res->headers->content_type('text/plain');
$tx->res->body("$method request for $path!");
# Resume transaction
$tx->resume;
});
$cgi->run;
DESCRIPTION
Mojo::Server::CGI is a simple and portable implementation of RFC 3875.
See Mojolicious::Guides::Cookbook for more.
EVENTS
Mojo::Server::CGI inherits all events from Mojo::Server.
ATTRIBUTES
Mojo::Server::CGI inherits all attributes from Mojo::Server and implements the following new ones.
"nph"
my $nph = $cgi->nph;
$cgi = $cgi->nph(1);
Activate non parsed header mode.
METHODS
Mojo::Server::CGI inherits all methods from Mojo::Server and implements the following new ones.
"run"
$cgi->run;
Run CGI.
SEE ALSO
Mojolicious, Mojolicious::Guides, <http://mojolicio.us>.
perl v5.14.2 2012-09-05 Mojo::Server::CGI(3pm)