首页 > 解决方案 > 将数据从 aprs 服务器传输到 symfony 数据库

问题描述

我想将 symfony 连接到“aprs-is”服务器。

我的数据由“aprs”服务器接收,我想将它们插入到我在 symfony 学说中创建的数据库中。我的实体已经准备好,但我不知道该怎么做。

我可以在“aprs”服务器上建立一个上行链接来重定向数据,但我不知道如何在双方构建所有链接。

这是aprs-is服务器架构的链接:http: //he.fi/aprsc/

关于 aprs 上行链路的信息:$ sudo netstat -anp|grep aprsc

tcp        0      0 192.168.5.56:50002      0.0.0.0:*               LISTEN      21864/aprsc         
tcp        0      0 127.0.0.1:10151         0.0.0.0:*               LISTEN      21864/aprsc         
tcp        0      0 127.0.0.1:10151         127.0.0.1:46962         ESTABLISHED 21864/aprsc         
tcp        0      0 192.168.5.56:50002      192.168.5.54:34070      ESTABLISHED 21864/aprsc         
tcp6       0      0 :::50002                :::*                    LISTEN      21864/aprsc         
unix  3      [ ]         STREAM     CONNECTE      865809   21864/aprsc          
unix  3      [ ]         STREAM     CONNECTE      864810   21864/aprsc          
unix  3      [ ]         STREAM     CONNECTE      864811   21864/aprsc     

关于 apache 监听器的信息
$ sudo netstat -anp|grep apache2

tcp6       0      0 :::10150                :::*                    LISTEN      21582/apache2

aprs上的日志连接:

2018/07/31 14:32:49.091674 aprsc[21864:7f5c008b1700] INFO: HTTP thread ready.
2018/07/31 14:32:49.091682 aprsc[21864:7f5bfd55f700] INFO: Uplink: 1 uplinks configured, 0 are connected, need to pick new
2018/07/31 14:32:49.091688 aprsc[21864:7f5bfd55f700] DEBUG: Uplink: trying Http (127.0.0.1:10150)
2018/07/31 14:32:49.091755 aprsc[21864:7f5bfd55f700] INFO: Uplink Http: Connecting to 127.0.0.1:10150 (127.0.0.1:10150) [link 0, addr 1/1]
2018/07/31 14:32:49.091832 aprsc[21864:7f5bfd55f700] DEBUG: Uplink Http: poll after connect returned 1, revents 4
2018/07/31 14:32:49.091840 aprsc[21864:7f5bfd55f700] DEBUG: Uplink Http: successful connect
2018/07/31 14:32:49.091858 aprsc[21864:7f5bfd55f700] INFO: Uplink Http: 127.0.0.1:10150: Connection established on fd 13 using source address 127.0.0.1:58630
2018/07/31 14:32:49.091865 aprsc[21864:7f5bfd55f700] DEBUG: pass_client_to_worker: client on fd 13 to thread 0 with 0 users
2018/07/31 14:32:49.091870 aprsc[21864:7f5bfd55f700] INFO: status: setting error flag no_uplink ttl 3600
2018/07/31 14:32:49.121688 aprsc[21864:7f5c00890700] DEBUG: collect_new_clients(worker 0): closing all existing peergroup peers
2018/07/31 14:32:49.121776 aprsc[21864:7f5c00890700] DEBUG: collect_new_clients(worker 0): added fd 13 to polling list, xfd 0x7f5c00a02000    
2018/07/31 14:32:49.121795 aprsc[21864:7f5c00890700] DEBUG: Worker 0 accepted 1 new clients, 1 new connections, now total 1 clients
2018/07/31 14:32:50.989005 aprsc[21864:7f5c00890700] INFO: 127.0.0.1:10150: Uplink server software: HTTP/1.1 400 Bad Request
2018/07/31 14:32:50.989070 aprsc[21864:7f5c00890700] ERROR: 127.0.0.1:10150: Uplink's welcome message is not recognized: no # in beginning
2018/07/31 14:32:50.989098 aprsc[21864:7f5c00890700] INFO: Uplink TCP 127.0.0.1:10150 (Http) closed after 2 s: Uplink server protocol error, tx/rx 70/483 bytes 0/0 pkts, dropped 0, fd 13, worker 0
2018/07/31 14:32:50.989228 aprsc[21864:7f5c00890700] INFO: 127.0.0.1:10150: Uplink [0] has been closed: Uplink server protocol error
2018/07/31 14:32:50.989255 aprsc[21864:7f5c00890700] DEBUG: found the link to disconnect    
2018/07/31 14:32:53.096709 aprsc[21864:7f5bfd55f700] INFO: Uplink: 1 uplinks configured, 0 are connected, need to pick new
2018/07/31 14:32:53.096795 aprsc[21864:7f5bfd55f700] DEBUG: Uplink: trying Http (127.0.0.1:10150)
2018/07/31 14:32:53.096970 aprsc[21864:7f5bfd55f700] INFO: Uplink Http: Connecting to 127.0.0.1:10150 (127.0.0.1:10150) [link 0, addr 1/1]
2018/07/31 14:32:53.097139 aprsc[21864:7f5bfd55f700] DEBUG: Uplink Http: poll after connect returned 1, revents 4
2018/07/31 14:32:53.097177 aprsc[21864:7f5bfd55f700] DEBUG: Uplink Http: successful connect
2018/07/31 14:32:53.097275 aprsc[21864:7f5bfd55f700] INFO: Uplink Http: 127.0.0.1:10150: Connection established on fd 13 using source address 127.0.0.1:58632
2018/07/31 14:32:53.097305 aprsc[21864:7f5bfd55f700] DEBUG: pass_client_to_worker: client on fd 13 to thread 0 with 0 users
2018/07/31 14:32:53.097324 aprsc[21864:7f5bfd55f700] INFO: status: setting error flag no_uplink ttl 3600
2018/07/31 14:32:53.126840 aprsc[21864:7f5c00890700] DEBUG: collect_new_clients(worker 0): added fd 13 to polling list, xfd 0x7f5c00a02030
2018/07/31 14:32:53.126950 aprsc[21864:7f5c00890700] DEBUG: Worker 0 accepted 1 new clients, 1 new connections, now total 1 clients
2018/07/31 14:32:53.663743 aprsc[21864:7f5c008b1700] DEBUG: http status [127.0.0.1] request /status.json
2018/07/31 14:32:53.664754 aprsc[21864:7f5c008b1700] DEBUG: http_compress_gzip: compressed 7656 bytes to 1743 bytes: 22.8 %
2018/07/31 14:32:54.994428 aprsc[21864:7f5c00890700] INFO: 127.0.0.1:10150: Uplink server software: HTTP/1.1 400 Bad Request

$ sudo service aprsc 状态 ● aprsc.service - LSB:启动和停止 aprsc

已加载:已加载(/etc/init.d/aprsc;已生成;供应商预设:已启用)

Active: active (running) since Tue 2018-07-31 16:32:48 CEST; 20min ago
Docs: man:systemd-sysv-generator(8)
Process: 21831 ExecStop=/etc/init.d/aprsc stop (code=exited, status=0/SUCCESS)
Process: 21844 ExecStart=/etc/init.d/aprsc start (code=exited, status=0/SUCCESS)
Tasks: 8 (limit: 4915)
CGroup: /system.slice/aprsc.service
       └─21864 /opt/aprsc/sbin/aprsc -u aprsc -t /opt/aprsc -f test -e             debug -o file -r logs -c /etc/aprsc.conf

systemd[1]: Starting LSB: start and stop aprsc...
aprsc[21844]:  * Preparing chroot for APRS-IS server: aprsc chroot
aprsc[21844]:    ...done.
aprsc[21844]:  *   Checking configuration 'aprsc'
aprsc[21844]:  * Starting APRS-IS server: aprsc
aprsc[21844]:  *   Starting 'aprsc'
aprsc[21844]:    ...done.
systemd[1]: Started LSB: start and stop aprsc.

标签: phpsymfony

解决方案


我在这个问题上取得了一些进展:

发生的事情是从 apache 发送到 aprs 的格式,因为响应被 aprs 错误地解释了。apache 服务器发送一个带有在 apache2.conf 中配置的标头的响应:ServerTokens 将返回 HTTP/1.1 以及之后的 apache 版本(详细取决于 Servertoken 旁边的选项)

但我不知道如何通过“#APRS”更改值“HTTP/1.1”

我试图在 mod_header.c 中更改它,但我发现的唯一文件是 mod_header.so ...


推荐阅读