I do not know where to start.
You need a notion of an overall program design, and, as @karim79 pointed out, an understanding of socket programming APIs for your chosen language.
Can I just adjust Apache for listening UDP requests?
Do you mean the Apache httpd
? The short answer is "no."
Use something like PEAR's System_Daemon
instead.
The long answer is "yes, that is possible." Particularly with modular plugins exposing the httpd
's internals, you can do Just About Anything You Want (tm) (see, for instance, mod_perl
). You could beat httpd
into a sort of application server for a long-running (set of?) PHP process(es) which are not themselves intrinsically HTTP-driven.
The better answer of the two is, again, "no." :)