This is an issue that can stump a lot of people and is a frequent factor of roleplays failing. However, it is covered in
this guide which also includes other advice on making your RP successful.
In reference to your specific question, though, look at the section entitled
The Setting/Roleplay Introduction.
Hopefully, it will help you out with advice that will fit any genre of roleplay.
Of course, that talks about the Introduction page of a roleplay - the 'sales pitch' as it were. That needs to be short enough to keep your potential roleplayer's attention while giving enough information for them to make a decision. This is covered in the guide I linked you to.
However, once someone has made the decision to join, they have dedicated a more substantial amount of their time to your story. So, you can exposit further within the roleplay itself. This can be done in a number of ways.
You could information-dump in the first, introductory IC post - include everything that's needed throughout the roleplay. The best way to do this and keep it interesting is to make it a true IC post, introduce your character at the same time, but make sure all the information is conveyed. An example could be someone in a library, reading history books, or a grandfatherly figure telling old war stories. It could even be a chance to introduce NPCs that will appear throughout the roleplay. Essentially, it will be a piece of prose, and it's your job as a writer to make it interesting.
Alternatively, you could just set the initial scene and introduce your character, then reveal the history and whatnot as the story progresses and requires it. Of course, this presents problems as discussed earlier in the thread, so I won't repeat them. The positives, though, include adding some element of mystery to your RP, preventing meta-gaming, and giving you better control if somewhere down the line you decide to change something you had originally planned before you reveal it.
Or you could go for a mixture of the two. Use the introductory post to give enough exposition to allow other players to interact with the setting and initial plot realistically, then reveal further stuff as you go on.
Another possibility is ignoring the introductory IC post completely when thinking about exposition, and using the roleplay's OOC threads to create a wiki. This is especially useful if the world you are created is particularly in-depth, it also means you don't have to info dump (big or small) in the roleplay itself. On the flip side, it could result in a lot of reading, and you and your players would need to make sure that the IC thread itself still makes sense in the context of the story - other people may want to read the roleplay without needing to read a mini encyclopaedia.
Hopefully, that helps.