Is a mining program necessary for mining, or can bitcoind mine by itself?
The daemon can do mining using the -gen command line option, but it's CPU mining and is impractical nowadays.

Using a separate mining app is practical. That separate mining app connects to a running bitcoind via its JSON-RPC API in order to facilitate getwork or getblocktemplate requests necessary for hashing.

The JSON-RPC API is configured in bitcoin.conf or at the command line using these arguments:

-rpcuser=&lt;user&gt;        Username for JSON-RPC connections
-rpcpassword=&lt;pw&gt;      Password for JSON-RPC connections
-rpcport=&lt;port&gt;        Listen for JSON-RPC connections on &lt;port&gt; (default: 8332 or testnet: 18332)
-rpcallowip=&lt;ip&gt;       Allow JSON-RPC connections from specified IP address