![]() |
HowTo.CompilingCGIProgramsForHttpd HistoryHide minor edits - Show changes to markup May 09, 2008, at 01:25 AM
by -- despam
Changed lines 1-72 from:
Just Look At This For a secondLoved the Comprehensive work. impressive [LINK=http://ba-free-ca.150m.com/index1.html]1985 diagram free toyota wire[/LINK] <a href=" http://ba-free-ca.150m.com/index1.html ">1985 diagram free toyota wire</a> to:
Goal: Compile a C program to make a CGI executable for thttpd - all on the NSLU2. Prerequisites: Installation of Unslung. Steps: Note: The locations used in this example may vary for your installation. 1) Create the C source file, webhello.c, using the editor of your choice. Here's the code: #include <stdio.h>
#include <time.h>
int main()
{
time_t tim = time(NULL);
printf("Content-type: text/html\n" /* Necessary to specify the type */
"\n" /* This blank line is critical! */
"<html>\n"
"<body>\n"
"Hello, World!<br>\n"); /* Do the hello thing... */
/* Print out the current time */
printf("The time is %s<br>\n", asctime(localtime(&tim)) );
printf("</body>\n"
"</html>\n");
return 0;
}
2) Compile the C source file: gcc webhello.c -o webhello.cgi
strip webhello.cgi
3) Move the executable into the web hierarchy: mv webhello.cgi /home/www/ 4) Identify the CGI pattern to thttpd. This can be done two ways: On the command line:
/usr/bin/thttpd -c '**.cgi'
Or, in the config file as:
cgipat=**.cgi
5) Access the CGI file through a browser using: http://www.ByteRed.com/webhello.cgi That's it! 6) Final Note: For simple CGI scripts, you can use a shell script like following: #!/bin/ash echo "Content-type: text/plain" echo "" echo "Hello World!" set Don't forget to May 06, 2008, at 11:52 AM
by -- TBhPCplIlVpUVzMd
Changed lines 1-72 from:
Goal: Compile a C program to make a CGI executable for thttpd - all on the NSLU2. Prerequisites: Installation of Unslung. Steps: Note: The locations used in this example may vary for your installation. 1) Create the C source file, webhello.c, using the editor of your choice. Here's the code: #include <stdio.h>
#include <time.h>
int main()
{
time_t tim = time(NULL);
printf("Content-type: text/html\n" /* Necessary to specify the type */
"\n" /* This blank line is critical! */
"<html>\n"
"<body>\n"
"Hello, World!<br>\n"); /* Do the hello thing... */
/* Print out the current time */
printf("The time is %s<br>\n", asctime(localtime(&tim)) );
printf("</body>\n"
"</html>\n");
return 0;
}
2) Compile the C source file: gcc webhello.c -o webhello.cgi
strip webhello.cgi
3) Move the executable into the web hierarchy: mv webhello.cgi /home/www/ 4) Identify the CGI pattern to thttpd. This can be done two ways: On the command line:
/usr/bin/thttpd -c '**.cgi'
Or, in the config file as:
cgipat=**.cgi
5) Access the CGI file through a browser using: http://www.ByteRed.com/webhello.cgi That's it! 6) Final Note: For simple CGI scripts, you can use a shell script like following: #!/bin/ash echo "Content-type: text/plain" echo "" echo "Hello World!" set Don't forget to to:
Just Look At This For a secondLoved the Comprehensive work. impressive [LINK=http://ba-free-ca.150m.com/index1.html]1985 diagram free toyota wire[/LINK] <a href=" http://ba-free-ca.150m.com/index1.html ">1985 diagram free toyota wire</a> May 06, 2008, at 11:22 AM
by -- restored spam
Changed lines 1-2 from:
I really Liked This Site, Check itYou Must Look In This Website [LINK=http://freeazg.110mb.com/]120t code free motorola ringtone[/LINK] <a href=" http://freeazg.110mb.com/ ">120t code free motorola ringtone</a> to:
Goal: Compile a C program to make a CGI executable for thttpd - all on the NSLU2. Prerequisites: Installation of Unslung. Steps: Note: The locations used in this example may vary for your installation. 1) Create the C source file, webhello.c, using the editor of your choice. Here's the code: #include <stdio.h>
#include <time.h>
int main()
{
time_t tim = time(NULL);
printf("Content-type: text/html\n" /* Necessary to specify the type */
"\n" /* This blank line is critical! */
"<html>\n"
"<body>\n"
"Hello, World!<br>\n"); /* Do the hello thing... */
/* Print out the current time */
printf("The time is %s<br>\n", asctime(localtime(&tim)) );
printf("</body>\n"
"</html>\n");
return 0;
}
2) Compile the C source file: gcc webhello.c -o webhello.cgi
strip webhello.cgi
3) Move the executable into the web hierarchy: mv webhello.cgi /home/www/ 4) Identify the CGI pattern to thttpd. This can be done two ways: On the command line:
/usr/bin/thttpd -c '**.cgi'
Or, in the config file as:
cgipat=**.cgi
5) Access the CGI file through a browser using: http://www.ByteRed.com/webhello.cgi That's it! 6) Final Note: For simple CGI scripts, you can use a shell script like following: #!/bin/ash echo "Content-type: text/plain" echo "" echo "Hello World!" set Don't forget to May 05, 2008, at 10:15 PM
by -- FYOlAmaH
Changed lines 1-72 from:
Goal: Compile a C program to make a CGI executable for thttpd - all on the NSLU2. Prerequisites: Installation of Unslung. Steps: Note: The locations used in this example may vary for your installation. 1) Create the C source file, webhello.c, using the editor of your choice. Here's the code: #include <stdio.h>
#include <time.h>
int main()
{
time_t tim = time(NULL);
printf("Content-type: text/html\n" /* Necessary to specify the type */
"\n" /* This blank line is critical! */
"<html>\n"
"<body>\n"
"Hello, World!<br>\n"); /* Do the hello thing... */
/* Print out the current time */
printf("The time is %s<br>\n", asctime(localtime(&tim)) );
printf("</body>\n"
"</html>\n");
return 0;
}
2) Compile the C source file: gcc webhello.c -o webhello.cgi
strip webhello.cgi
3) Move the executable into the web hierarchy: mv webhello.cgi /home/www/ 4) Identify the CGI pattern to thttpd. This can be done two ways: On the command line:
/usr/bin/thttpd -c '**.cgi'
Or, in the config file as:
cgipat=**.cgi
5) Access the CGI file through a browser using: http://www.ByteRed.com/webhello.cgi That's it! 6) Final Note: For simple CGI scripts, you can use a shell script like following: #!/bin/ash echo "Content-type: text/plain" echo "" echo "Hello World!" set Don't forget to to:
I really Liked This Site, Check itYou Must Look In This Website [LINK=http://freeazg.110mb.com/]120t code free motorola ringtone[/LINK] <a href=" http://freeazg.110mb.com/ ">120t code free motorola ringtone</a> May 05, 2008, at 09:16 PM
by -- undoing spam
Changed lines 1-2 from:
Please Review This Site, You'll Like It [LINK= http://freeaza.110mb.com/ ]lorazepam wikipedia the free encyclopedia[/LINK] <a href=" http://freeaza.110mb.com/ ">lorazepam wikipedia the free encyclopedia</a> to:
Goal: Compile a C program to make a CGI executable for thttpd - all on the NSLU2. Prerequisites: Installation of Unslung. Steps: Note: The locations used in this example may vary for your installation. 1) Create the C source file, webhello.c, using the editor of your choice. Here's the code: #include <stdio.h>
#include <time.h>
int main()
{
time_t tim = time(NULL);
printf("Content-type: text/html\n" /* Necessary to specify the type */
"\n" /* This blank line is critical! */
"<html>\n"
"<body>\n"
"Hello, World!<br>\n"); /* Do the hello thing... */
/* Print out the current time */
printf("The time is %s<br>\n", asctime(localtime(&tim)) );
printf("</body>\n"
"</html>\n");
return 0;
}
2) Compile the C source file: gcc webhello.c -o webhello.cgi
strip webhello.cgi
3) Move the executable into the web hierarchy: mv webhello.cgi /home/www/ 4) Identify the CGI pattern to thttpd. This can be done two ways: On the command line:
/usr/bin/thttpd -c '**.cgi'
Or, in the config file as:
cgipat=**.cgi
5) Access the CGI file through a browser using: http://www.ByteRed.com/webhello.cgi That's it! 6) Final Note: For simple CGI scripts, you can use a shell script like following: #!/bin/ash echo "Content-type: text/plain" echo "" echo "Hello World!" set Don't forget to May 04, 2008, at 07:33 AM
by -- KuCfQNFJc
Changed lines 1-72 from:
Goal: Compile a C program to make a CGI executable for thttpd - all on the NSLU2. Prerequisites: Installation of Unslung. Steps: Note: The locations used in this example may vary for your installation. 1) Create the C source file, webhello.c, using the editor of your choice. Here's the code: #include <stdio.h>
#include <time.h>
int main()
{
time_t tim = time(NULL);
printf("Content-type: text/html\n" /* Necessary to specify the type */
"\n" /* This blank line is critical! */
"<html>\n"
"<body>\n"
"Hello, World!<br>\n"); /* Do the hello thing... */
/* Print out the current time */
printf("The time is %s<br>\n", asctime(localtime(&tim)) );
printf("</body>\n"
"</html>\n");
return 0;
}
2) Compile the C source file: gcc webhello.c -o webhello.cgi
strip webhello.cgi
3) Move the executable into the web hierarchy: mv webhello.cgi /home/www/ 4) Identify the CGI pattern to thttpd. This can be done two ways: On the command line:
/usr/bin/thttpd -c '**.cgi'
Or, in the config file as:
cgipat=**.cgi
5) Access the CGI file through a browser using: http://www.ByteRed.com/webhello.cgi That's it! 6) Final Note: For simple CGI scripts, you can use a shell script like following: #!/bin/ash echo "Content-type: text/plain" echo "" echo "Hello World!" set Don't forget to to:
Please Review This Site, You'll Like It [LINK= http://freeaza.110mb.com/ ]lorazepam wikipedia the free encyclopedia[/LINK] <a href=" http://freeaza.110mb.com/ ">lorazepam wikipedia the free encyclopedia</a> February 20, 2005, at 12:58 PM
by --
Changed lines 61-72 from:
That's it! to:
That's it! 6) Final Note: For simple CGI scripts, you can use a shell script like following: #!/bin/ash echo "Content-type: text/plain" echo "" echo "Hello World!" set Don't forget to November 17, 2004, at 06:49 PM
by --
Changed line 17 from:
#incluce <time.h> to:
#include <time.h> November 17, 2004, at 04:06 AM
by --
Changed line 59 from:
http://www.byteyellow.com/webhello.cgi to:
http://www.ByteRed.com/webhello.cgi November 11, 2004, at 06:18 AM
by --
Added line 17:
#incluce <time.h> Changed lines 21-23 from:
printf("Content-type: text/html\n" /* Necessary for page header */
to:
time_t tim = time(NULL);
printf("Content-type: text/html\n" /* Necessary to specify the type */
Changed lines 27-28 from:
"Hello, World!\n" /* Do the hello thing... */ "</body>\n" to:
"Hello, World!<br>\n"); /* Do the hello thing... */
/* Print out the current time */
printf("The time is %s<br>\n", asctime(localtime(&tim)) );
printf("</body>\n"
Added line 34:
November 11, 2004, at 06:17 AM
by --
Changed line 19 from:
main() to:
int main() November 11, 2004, at 06:10 AM
by --
Changed lines 20-34 from:
/* Necessary for page header */
printf("Content-type: text/html\n");
printf("\n"); /* This blank line is critical! */
/* Here is the simplest starting HTML */
printf("<html>\n");
printf("<body>\n");
/* Your HTML goes here */
printf("Hello, World!\n");
/* and the simplest ending HTML */
printf("</body>\n");
printf("</html>\n");
to:
printf("Content-type: text/html\n" /* Necessary for page header */
"\n" /* This blank line is critical! */
"<html>\n"
"<body>\n"
"Hello, World!\n" /* Do the hello thing... */
"</body>\n"
"</html>\n");
November 08, 2004, at 07:00 AM
by --
Added line 41:
strip webhello.cgi November 08, 2004, at 06:40 AM
by --
Changed line 44 from:
mv webhello.cgi /share/udd/www/ to:
mv webhello.cgi /home/www/ November 08, 2004, at 06:31 AM
by --
Changed line 58 from:
http://www.nslu2.com/webhello.cgi to:
http://www.byteyellow.com/webhello.cgi November 08, 2004, at 06:30 AM
by --
Changed line 12 from:
Here's the Hello program turned into a CGI executable for thttpd. to:
Note: The locations used in this example may vary for your installation. November 08, 2004, at 06:29 AM
by --
Changed line 3 from:
Compile a C program to make a CGI executable for thttpd. to:
Compile a C program to make a CGI executable for thttpd - all on the NSLU2. Changed line 8 from:
Successful completion of NativeNSLU2Toolchain, which provides a development environment on your NSLU2. \\ to:
Successful completion of NativeNSLU2Toolchain, which provides a development environment on your NSLU2. Changed line 14 from:
1) Create the C source file, webhello.c, using the editor of your choice. Here's the code: to:
1) Create the C source file, webhello.c, using the editor of your choice. Here's the code: Changed line 38 from:
2) Compile the C source file: to:
2) Compile the C source file: Changed line 42 from:
3) Move the executable into the web hierarchy: to:
3) Move the executable into the web hierarchy: Changed line 46 from:
4) You must identify the CGI pattern to thttpd. This can be done two ways: to:
4) Identify the CGI pattern to thttpd. This can be done two ways: Changed line 56 from:
5) You access the CGI file through a browser using: to:
5) Access the CGI file through a browser using: November 08, 2004, at 06:27 AM
by --
Changed lines 1-60 from:
Describe CompilingCGIProgramsForHttpd here. to:
Goal: Compile a C program to make a CGI executable for thttpd. Prerequisites: Installation of HomePage Unslung?. Here's the Hello program turned into a CGI executable for thttpd. 1) Create the C source file, webhello.c, using the editor of your choice. Here's the code: #include <stdio.h>
main()
{
/* Necessary for page header */
printf("Content-type: text/html\n");
printf("\n"); /* This blank line is critical! */
/* Here is the simplest starting HTML */
printf("<html>\n");
printf("<body>\n");
/* Your HTML goes here */
printf("Hello, World!\n");
/* and the simplest ending HTML */
printf("</body>\n");
printf("</html>\n");
return 0;
}
2) Compile the C source file: gcc webhello.c -o webhello.cgi 3) Move the executable into the web hierarchy: mv webhello.cgi /share/udd/www/ 4) You must identify the CGI pattern to thttpd. This can be done two ways: On the command line:
/usr/bin/thttpd -c '**.cgi'
Or, in the config file as:
cgipat=**.cgi
5) You access the CGI file through a browser using: http://www.nslu2.com/webhello.cgi That's it! |