由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Linux版 - 编写支持CGI的web服务器大致原理
相关主题
perl cgi中调用C可执行程序为什么在html中不显示?怎样在环境变量里加换行符?
我的home server[请问]如何在script中设置环境变量
请教个简单命令问题Xming 问题
学习load balanced cluster 服务器设置请教一个linux下面matlab的问题
如何在configure 中指定环境变量哪位大牛来普及一下 linux 下面的各种环境变量以及设置
怎么从script中把环境变量传回到当前shell中? 纠结死了, 到底是用 GB2312 还是 UTF8 存中文文件名呢
请问tcsh里如何将环境变量临时改变且传递给一个命令?高人帮我看看一个简单的script,为什么nohup有问题?
请教 GNU Screen display 的问题请问mpirun怎么放在后台运行?
相关话题的讨论汇总
话题: cgi话题: web话题: stdout话题: want话题: 服务器
进入Linux版参与讨论
1 (共1页)
s*****k
发帖数: 604
1
Window和unix-like系统中,如何启动一个外部程序,
并且设置它的环境变量,输入一些数据到这个程序stdin,
并且获得这个程序输出到stdout的结果?
问这个问题是想知道编写支持CGI的web服务器的大致原理。
L*1
发帖数: 11537
2
Your question is not clear.
If you want to know how the web server (服务器) handles CGI internally, not
many people can help you -- better read some source code (e.g. Apache).
If you want to know how your CGI program will do the job, that should be
easy.
In the web world, we use forms to submit information. These information are
submitted to the server using POST or GET method. The form data is feed to
the CGI program, you decode it (or use existing lib functions) to get the
parameters you want. Once you get the things you want, you make a system
call to do whatever you want. The external program can write output to
stdout directly, or to a file. Anything you write to stdout will be
displayed on web pages.
s*****k
发帖数: 604
3
我的问题当然是第一个意思了,我不提web服务器的话不是很清楚吗
是web server启动一个外部CGI程序,设置好很多环境变量,
并且有需要的话从stdin中输入一些数据,然后这个CGI程序
运行,完了输出到它的stdout,这时候web server就获得CGI程序
输出的stdout的stream.
我没学过操作系统什么的,要是学过里面的进程管理应该很容易知道吧

not
are

【在 L*1 的大作中提到】
: Your question is not clear.
: If you want to know how the web server (服务器) handles CGI internally, not
: many people can help you -- better read some source code (e.g. Apache).
: If you want to know how your CGI program will do the job, that should be
: easy.
: In the web world, we use forms to submit information. These information are
: submitted to the server using POST or GET method. The form data is feed to
: the CGI program, you decode it (or use existing lib functions) to get the
: parameters you want. Once you get the things you want, you make a system
: call to do whatever you want. The external program can write output to

s*****k
发帖数: 604
4
自己查到了,就是调用系统的spawn类函数,
这个unix-like系统和windows都有的。
熟悉系统编程或者学过操作系统的不可能不知道这个吧?

not
are

【在 L*1 的大作中提到】
: Your question is not clear.
: If you want to know how the web server (服务器) handles CGI internally, not
: many people can help you -- better read some source code (e.g. Apache).
: If you want to know how your CGI program will do the job, that should be
: easy.
: In the web world, we use forms to submit information. These information are
: submitted to the server using POST or GET method. The form data is feed to
: the CGI program, you decode it (or use existing lib functions) to get the
: parameters you want. Once you get the things you want, you make a system
: call to do whatever you want. The external program can write output to

1 (共1页)
进入Linux版参与讨论
相关主题
请问mpirun怎么放在后台运行?如何在configure 中指定环境变量
perl 高手看过来怎么从script中把环境变量传回到当前shell中?
&! 什么意思?请问tcsh里如何将环境变量临时改变且传递给一个命令?
./test input and ./test < input请教 GNU Screen display 的问题
perl cgi中调用C可执行程序为什么在html中不显示?怎样在环境变量里加换行符?
我的home server[请问]如何在script中设置环境变量
请教个简单命令问题Xming 问题
学习load balanced cluster 服务器设置请教一个linux下面matlab的问题
相关话题的讨论汇总
话题: cgi话题: web话题: stdout话题: want话题: 服务器