×

Loading...
Ad by
  • 推荐 OXIO 加拿大高速网络,最低月费仅$40. 使用推荐码 RCR37MB 可获得一个月的免费服务
Ad by
  • 推荐 OXIO 加拿大高速网络,最低月费仅$40. 使用推荐码 RCR37MB 可获得一个月的免费服务

tell you what I do with this kind of daemons.

本文发表在 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
Report

Replies, comments and Discussions:

  • 工作学习 / 专业技术讨论 / Question: One CGI programm is a deamon smtp server, booted by the apache call. what is the default user/group of this deamon program?
    in my Solaris+Apache, it is uucp, I dont know why?
    Bye the way, this deamon process cannt bind to the port, but another indepent smtp server can do so. Why?
    I know once the program have the setuid bit and owned by root, then it can use the port 25, why this deamon process in CGI can't?

    Any suggestion are appreciated!
    • up
      • up
    • what is your question? I can not understand what you have written.
      • sorry my poor english
        • My English also sucks so I can understand you :-)
    • tell you what I do with this kind of daemons.
      本文发表在 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
      • Thanks a lot. I resolved the trouble, just because sendmail occupy the port. BTW, I can't type chinese in office,so bad!
    • On Unix systems only root user can bind on lower than 1024 ports. So you have two way to do it: setuid and sudo. http://www.cyberteams.com/wsdexpress/help/WSDEXPT_UNIX_Perm.html
      do it by setuid:
      ls -lrt /.../cgi-bin/deamon
      chmod 6755 deamon
      chown root deamon

      do it by sudo:
      check httpd.conf to know the httpd user, nomally nobody.
      check the sudo document , add it to /etc/sudoers
      let nobody run deamon as root.
      modify your cgi, create another cgi d1, let d1 call "sudo deamon"
      let http user call d1.

      On the other thought, since it's a deamon, why don't you directly start it by root? just like the apache deamon.
      • Thanks a lot, I got it.