Cygwin

来自开放百科 - 灰狐
(版本间的差异)
跳转到: 导航, 搜索
第19行: 第19行:
 
  int main(int argc, char *argv[])  
 
  int main(int argc, char *argv[])  
 
{
 
{
printf("Content-type: text/html\n\n");
+
  printf("Content-type: text/html\n\n");
printf("<head>\n");
+
  printf("<head>\n");
printf("<title>Hello, World</title>\n");
+
  printf("<title>Hello, World</title>\n");
printf("</head>\n");
+
  printf("</head>\n");
printf("<body>\n");
+
  printf("<body>\n");
printf("<h1>Hello, World</h1>\n");
+
  printf("<h1>Hello, World</h1>\n");
printf("</body>\n");
+
  printf("</body>\n");
return 0;
+
  return 0;
 
  }
 
  }
 
  gcc -o hello hello.c
 
  gcc -o hello hello.c
 
  cp hello.exe /var/www/cg-bin
 
  cp hello.exe /var/www/cg-bin
  http://localhost/cgi-bin/hello.exe   
+
  http://localhost/cgi-bin/hello.exe  :)
 
   
 
   
 
==FastCGI and Cygwin==
 
==FastCGI and Cygwin==

2007年2月14日 (三) 16:02的版本

Cygwin is a Linux-like environment for Windows.It consists of two parts:

  • A DLL (cygwin1.dll) which acts as a Linux API emulation layer providing substantial Linux API functionality.
  • A collection of tools which provide Linux look and feel.

http://cygwin.com/

通过 setup.exe 进行 cywin 软件包的安装,其过程非常简单。

目录

Apache and Cygwin

Using Apache with Cygwin - http://httpd.apache.org/docs/1.3/cygwin.html

Lighttpd and Cygwin

cd /etc/lighttpd
cp lighttpd.conf.default lighttpd.conf
/usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf

配置 cgi, 请参考 Lighttpd.conf examples

touch hello.c
#include <stdio.h>
int main(int argc, char *argv[]) 

{

 printf("Content-type: text/html\n\n");
 printf("<head>\n");
 printf("<title>Hello, World</title>\n");
 printf("</head>\n");
 printf("<body>\n");
printf("

Hello, World

\n");
 printf("</body>\n");
 return 0;
}
gcc -o hello hello.c
cp hello.exe /var/www/cg-bin
http://localhost/cgi-bin/hello.exe  :)

FastCGI and Cygwin

分享您的观点
个人工具
名字空间

变换
操作
导航
工具箱