Rabat is in Africa .
Once a reputed corsair haven , Rabat served as one of the many ports in North Africa for the Barbary pirates , who were particularly active from the 16th through the 18th centuries .
Rabat