I had a virus a couple of weeks ago. I have had a cough ever since. I am coughing up a lot of mucous. What is this?

Sinusitis/asthma. A cough that persists following a viral URI may be a symptom of a bacterial sinus infection. Sometimes a condition like asthma can also occur causing a cough. See your primary care doctor for an exam and possibly a course of antibiotics.
Possibilities... Sometimes after a viral bronchitis, bronchospasm develops leading to a cough. Treatment for this would include bronchodilator and steroid inhalers. Other possibilities include post-nasal drip, gerd, or a combination of factors. If you smoke, you need to quit to decrease airway inflammation. See your doctor for diagnosis and treatment especially if the cough is not improving.