- Public Domain
- GPL
- LGPL
- BSD
- MPL
Be careful with these licenses here. In particular, the MPL is not compatible with the GPL. Now, many (probably most) pieces of MPL licensed software are distributed under a dual license, in which you may choose to use and distribute the software under the terms of the MPL or under the terms of the GPL (or sometimes LGPL). But in that case, you shouldn't list the MPL in the list of licenses you are distributing software under, because in order to link to software released under the GPL, you must be using the GPL (or LGPL) option of the dual-license.
- Am I allowed to sell a compiled version of this software which links to all these components?
Yes (and the other licenses don't affect this, either).
- What is this is installed on a server (being a service) does this make any difference?
If you are selling a service, in which you only run the software on your own computers and don't distribute the software to anyone outside of your company or organization, then none of these licenses impose any significant restrictions on what you may do. In particular, the GPL and LGPL do not require you to provide source code to anyone else in these cases.
If you are using a lot of third party software, it's still generally a good idea to contribute your patches back to the upstream project. Diverging from the upstream can cause a lot of problems in the future when you try to upgrade, and contributing code upstream will mean you get more people who are familiar with the projects you are modifying to review your code, which can help improve its quality.
- What if I modify the code, must I tell the world what did I do?
If you distribute the software to anyone outside of your company or organization, then you must provide them with the source code, or provide them with a written offer to provide the source code at a later date, for no more than the cost of physically transferring the data to them.
If you do not distribute the software, then none of the licenses above impose any significant restrictions on you. The GNU Affero GPL, or AGPL, is the only license I know of that imposes significant restrictions on people who run software as a network service, and as you did not list that license in your question, I don't think it's something you need to be concerned about.
Note that I am answering these questions from the point of view of the GPL, which is the most restrictive license that you list. Effectively, when you link several pieces of software with these licenses together, you can consider the whole to be licensed under the terms of the GPL (except for the MPL, which as I've mentioned, is incompatible). See the following slide for a visual depiction of compatibility between common licenses: