{"id":336,"date":"2013-05-17T09:37:41","date_gmt":"2013-05-17T09:37:41","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/2013\/05\/17\/introduction-of-cgi\/"},"modified":"2017-12-25T01:47:23","modified_gmt":"2017-12-25T01:47:23","slug":"introduction-of-cgi","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/introduction-of-cgi\/","title":{"rendered":"Introduction of CGI | What is Common Gateway Interface (CGI)?"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3777 aligncenter\" src=\"http:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2013\/05\/cgi-introduction.png\" alt=\"cgi-introduction\" width=\"600\" height=\"400\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2013\/05\/cgi-introduction.png 600w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2013\/05\/cgi-introduction-300x200.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p><strong>Any Server will (mostly) do\u00a0\u00a0\u00a0<\/strong><\/p>\n<ul>\n<li>CGI will not work without a server<\/li>\n<li>Your Server must allow CGI<\/li>\n<li>Your CGI application must be written in a language supported by your server<\/li>\n<li>You can use probably your existing web server<\/li>\n<li>If you need to test on your local computer, you may install WAMP\/XAMPP<\/li>\n<li>Each Server has a particular requirements about running\u00a0 CGI Applications<\/li>\n<\/ul>\n<p><strong>Prerequisties<\/strong><br \/>\nExperience in relevant programming language<\/p>\n<ul>\n<li>Perl<\/li>\n<li>Php<\/li>\n<li>Unix Shell<\/li>\n<li>c\/c++<\/li>\n<li>HTML\/CSS<\/li>\n<\/ul>\n<p><strong>What is CGI<\/strong><br \/>\nCommon Interface Gateway<\/p>\n<ul>\n<li>How web browsers submit forms and interact with programs on the server<\/li>\n<li>Used for simple interaction applications<\/li>\n<li>Can be used with any programming language<\/li>\n<li>Often called \u201cCGI Scripts\u201d<\/li>\n<li>Can be written in any language<\/li>\n<li>Run in the server, not in a web browser<\/li>\n<li>Must follow server requirements for running applocations<\/li>\n<\/ul>\n<p><strong>ANY SERVER WILL (MOSTLY) do<\/strong><\/p>\n<ul>\n<li>CGI will not work without a web server<\/li>\n<li>Your Server must allow CGI<\/li>\n<li>Your CGI application must be written in a language supported by your server<\/li>\n<li>You can use\u00a0 your existing web server<\/li>\n<li>If you need to test on your local computer, you may install WAMP\/XAMPP<\/li>\n<\/ul>\n<p><strong>Some Guidelines for Unix\/Apapche users<\/strong><\/p>\n<ol>\n<li>Permission \u2013 755 ( aka rwxr-xr-x)<\/li>\n<li>Filename associates<\/li>\n<li>.cgi, .pl, .php \u2026etc<\/li>\n<li>.httaccess<\/li>\n<li>Options+ExecCGI<\/li>\n<li>AddHandle cgi-scripts .cgi<\/li>\n<li>SetHander cgi-script<\/li>\n<li>Access to server log<\/li>\n<\/ol>\n<p><strong>Some Guidelines for Windows Servers<\/strong><br \/>\nMany Windows servers do not support perl or PHP<br \/>\nMay require ASP or C#<br \/>\nUsually require specific filename extension<br \/>\n.pl for perl<br \/>\n.php for php<br \/>\n.asp or .aspx for ASP<br \/>\nAccess to error log<br \/>\nCheck with your server web site or support staff<\/p>\n<p><strong>How CGI works<\/strong><\/p>\n<ol>\n<li>Browser Communicates with server over HTTP<\/li>\n<li>Browser sends a request to the server consisting of header and optional body<\/li>\n<li>Server sends information to the CGI application<\/li>\n<li>Environment variables<\/li>\n<li>Body may be sent in the STDIN stream<\/li>\n<li>Server sends a response consisting of a header and a body<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Any Server will (mostly) do\u00a0\u00a0\u00a0 CGI will not work without a server Your Server must allow CGI Your CGI application must be written in a language supported by your server You can use probably your existing web server If you need to test on your local computer, you may install WAMP\/XAMPP Each Server has a&#8230;<\/p>\n","protected":false},"author":1,"featured_media":3777,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","_joinchat":[],"footnotes":""},"categories":[2],"tags":[2372,2377,2369,2371,2370,2373,2376,2379,2375,719,2378,2374],"class_list":["post-336","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorised","tag-about-cgi","tag-about-common-gateway-interface","tag-cgi","tag-cgi-introduction","tag-cgi-overview","tag-common-gateway-interface","tag-introduction-of-common-gateway-interface","tag-know-about-cgi","tag-servers","tag-start","tag-understand-cgi","tag-what-is-cgi"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/336","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=336"}],"version-history":[{"count":2,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/336\/revisions"}],"predecessor-version":[{"id":3778,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/336\/revisions\/3778"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/3777"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=336"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=336"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=336"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}