Facebook has been blocked in the Libyan capital of Tripoli and other cities, residents said on Monday as fighting between rival groups raged.