guyuehhh 发表于 2015-8-4 10:36:37

windows Apache+cgi的配置方法

  1.配置config
  line 119 :打开#LoadModule rewrite_module modules/mod_rewrite.so
  line 192 :
    Options FollowSymLinks
    AllowOverride All
    Order deny,allow
    Deny from all

  line 227:AllowOverride All
  line 345: AllowOverride None
    Options ExecCGI
    Order allow,deny
    Allow from all
  line 394:#AddHandler cgi-script .cgi .exe .pl
  2.配置exe
  把需要执行的exe放在\cgi-bin目录下
  在exe中通过取环境变量REQUEST_METHOD 来取得GET 还是POST method
  通过环境变量REQUEST_URI 取得URL .....
  因为已经重载了标准输入输出所以 通过printf实现对client的输出
  3.配置访问文件
  把需要访问的文件放在 htdocs目录下 并手动添加.htaccess文件
  文件内容为
  
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ /cgi-bin/test.exe

  4.重启服务
页: [1]
查看完整版本: windows Apache+cgi的配置方法