I am trying to make a program (well more like two programs that work together) A. The server(host): which is connected to the Apache server and sends commands to it and B. The Client(client): which is also connected but cant send commands only receive them.
Example:
 If I typed in the server(host). Log time it would send that command to the apache server and the client would grab the time and send me back the details to the (host). 
Example 2: 
 If I typed start keylogger -t 2000 (-t is time and 2000 is every 2000 mseconds) in the server(host) it would start the built in keylogger and start sending logged info every 2000 mseconds. 
 If I typed 
I am not a first time programmer. I write usually in c#/ ruby. Python is my first language so I understand what you have for me just I have never really used Apache before. Any help would be very appreciated!
Here is how I would take the approach based on what you just asked.
Server:

Apache + mod_wsgi for front-end web server (allows for using flask or django); there's not much here, it's a pretty easy configuration.
I would use Django for the web framework.

Client:

Client would poll the server at some kind of interval (1 minute, 10 minutes, etc.); upon poll the client would receive commands that it would then execute from the server.
I'm not sure if there is a keylogging module in python; if there isn't one I'd have to write one for each of the OS's I intended for the client to be on in C.

I'm going with pull requests because firewalls rarely do egress filtering; they will always do inbound filtering virtually by default and therefore the way you asked how to set this is up initially will not work. This is actually how most botnets work (take a look at Chrome for example).
Python/ Apache Help needed