《GoAhead开发 — 安装移植(一)》

1.源码下载

官方文档:https://www.embedthis.com/goahead/doc/

源码下载: goahead-4.1.0-src.tgz

参考:https://www.cnblogs.com/silencehuan/p/10972610.html

  https://blog.csdn.net/richu123/article/details/78112941

goahead源码解析:

 https://blog.csdn.net/chenlonglong2014

https://www.cnblogs.com/cslunatic/p/3658880.html

goahead前台与后台的交互(ajax):

https://blog.csdn.net/MNJLJ_23NMK/article/details/78233744?utm_source=blogxgwz2&utm_medium=distribute.pc_relevant.none-task-blog-baidulandingword-1&spm=1001.2101.3001.4242

2.解压安装

tar –zxvf goahead-4.1.0-src.tgz
make
make install

  在build/linux-x64-default/bin/下有goahead。运行./goahead

错误提示:

goahead: 0: Cannot open config file route.txt
goahead: 0: Cannot initialize server. Exiting.

  解决办法:把 route.txt 拷贝到goahead可执行文件同一目录下。(在src/下)

goahead: 0: Cannot open config file auth.txt
goahead: 0: Cannot load auth.txt

  解决办法:在goahead可执行文件同一目录下创建auth.txt。(touch auth.txt)

3.修改配置文件

# vi route.txt
route uri=/cgi-bin dir=cgi-bin handler=cgi
修改为:
route uri=/cgi-bin dir=/var/www handler=cgi     // dir设置为web目录的绝对路径

在/www目录下创建cgi-bin/文件夹

  

4.测试

  将写好的html文件放在/vaw/www下:

  

  在cgi-bin下放相对应的cgi程序 :

  

  运行goahead程序:

./goahead &

  

  浏览器访问:http://localhost/2.html

  

   随便在文本框中输入123   456。

  

   就会调用相对应的cgi程序。

原文地址:https://www.cnblogs.com/zhuangquan/p/13474167.html