Q:

How to change the output redirection of a running process?

I know how to redirect output and how to suppress them in bash. Now, suppose I accidentally forgot to append the output redirection part to the command (e.g. 2>&1 or > /tmp/mystdout) and my background process is already running for a while, can I still change to where stdout and stderr are being written to? I really would like not to kill and restart the application.
To be more specific as asked by Gilles in his comment, I would like to fiddle with it in these scenarios in specific:

wrong output file
forgot to redirect stderr to stdout

or a combination of both
E.g. I have Apache running and I can see the file descriptors:
/proc/8019/fd/0 -> /dev/null
/proc/8019/fd/1 -> /dev/null
/proc/8019/fd/2 -> /var/log/apache2/error.log

A:

You can do it using reredirect (https://github.com/jerome-pouiller/reredirect/). 
reredirect -m /dev/null <PID>

You can restore initial output of your process later using something like:
reredirect -N -O <M> -E <N> <PID>

(<M> and <N> are provided by previous launch of reredirect).
reredirect README also explains how to redirect to another command or to redirect only stdout or stderr.

A:

That's not possible. Or at least not easy. You might have some luck attaching gdb to the process and fiddling with it in gdb, but that can lead to crashes just as easily as success.

A:

You should use reptyr to attach another process to your new current terminal.
For example: install and use GNU's screen utility, and in it launch the reptyr command to "fetch" the other process's redirections (and controlling terminal) and attach them to the new current terminal (the screen process, if you launched reptyr from screen). The advantage of doing this from a screen session is that, once under screen, it will then be easy to disconnect and reconnect to it (for example, closing your local session, going home, and reopening it).

