cgi 共通閘道介面 (common gateway interface)

Click here to load reader

Upload: walker

Post on 05-Jan-2016

45 views

Category:

Documents


3 download

DESCRIPTION

CGI 共通閘道介面 (Common Gateway Interface). 什麼是 CGI ?  為什麼需要 CGI ? 應用?  CGI 與 JAVA Script/VB Script 的差異?  CGI 的工具需求 ?  CGI 的環境設定注意事項  一個基本 CGI 程式實作 . 什麼是 CGI ?. CGI ( C ommon G ataway I nterface , 常被譯做「 共通閘道介面 」),是介於 WWW 伺服器與系統資源之間的一個介面。 - PowerPoint PPT Presentation

TRANSCRIPT

  • CGI (Common Gateway Interface)CGI ? CGI ? ? CGI JAVA Script/VB Script? CGI ? CGI CGI

  • CGI ?CGI (Common Gataway Interface , )WWWCommon CGIGataway W3 Interface W3

  • CGI

  • CGI ? ?W3W3CGIW3 CGI CGI: : KimoPCHomeYahoo!

  • CGIJAVA/VB Script?CGIW3CGIW3W3CGIW3CGICGICGIJAVA Script/Visual Basic ScriptW3ScriptScriptScriptJAVA/VB ScriptScriptASP(Active Server Page, MS)PHP

  • CGI?CGIW3: ApacheSamberC/C++PerlVBDelphiW3viUltraEdit

  • CGIApache Server (Linux RedHat ) : /etc/httpd/conf httpd.confaccess.confsrm.confCGI srm.conf ScriptAlias /cgi-bin/ /home/httpd/cgi-bin/ AddHandler cgi-script .cgi (owner/group/others : r/w/x) (1) cgi-bin 711 (2) CGI 755 (3) 666

  • CGI C : HelloWorld.c

    Perl HelloWorld.pl

  • HelloWorld.c : #include int main(int argc, char *argv[]) { printf(Content-type:text/html\n\n); printf(\n); printf(Hello, World\n); printf(\n); printf(\n); printf(Hello, World\n); printf(\n); return 0; }

  • HelloWorld.pl : #!/usr/bin/perl print Content-type:text/html\n\n; print \n; print Hello, World\n; print \n; print \n; print Hello, World\n; print \n;