Refer to here. It has all commands and what they do, and what settings you set.
To make a header, use a program like XWE. Create a lump named MAINCFG in your WAD file, and fill it with the information given by the example, suited to fit your needs (replace the name with the name of your level...