本文发表在 rolia.net 枫下论坛I don't know what happens to your CGI program, but I can share with you what I did with similar software.
I have several internal website software under AIX+Apache+Perl. I normally use a server program(daemon process) and client program(CGI program) to handle all HTTP requests.
I create a TCP/IP server based daemon, independent to apache. the daemon process the client request via TCP/IP port. All the program logic will be used in this daemon program. The initialization process just done when daemon starts, including loading the program itself, database connection, TCP/IP socket initialization.
There is another CGI program invoked by Apache when end users click the links to this program, i.e. http://www.panus.lan/cgi-bin/hydro/statement. The program (here is statement) will talk to daemon process via TCP/IP socket. All HTTP requests will be packed and send to the daemon program to process, and display the HTTP page returned by daemon program.
While the daemon (server) programs vary, the client CGI programs are almost the same, except the TCP/IP port of daemon process. The daemon program is started by designated userid in /etc/inittab.
This mothed is useful when the initialization take relativily long: The program itself is very big, database connection is required. This also eliminates the potential security issue of CGI program.
Both daemon program and CGI program was designed via Perl.
Hope this helps.
咱们说点中文不行吗?更多精彩文章及讨论,请光临枫下论坛 rolia.net
I have several internal website software under AIX+Apache+Perl. I normally use a server program(daemon process) and client program(CGI program) to handle all HTTP requests.
I create a TCP/IP server based daemon, independent to apache. the daemon process the client request via TCP/IP port. All the program logic will be used in this daemon program. The initialization process just done when daemon starts, including loading the program itself, database connection, TCP/IP socket initialization.
There is another CGI program invoked by Apache when end users click the links to this program, i.e. http://www.panus.lan/cgi-bin/hydro/statement. The program (here is statement) will talk to daemon process via TCP/IP socket. All HTTP requests will be packed and send to the daemon program to process, and display the HTTP page returned by daemon program.
While the daemon (server) programs vary, the client CGI programs are almost the same, except the TCP/IP port of daemon process. The daemon program is started by designated userid in /etc/inittab.
This mothed is useful when the initialization take relativily long: The program itself is very big, database connection is required. This also eliminates the potential security issue of CGI program.
Both daemon program and CGI program was designed via Perl.
Hope this helps.
咱们说点中文不行吗?更多精彩文章及讨论,请光临枫下论坛 rolia.net