Pros and cons of setting Virtual host in liferayPros and cons of setting Virtual host in liferayhttps://liferay.dev/en/c/message_boards/find_thread?p_l_id=119785333&threadId=258788342024-03-29T06:18:04Z2024-03-29T06:18:04ZRE: Pros and cons of setting Virtual host in liferayDonald Stephenhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1178815672019-11-23T07:38:36Z2019-11-23T07:38:36Z<div class="quote-title">Achmed Tyrannus Albab:</div><blockquote><br /><div class="quote-title">David H Nebinger:</div><blockquote><br />With VHosts, you're saying the site is externally known as liferaytest1.com, and no other url. So when you're on a site tied to liferaytest2.com and you pick a site for liferaytest1.com, well then your URL is going to change.<br /><br />If you want both liferaytest1.com and liferaytest2.com to stick, remove the virtual host mappings and just let both names resolve to the same server. Liferay will not try to change the URLs, so if you come in via liferaytest2.com, then you'll stay there.</blockquote><br />I am using liferay 7.1, my intention is almost if not the same.<br />I have <a href="http://www.abc.com">www.abc.com</a>/<a href="https://www.mykfcexperience.onl/">MyKFC</a> and admin.abc.com , i want both to point to the same liferay. <br />I have already disabled (by removing) the virtual host in CMS at Site>Configuration>Site Settings>General Tab>Removed earlier set url which was <a href="http://www.abc.com">www.abc.com</a> . Still if i go to admin.abc.com the url will change back to <a href="http://www.abc.com">www.abc.com</a> .<br /><br />Is there anymore setting that i need to change to allow this? Earlier i tried also adding <Alias> in the server.xml of tomcat but to no avail and since removed it. Also if it means anything I have also left the web.server.host= in portal-ext.properties as blank.<br />Any help would be great. Thanks in advance.<br />--------------------------------------------------------------------------------------Found my solution.<br />Yes the virtual host needs to be left empty.<br />My culprit was the proxyName="" in the Connector segment of the server.xml.<br />Removed it and now it works...and of course with the trailing /web/guest/ ... oh well.</blockquote><br /> You can always go to URL <em>www.liferaytest1.com/web/liferaytest2site/page</em> to get to Liferaytest2 site, but it is generally not recommended (you should use Virtual Host URLs and most Liferay-generated links will use them). If there is a problem that users have to log twice (for each domain separately), you should install some SSO solution like CAS, NTLM etc.Donald Stephen2019-11-23T07:38:36ZRE: Pros and cons of setting Virtual host in liferayAchmed Tyrannus Albabhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1178222762019-11-19T03:27:41Z2019-11-19T03:27:41Z<div class="quote-title">David H Nebinger:</div><blockquote><br />With VHosts, you're saying the site is externally known as liferaytest1.com, and no other url. So when you're on a site tied to liferaytest2.com and you pick a site for liferaytest1.com, well then your URL is going to change.<br /><br />If you want both liferaytest1.com and liferaytest2.com to stick, remove the virtual host mappings and just let both names resolve to the same server. Liferay will not try to change the URLs, so if you come in via liferaytest2.com, then you'll stay there.</blockquote><br />I am using liferay 7.1, my intention is almost if not the same.<br />I have <a href="http://www.abc.com">www.abc.com</a> and admin.abc.com , i want both to point to the same liferay. <br />I have already disabled (by removing) the virtual host in CMS at Site>Configuration>Site Settings>General Tab>Removed earlier set url which was <a href="http://www.abc.com">www.abc.com</a> . Still if i go to admin.abc.com the url will change back to <a href="http://www.abc.com">www.abc.com</a> .<br /><br />Is there anymore setting that i need to change to allow this? Earlier i tried also adding <Alias> in the server.xml of tomcat but to no avail and since removed it. Also if it means anything I have also left the web.server.host= in portal-ext.properties as blank.<br />Any help would be great. Thanks in advance.<br />--------------------------------------------------------------------------------------Found my solution.<br />Yes the virtual host needs to be left empty.<br />My culprit was the proxyName="" in the Connector segment of the server.xml.<br />Removed it and now it works...and of course with the trailing /web/guest/ ... oh well.Achmed Tyrannus Albab2019-11-19T03:27:41ZRE: Pros and cons of setting Virtual host in liferayDavid H Nebingerhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=384064512014-06-01T14:33:25Z2014-06-01T14:33:25ZWith VHosts, you're saying the site is externally known as liferaytest1.com, and no other url. So when you're on a site tied to liferaytest2.com and you pick a site for liferaytest1.com, well then your URL is going to change.<br /><br />If you want both liferaytest1.com and liferaytest2.com to stick, remove the virtual host mappings and just let both names resolve to the same server. Liferay will not try to change the URLs, so if you come in via liferaytest2.com, then you'll stay there.David H Nebinger2014-06-01T14:33:25ZRE: Pros and cons of setting Virtual host in liferayKrzysztof Gołębiowskihttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=384017872014-06-01T12:12:46Z2014-06-01T12:12:46ZI think this is how it works in Liferay and cannot be changed. You can always go to URL <em>www.liferaytest1.com/web/liferaytest2site/page</em> to get to Liferaytest2 site, but it is generally not recommended (you should use Virtual Host URLs and most Liferay-generated links will use them). If there is a problem that users have to log twice (for each domain separately), you should install some SSO solution like CAS, NTLM etc.<br /><br />Regards,<br />KGKrzysztof Gołębiowski2014-06-01T12:12:46ZRE: Pros and cons of setting Virtual host in liferayHamish Campbellhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=383795932014-05-30T22:27:32Z2014-05-30T22:27:32Zsame question (BUMP)Hamish Campbell2014-05-30T22:27:32ZPros and cons of setting Virtual host in liferaySuyash Bhalekarhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=258788332013-06-24T09:06:54Z2013-06-24T09:06:54ZI am using multiple domains to access liferay portal instance.<br /><br />For example following are the domains mapped in <strong>hosts file of windows:</strong><br /><br /><strong>www.liferaytest1.com<br />www.liferaytest2.com</strong><br /><br />and in <strong>Liferay's Control Panel → Portal Settings, www.liferaytest1.com is set as virtual host.</strong><br /><br />I can access portal instance with all above mention domains along with localhost.<br /><br />When I access portal with www.liferaytest1.com then I can access Guest site pages directly. Say, home is a page in Guest site then instead of accessing with www.liferatest1.com/web/guest/home I can access it directly with www.liferaytest1.com/home<br /><br />So URL is shortened to some extend.<br />So far so good.<br /><br />First Concern<br /><br />Now when I try to<strong> access portal via www.liferaytest2.com</strong> and when I click any sites listed in My Sites portlet of Liferay, it redirects me to that site with the<strong> domain mentioned in virtual host i.e. www.liferaytest1.com instead of retaining www.liferaytest2.com.</strong><br /><br />Suppose I have a Site named Help, so when I click on help site link in My Sites portlet then instead of staying with www.liferaytest2.com domain it redirects me with www.liferaytest1.com domain.<br /><br />This is due to virtual host mapping done in liferay.<br /><br />Second Concern<br /><br />When I am <strong>accessing the portal with www.liferaytest2.com and subscribe to any of the Assets</strong> then the links in email contain the<strong> virtual host domain i.e www.liferaytest1.com</strong>.<br /><br />How to overcome above mention issues?<br /><br />My requiremen