Legacy Knowledge Base
Published Jun. 30, 2025

Access multiple sites using the different domain name

Written By

Kartik Singh

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • Run multiple Sites on a single instance using the different domain names

    • Example: Site 1 running on the 'www.test.com:8080' domain and Site 2 running on the 'www.demo.com:8080' domain.

Environment

  • Liferay DXP [all versions]

Resolution

  1. Modify the hostname, navigate to the "/etc/hosts" file, add the "www.test.com" and "www.demo.com" domain names with the 'localhost IP', and save it.
  2. After, adding the domain name to the host file, start the Liferay server.
  3. Navigate to the Control Panel-> System-> Virtual Instances and click on the '+' icon to create a new Virtual Instance, fill in all the fields, and save it.
  4. After the Virtual Instance is created, navigate to  Control Panel-> Sites, create new sites with the name "Site1" and save it. The page redirects to the "Site Settings", navigate to Platform-> Site Configuration-> SITE SCOPE-> Site URL, and set the 'Virtual Host' to "www.test.com" and save it.
  5. For "Site2" follow the 4th point again, set the 'Virtual Host' to "www.demo.com" and save it.
  6. Now after all the changes are done, open the browser's new tab hit "www.test.com:8080" URL, and 'Site1' is opened. For "Site2" hit the "www.game.com:8080" URL, and "Site2" is open.

Additional Information

Did this article resolve your issue ?

Legacy Knowledge Base