zoukankan      html  css  js  c++  java
  • goahead 移植

    1.网上下载goahead-3.1.2-0-src.tgz包  

    2.解压 

           tar -zxvf goahead-3.1.2-0-src.tgz 

    3.编译 

          cd goahead-3.1.2-0 

          make CC=arm-hisiv100-linux-gcc ARCH=arm 

          在linux-arm-default/bin中可以找到goahead和相关库文件,将库文件拷贝到板子/lib下

    4.测试

          运行./goahead -v /web 192.168.1.155:9000


    问题1: 

          goahead: 0: Can't get host address for host dvr: errno 11   

          goahead: 0: Can't initialize server. Exiting.   

         出处:goahead-3.1.1-0srchttp.c文件的setLocalHost函数 

         修改: 

    #if 0   
    
        if ((hp = gethostbyname(host)) == NULL) {   //MHB 2013-10-22   
    
            error("Can't get host address for host %s: errno %d", host, errno);   
    
            return -1;   
    
        }   
    
        memcpy((char*) &intaddr, (char *) hp->h_addr_list[0], (size_t) hp->h_length);   
    
        ipaddr = inet_ntoa(intaddr);   
    
    #else   //MHB 2013-10-22 换种方式获取ip地址 (ipv4)   
    
        int sockfd;    
    
        struct sockaddr_in sin;    
    
        struct ifreq ifr;          
    
        sockfd = socket(AF_INET, SOCK_DGRAM, 0);       
    
        if (sockfd == -1)   {              
    
            return -1;             
    
        }          
    
        strncpy(ifr.ifr_name, "eth0", IFNAMSIZ);    //网卡多的得修改下   
    
        ifr.ifr_name[IFNAMSIZ - 1] = 0;        
    
        if (ioctl(sockfd, SIOCGIFADDR, &ifr) < 0)    {              
    
            return -1;     
    
        }      
    
        memcpy(&sin, &ifr.ifr_addr, sizeof(sin));      
    
        ipaddr=inet_ntoa(sin.sin_addr);    
    
    #endif   
    
        websSetIpAddr(ipaddr);   
    
        websSetHost(ipaddr); 

    问题2: 

            goahead: 0: Can't open config file route.txt   

            goahead: 0: Can't initialize server. Exiting.   

            解决方法: 

            拷贝goahead-3.1.1-0src oute.txt文件到goahead同目录下


    问题3: 

            网页存放位置 

            /web目录启动是 可以指定。


  • 相关阅读:
    Android Studio库依赖问题
    Android学习笔记View的工作原理
    专用服务器模式&共享服务器模式
    Linux命令学习总结:shutdown
    Linux查看设置系统时区
    ORA-01950: no privileges on tablespace xxxx
    complex(x):创建一个复数
    python常用函数之--求绝对值函数:abs(x)
    python学习链接:
    requirejs学习博客址分享
  • 原文地址:https://www.cnblogs.com/riasky/p/3478581.html
Copyright © 2011-2022 走看看