I'm guessing you logged in as a normal user, then su to root, then installed mozilla, then tried to run.
Well, if you did, that is the problem. The normal user owns the X console and root doesn't have permission to access it.
To solve this, type
xhost +localhost
before you use su.
If this is a multiuser system, log out of X or type xhost -localhost when you are done.