I initially added part of this as a comment to Michael Karnerfors' excellent responseMichael Karnerfors' excellent response, but on further reflection, I think it's worth its own response.
The logical place for the computer room of a spaceship/starship is in the core of the vessel, due to its critical nature.
Such a ship is so dependent on its computers, that an issue (whether external or a malfunction) could be catastrophic to the ship and its crew.
This provides maximum physical protection to the computer.
Depending on the type of vessel, the crew may or may not be able to repair the computer or even have access to it.
On most civilian vessels, the computer would likely be sealed and would need to be repaired or pulled and replaced by qualified technicians while in port.
On a ship designed to be away from port for an extended period of time (i.e., exploratory or military), a drunk-but-brilliant teenager might be able to go into the computer core, replace the isolinear chip while the ship is under fire by the Romulans, and save the day...well, you know what I mean.
Conclusion: Unlikely to be an issue, because if the ship is this badly damaged, the crew is likely to be dead or dying anyway.
A ship designed to be away from its base for an extended period of time will likely have multiple, redundant computers located in different areas of the vessel and will also use a distributed network.
A quick Google search shows that many current NASA missions use dual- or triple-redundant computer systems.
This makes it statistically unlikely that a single event or malfunction would impact all computers.
Most likely such systems would also cross-check one another periodically to ensure that there are no malfunctions creating issues.
In an emergency, you can load the astrogation software on the galley computer and still be able to find your way home. Or make a chicken pot pie. Your choice.
Conclusion: Not an issue, because the crew can still get home or wait for rescue.
Computers aboard a spaceship/starship would likely be designed to be vacuum-tolerant, to guard against the possibility of loss of pressure.
This means they would have other means to dissipate heat, as Michael's postMichael's post noted.
Conclusion: Not an issue.
All this being said, you don't need to have a valid explanation for how you do this. If this is crucial to your plot, you just need a logical explanation for why this is an issue (i.e., organic or semi-organic computer core in a sealed environment). Then get on with your hand-waving and make it happen.