I've got a Gps navigation unit that may send data on the TCP connection, however i don't be capable of customize the message it transmits therefore it will come to my server as an HTTP request - it may only send a note inside a predefined format.

So, I've the next questions:

1) Can you really have Apache handle a TCP connection that does not come as an HTTP request, and also have the message that's sent be processed with a PHP script?

2) If #1 is not possible, how does one recommend I handle the information being delivered to my server?

I'll potentially have 100s, otherwise 1000's, of those Gps navigation models delivering data to my server and so i need a competent method to handle all the connections arriving (and that's why I needed Apache as well as other production worthy server to handle TCP connections). I must have the ability to cope with the content sent within the reference to PHP since that's exactly what the relaxation of my application operates on, and that i will have to place the information sent right into a database (and PHP is actually proficient at doing that type of factor).

Just in case it matters, the Gps navigation unit can send data on the UDP connection, but from things i read Apache does not use UDP connections.

Any suggestions could be welcome.

To reply to the questions you have:

1) Not without major modification

2) Construct your own server. This really is easily completed with several platforms as well as in several languages. Personally, i prefer to make use of the Twisted Framework because Python is comparatively easy to use and also the framework is extremely flexible.

Using Apache would not be practical as it is utilizing a nuclear explosive device whenever a firecracker will suffice. Developing a PHP server is very simple on Linux by using xinetd.

Modify /etc/services. Say you would like your merchandise to operate on port 456789. In /etc/services, add the road:

gpsservice   456789/tcp

In /etc/xinet.d/, produce a file named gpsservice:

service gpsservice 
{
    socket_type             = stream
    protocol                = tcp
    wait                    = no
    user                    = yourusername
    server                  = /path/to/your/script
    log_on_success          = HOST PID
    disable                 = no
}

Make your PHP script (chmod so that it is executable):

#!/usr/bin/php
<?php
// do stuff
?>

Restart xinetd service xinetd restart

You have a fast TCP server designed in PHP.