It is a good solution to integrate Liferay with Alfresco and OpenX.
Liferay: As the world's leading open source portal platform, Liferay provides a unified web interface to data and tools scattered across many sources.
Alfresco: the Open Source Alternative for Enterprise Content Management (ECM), providing Document Management, Collaboration, Records Management, Knowledge Management, Web Content Management and Imaging.
OpenX: The free, open source ad server trusted by more than 30,000 web publishers in over 100 countries around the world. OpenX is a powerful ad serving solution that puts control over online advertising back in the hands of publishers.