Apache implements the HTTP protocol. If your application speaks HTTP, you can talk to APACHE. On the server side, Apache can forward the message to a CGI (in Python, Perl, etc.) or to a language (server side), such as PHP or ASP. In CGI, PHP, ASP, etc, you take the message and write it in Mysql.
If you really just want to send a message to an IP and a port, without having to use the HTTP protocol, the easiest is to write a server in Python, Perl or Node.js. I would recommend writing a server in Node.js, because it gets very, very good performances, since it is asynchronous.
For example, creating a server in Node.js is as simple as creating a server in Node.js:
require('net').createServer(function (socket) {
socket.on('data', function (data) {
console.log(data.toString());
});
}).listen(7777);
Running the program with node servidor.js
, This server does not write the message in Mysql (to have only 5 lines). Write only in the console what you receive.
A customer can connect and send the message. Example of a client (also in Javascript):
var s = require('net').Socket();
s.connect(7777, 'localhost');
s.write('Oi!\n');
s.on('data', function(d){
console.log(d.toString());
});
s.end();
Native Apache don’t do that. It seems to be the case of specific application for the purpose, via sockets (unless you modify the device to make HTTP requests).
– Bacco