Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Virtual Host doesnt work with RenderURL
Hello Friends,
I have done a setup of Liferay on my system. Trying to use Apache web server with firewall. Everything works fine but in portlets when I am using renderURL it shows internal liferay url for the links.
Suppose I have apache on rkg.test and Liferay on liferay.rkg.test:8080. So when I use renderURL in portlets it shows me liferay.rkg.test:8080 in place of rkg.test. I have set virtual host in the settings as rkg.test but its not working. Though for some links I am getting it right if I am using simple links in place of renderURL.
Please help.
thanks in advance.
Ravi KGupta
I have done a setup of Liferay on my system. Trying to use Apache web server with firewall. Everything works fine but in portlets when I am using renderURL it shows internal liferay url for the links.
Suppose I have apache on rkg.test and Liferay on liferay.rkg.test:8080. So when I use renderURL in portlets it shows me liferay.rkg.test:8080 in place of rkg.test. I have set virtual host in the settings as rkg.test but its not working. Though for some links I am getting it right if I am using simple links in place of renderURL.
Please help.
thanks in advance.
Ravi KGupta
Solved 
Just need to add
web.server.http.port=80
web.server.host=rkg.test
Reference is Portal.properties
##
## Web Server
##
#
# Set the HTTP and HTTPs ports when running the portal in a J2EE server that
# is sitting behind another web server like Apache. Set the values to -1 if
# the portal is not running behind another web server like Apache.
#
web.server.http.port=-1
web.server.https.port=-1
#
# Set the hostname that will be used when the portlet generates URLs.
# Leaving this blank will mean the host is derived from the servlet
# container.
#
web.server.host=
#
# Set the preferred protocol.
#
#web.server.protocol=https
#
# Set this to true to display the server name at the bottom of every page.
# This is useful when testing clustering configurations so that you can know
# which node you are accessing.
#
web.server.display.node=false
Just need to add
web.server.http.port=80
web.server.host=rkg.test
Reference is Portal.properties
##
## Web Server
##
#
# Set the HTTP and HTTPs ports when running the portal in a J2EE server that
# is sitting behind another web server like Apache. Set the values to -1 if
# the portal is not running behind another web server like Apache.
#
web.server.http.port=-1
web.server.https.port=-1
#
# Set the hostname that will be used when the portlet generates URLs.
# Leaving this blank will mean the host is derived from the servlet
# container.
#
web.server.host=
#
# Set the preferred protocol.
#
#web.server.protocol=https
#
# Set this to true to display the server name at the bottom of every page.
# This is useful when testing clustering configurations so that you can know
# which node you are accessing.
#
web.server.display.node=false
The settings of these properties in portal-ext.properties fix one redirect issue but create another one. Please see the details in http://issues.liferay.com/browse/LPS-14670.
Community
Company
Feedback