前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >public static Object service(String url, World至浏览

public static Object service(String url, World至浏览

原创
作者头像
w4979的博客
修改2020-06-01 10:13:15
2350
修改2020-06-01 10:13:15
举报
文章被收录于专栏:随笔记录随笔记录

params);

str = str + retr.toString();

} catch (Exception e) {

e.printStackTrace();

}

return str;

}

/**

* 请求执行器

*/

public Integer doGet(String str) {

// 设定每次进入的请求都将全局变量ssa+1(问题所在)

return ++ssa;

}

public static void main(String[] args) throws Exception{

// 启动初始化

init();

// 打印请求路径

for (Map.Entry<String, char *argv[] )

1

2

3

4

5

6

7

8

9

10

11

12

13

{

while( FCGI_Accept() >= 0 )

{

FCGI_printf( “Status: 200 OK\r\n” );

FCGI_printf( “Content-Type: text/html\r\n\r\n” );

FCGI_printf( "Hello, method);

}

/**

* 请求分发

* @param url 请求路径

* @param params 请求参数

*/

public static Object service(String url, World至浏览器。

1

2

3

4

5

6

采用如下命令进行编译、链接

g++ main.cpp -o helloworld -lfcgi

输出文件可以随便命名,本文命名为helloworld。

3.5 修改nginx.conf文件

在http->server中添加如下location

location = /demo.cgi

{

fastcgi_pass 127.0.0.1:8081;

fastcgi_index

1

2

3

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档