Foros de discusión

RE: http:/..../group/control_panel/null error in links

thumbnail
Hennie de Villiers, modificado hace 13 años.

http:/..../group/control_panel/null error in links

Junior Member Mensajes: 78 Fecha de incorporación: 1/04/09 Mensajes recientes
6.0.1. was installed using a server instance hosted by a java SP, previously used for 5.2.3.

Accessing the new install renders the following issue.

If localhost is used as Virtual Server for the root portal, then links in the control panel such as "Back to Guest" resolves to by example http://locahost/home i.e. results in page not found.

If mydomain.com is used as Virtual Server then the link resolves to http://mydomain.com/home but delivers an error when returning the guest page i.e. The requested resource was not found. http://mydomain.com/group/control_panel/null and links such as Add a team fails to respond.

It seems for issue LPS-7948 that this may possibly be related to configuration but on the other hand it worked fine in 5.2.3.

Looking at LPS-5299 it seems that the same parameter "permissionsURL" is affected.

Is there any correlation between the two and is the problem experienced possibly a bug or a server configuration error?

If a server config error, how can this be resolved
thumbnail
Zsolt Balogh, modificado hace 13 años.

RE: http:/..../group/control_panel/null error in links (Respuesta)

Expert Mensajes: 463 Fecha de incorporación: 23/03/09 Mensajes recientes
Hi,

This is a security setting, you need to set the redirect.url.* properties in your portal-ext.properties to make this work. Here's the snippet from the portal.properties:

##
## Redirect
##

    #
    # Set this property to "ip" or "domain" for the redirect security method. If
    # set to "domain", the portal will only redirect users to domains listed in
    # the property "redirect.url.domain.allowed". If set to "ip", the portal
    # will only redirect to domains whose IP address resolve to an IP address
    # listed in the property "redirect.url.ip.allowed".
    #
    #redirect.url.security.mode=domain
    redirect.url.security.mode=ip

    #
    # Input a list of comma delimited domains which the portal is allowed to
    # redirect to. Input a blank list to allow any domain.
    #
    redirect.url.domains.allowed=

    #
    # Input a list of comma delimited IPs which the portal is allowed to
    # redirect to. Input a blank list to allow any IP. SERVER_IP will be
    # replaced with the IP of the host server.
    #
    redirect.url.ips.allowed=127.0.0.1,SERVER_IP


You'll need to add the ip of the mydomain.com to the redirect.url.ips.allowed list or switch it to domain mode.

Zsolt
thumbnail
Hennie de Villiers, modificado hace 13 años.

RE: http:/..../group/control_panel/null error in links

Junior Member Mensajes: 78 Fecha de incorporación: 1/04/09 Mensajes recientes
Thanks for the input... Much appreciated...
David Tompos, modificado hace 13 años.

RE: http:/..../group/control_panel/null error in links

New Member Mensaje: 1 Fecha de incorporación: 20/03/10 Mensajes recientes
I installed 6.0.1 and I am getting the same error. I have made the redirect changes and still have the same problem.


I get this if I click on "add catagory" or "post new thread" in the message board application:

Status Not Found
The requested resource was not found.
http://10.0.2.19:8080/null

Can anyone offer some help? Thanks.
thumbnail
Jorge Ferrer, modificado hace 13 años.

RE: http:/..../group/control_panel/null error in links

Liferay Legend Mensajes: 2871 Fecha de incorporación: 31/08/06 Mensajes recientes
Hi David,

Did you apply the solution explained by Zsolt?
thumbnail
Anton Klein, modificado hace 13 años.

RE: http:/..../group/control_panel/null error in links

New Member Mensaje: 1 Fecha de incorporación: 13/07/10 Mensajes recientes
Hi,

I have the same problem, but not in control panel.

My freshly installed Liferay 6.0.2 with default data (no 7cogs) generates wrong urls on "add event" button in Calendar Portlet and in Forum Portlet on "Add Category" button. Redirection settings in portal-ext.properties didn't work.

Best regards, Anton
thumbnail
Jorge Ferrer, modificado hace 13 años.

RE: http:/..../group/control_panel/null error in links

Liferay Legend Mensajes: 2871 Fecha de incorporación: 31/08/06 Mensajes recientes
Hi Anton,

Did you also set up the property redirect.url.ips.allowed ? That's the most important one.
thumbnail
Pekka Järveläinen, modificado hace 13 años.

RE: http:/..../group/control_panel/null error in links

New Member Mensajes: 5 Fecha de incorporación: 19/07/10 Mensajes recientes
In my case it's only a old browser window requesting URL no more exist. Closing the window solves the problem. http://www.liferay.com/community/forums/-/message_boards/message/5368163
thumbnail
Jignesh Thakkar, modificado hace 13 años.

RE: http:/..../group/control_panel/null error in links

Junior Member Mensajes: 26 Fecha de incorporación: 10/05/10 Mensajes recientes
I found the same issue and I got successed to resolve this issue.

For resolving this issue you have to set 3 properties in your portal-ext.properties file.

redirect.url.security.mode=ip
redirect.url.domains.allowed=
redirect.url.ips.allowed=127.0.0.1,SERVER_IP.

You can set your ip address instead of SERVER_IP by comma seprated.

Then after starting your liferay server you have to do some settings.

Here I mention the steps to do setting. just follow this.

1) Login as Admin
2) Go to setting -> Control Panel
3) set the virtual host name (like 192.168.100.113 or abc.xyz.com) and then save it.

And you found that you got the solution.
thumbnail
Mani kandan, modificado hace 12 años.

RE: http:/..../group/control_panel/null error in links

Expert Mensajes: 492 Fecha de incorporación: 15/09/10 Mensajes recientes
Jignesh Thakkar:
I found the same issue and I got successed to resolve this issue.

For resolving this issue you have to set 3 properties in your portal-ext.properties file.

redirect.url.security.mode=ip
redirect.url.domains.allowed=
redirect.url.ips.allowed=127.0.0.1,SERVER_IP.

You can set your ip address instead of SERVER_IP by comma seprated.

Then after starting your liferay server you have to do some settings.

Here I mention the steps to do setting. just follow this.

1) Login as Admin
2) Go to setting -> Control Panel
3) set the virtual host name (like 192.168.100.113 or abc.xyz.com) and then save it.

And you found that you got the solution.


Nice steps I followed its working fine
thumbnail
Cid Miranda, modificado hace 12 años.

RE: http:/..../group/control_panel/null error in links

New Member Mensaje: 1 Fecha de incorporación: 28/09/11 Mensajes recientes
Jignesh Thakkar:
I found the same issue and I got successed to resolve this issue.

For resolving this issue you have to set 3 properties in your portal-ext.properties file.

redirect.url.security.mode=ip
redirect.url.domains.allowed=
redirect.url.ips.allowed=127.0.0.1,SERVER_IP.

You can set your ip address instead of SERVER_IP by comma seprated.

Then after starting your liferay server you have to do some settings.

Here I mention the steps to do setting. just follow this.

1) Login as Admin
2) Go to setting -> Control Panel
3) set the virtual host name (like 192.168.100.113 or abc.xyz.com) and then save it.

And you found that you got the solution.



Works fine!
thumbnail
Tobias S. Käfer, modificado hace 13 años.

RE: http:/..../group/control_panel/null error in links

Regular Member Mensajes: 128 Fecha de incorporación: 28/03/08 Mensajes recientes
I stumbled about that thing.
I think there is a problem for resolving the right IP for "SERVER_IP".

The "SERVER_IP" thing is resolved in the constructor of the PortalImpl class:
....
        _computerName = System.getProperty("env.COMPUTERNAME");

        if (Validator.isNull(_computerName)) {
            _computerName = System.getProperty("env.HOST");
        }

        if (Validator.isNull(_computerName)) {
            _computerName = System.getProperty("env.HOSTNAME");
        }

        if (Validator.isNull(_computerName)) {
            try {
                _computerName = InetAddress.getLocalHost().getHostName();
            }
            catch (UnknownHostException uhe) {
            }
        }

        try {
            _computerAddress = InetAddress.getByName(
                _computerName).getHostAddress();
        }
....


On my system this resolves the IP for "myhost", which is 127.0.0.1. Because this is the normal setting of a linux system in the /etc/hosts file:
127.0.0.1       localhost myhost

Therefore the SERVER_IP is resolved as "127.0.0.1".

But when a user accesses the portal by "myhost.mydomain.com", the comparison of the IP for "myhost.mydomain.com" (eg. 192.168.0.20) and SERVER_IP (127.0.0.1) is false.

So the method escapeRedirect of the PortalImpl class returns "null".

I don't know what a proper solution is.
Here are some possible solutions that I can think of:
  • You have to remove "myhost" from "/etc/hosts"
  • You have to add the official IP of the server to redirect.url.ips.allowed. But if you run your portal behind a firewall which forwards a official IP to something private (10.0.0.0, 192.168.0.0 etc.) adding the server IP (which might be something like this 10.10.6.5) does not solve this. You also have to add the IP that is used to access the portal from the internet.
  • You set "env.COMPUTERNAME", "env.HOST" or "env.HOSTNAME" to "myhost.mydomain.com".
thumbnail
Ray Augé, modificado hace 13 años.

RE: http:/..../group/control_panel/null error in links

Liferay Legend Mensajes: 1197 Fecha de incorporación: 8/02/05 Mensajes recientes
Change your

[tt]redirect.url.security.mode=ip[/tt]

value to

[tt]redirect.url.security.mode=domain[/tt]

and you will be fine.
thumbnail
William Fleming, modificado hace 13 años.

RE: http:/..../group/control_panel/null error in links

Regular Member Mensajes: 180 Fecha de incorporación: 15/09/10 Mensajes recientes
Ray Augé:
Change your

[tt]redirect.url.security.mode=ip[/tt]

value to

[tt]redirect.url.security.mode=domain[/tt]

and you will be fine.


I have done both of these and it has changed nothing. See if you are using a proxy or anything will this change anything. My server is virtual on xencenter.

Thanks
thumbnail
Ray Augé, modificado hace 13 años.

RE: http:/..../group/control_panel/null error in links

Liferay Legend Mensajes: 1197 Fecha de incorporación: 8/02/05 Mensajes recientes
One more thing to note when in IP mode.

On a multi-homed host (more than one IP), the JVM only recognizes one IP as SERVER_IP, therefore you have to list all subnet IPs of the server.

Otherwise, I'll have to test the proxy scenario before I can comment on it (but note that Liferay is often behind some form of proxy as common practice).
thumbnail
Harshal Shah, modificado hace 13 años.

SOLVED RE: http:/..../group/control_panel/null error in links

Junior Member Mensajes: 49 Fecha de incorporación: 25/05/10 Mensajes recientes
Below is what you need to do

redirect.url.security.mode=ip
redirect.url.ips.allowed=127.0.0.1,put in the ip address accessible from internet,put in ip address of the system where tomcat is installed.

Or you can set up for the domain as well see the post above.

Along with this u need to set up virtual host in
Liferay->Control Panel->Settings->(here set up the virtual host as the like blabla.com or put in the ip address accessible from the internet)

Along with this check the host in /etc/hosts but i did not require to do this.
thumbnail
Felipe Sere, modificado hace 13 años.

RE: SOLVED RE: http:/..../group/control_panel/null error in links

Junior Member Mensajes: 87 Fecha de incorporación: 27/01/10 Mensajes recientes
How do I set this if the server is behind a machine acting a router/firewall AND the machine on which tomcat runs is a VM?
Just to clarify: INTERNET --> FIREWALL_SERVER --> PHYSICAL_SERVER --> VIRTUAL_MACHINE.
Do I use the IP of the physical server as it acts as the last redirect before tomcat?
Thanks!

Felipe
thumbnail
Zsolt Balogh, modificado hace 13 años.

RE: SOLVED RE: http:/..../group/control_panel/null error in links

Expert Mensajes: 463 Fecha de incorporación: 23/03/09 Mensajes recientes
Hi Felipe,

You need to set the IP of the host name on which your clients are reaching your Liferay. E.g. if you are the administrator of the www.liferay.com, then you should write the www.liferay.com's IP address, the architecture behind does not matter.

Only use IP mode if you have name resolution on your Liferay installation, if you don't have it, use the domain mode!

Zsolt
thumbnail
Harshal Shah, modificado hace 13 años.

RE: SOLVED RE: http:/..../group/control_panel/null error in links

Junior Member Mensajes: 49 Fecha de incorporación: 25/05/10 Mensajes recientes
I think you will have to specify all the three ipadress ie
Ip address of router (ip which is visible from the internet)
Ip address of the physical machine.
Ip address of the virtual machine
thumbnail
Jari Fredriksson, modificado hace 13 años.

RE: SOLVED RE: http:/..../group/control_panel/null error in links

Junior Member Mensajes: 27 Fecha de incorporación: 14/09/10 Mensajes recientes
I have this problem and buggers me hard.

My Liferay is behind a reverse proxy, IP 1.2.3.4 and domain for all machines is "example.com"

machines are

liferay.example.com 1.1.1.1 (SERVER_IP)
www.example.com 1.2.3.4

So I have

redirect.url.domains.allowed=example.com
redirect.url.ips.allowed=127.0.0.1,SERVER_IP,1.2.3.4
redirect.url.security.mode=domain

I get the 'location.href = "null"' in control panel buttons.

What to do?
thumbnail
Ray Augé, modificado hace 13 años.

RE: SOLVED RE: http:/..../group/control_panel/null error in links

Liferay Legend Mensajes: 1197 Fecha de incorporación: 8/02/05 Mensajes recientes
Your domain list should contain any addresses that might show up in request "Host" header.

So, try:

[tt]redirect.url.domains.allowed=example.com,liferay.example.com,www.example.com[/tt]

Also, just for kicks, can you post your reverse proxy settings if it's not too complex?
thumbnail
Ray Augé, modificado hace 13 años.

RE: SOLVED RE: http:/..../group/control_panel/null error in links

Liferay Legend Mensajes: 1197 Fecha de incorporación: 8/02/05 Mensajes recientes
Effectively when using [tt]redirect.url.security.mode=domain[/tt] you may end having to specify all the domains set as virtual hosts on communities or orgs throughout the portal in the list [tt]redirect.url.domains.allowed[/tt].

Yes, this sounds problematic since you want to be able to create vhosts at will and have it all work without restarts.

It would seem that what happened is the logic to sanitize redirects (a measure implemented as part of OWASP recommendations) fails to check whether the domain is actually used as a valid vhost address by one of the portal instances, communities, or orgs in the system.

It would be a matter of performing a lookup at [tt]com.liferay.portal.util.PortalImpl.escapeRedirect(String url)[/tt] :

@@ -660,15 +661,31 @@ public class PortalImpl implements Portal {
 	public String escapeRedirect(String url) {
 		if (Validator.isNull(url) || !HttpUtil.hasDomain(url)) {
 			return url;
 		}
 
+		String domain = StringUtil.split(
+			HttpUtil.getDomain(url), StringPool.COLON)[0];
+
 		try {
-			String securityMode = PropsValues.REDIRECT_URL_SECURITY_MODE;
+			CompanyLocalServiceUtil.getCompanyByVirtualHost(domain);
+
+			return url;
+		}
+		catch (Exception e) {
+		}
+
+		try {
+			LayoutSetLocalServiceUtil.getLayoutSet(domain);
+
+			return url;
+		}
+		catch (Exception e) {
+		}
 
-			String domain = StringUtil.split(
-				HttpUtil.getDomain(url), StringPool.COLON)[0];
+		try {
+			String securityMode = PropsValues.REDIRECT_URL_SECURITY_MODE;
 
 			if (securityMode.equals("domain")) {
 				String[] allowedDomains =
 					PropsValues.REDIRECT_URL_DOMAINS_ALLOWED;
 


I didn't test this patch but it seems pretty logical to assume that whatever the [tt]redirect.url.security.mode[/tt] is set to, if there is a company or group using an address as it's virtual host it should be safe.

What do you think?
thumbnail
Ray Augé, modificado hace 13 años.

RE: SOLVED RE: http:/..../group/control_panel/null error in links

Liferay Legend Mensajes: 1197 Fecha de incorporación: 8/02/05 Mensajes recientes
Please see: http://issues.liferay.com/browse/LPS-12157

The change only affects one method so it could be patched in an older version with not too much effort.
thumbnail
Jari Fredriksson, modificado hace 13 años.

RE: SOLVED RE: http:/..../group/control_panel/null error in links

Junior Member Mensajes: 27 Fecha de incorporación: 14/09/10 Mensajes recientes
I got it working by changing the policy to "ip" instead of "domain". (I had all IP's listed in allowed IP's)

Also, what might be more important, my /etc/hosts had the host dns-name listed as 127.0.1.1 (maybe Debian default), I hanged it to the real IP and now all fine.
benjamin challamel, modificado hace 13 años.

RE: SOLVED RE: http:/..../group/control_panel/null error in links

New Member Mensajes: 17 Fecha de incorporación: 15/12/10 Mensajes recientes
I got it working also.

To solve it, you have to change settings in portal-ext.properties

redirect.url.security.mode=domain
redirect.url.domains.allowed=my-company.net,my-company.com

Benjamin
Dana Oredson, modificado hace 13 años.

RE: SOLVED RE: http:/..../group/control_panel/null error in links

Junior Member Mensajes: 70 Fecha de incorporación: 14/10/08 Mensajes recientes
Jari Fredriksson:
I got it working by changing the policy to "ip" instead of "domain". (I had all IP's listed in allowed IP's)

Also, what might be more important, my /etc/hosts had the host dns-name listed as 127.0.1.1 (maybe Debian default), I hanged it to the real IP and now all fine.


When you used IP, was it the IP of the web server, or application server?)
thumbnail
Ray Augé, modificado hace 13 años.

RE: SOLVED RE: http:/..../group/control_panel/null error in links

Liferay Legend Mensajes: 1197 Fecha de incorporación: 8/02/05 Mensajes recientes
app server.
thumbnail
Tom Thomas, modificado hace 12 años.

RE: SOLVED RE: http:/..../group/control_panel/null error in links

Junior Member Mensajes: 33 Fecha de incorporación: 10/09/09 Mensajes recientes
All this seems redundant and was not necessary in the previous 5.2.XX releases - the ip and hosts names are already in the hosts file on Windows systems. This seems like a bug in the 6.0.5 release to me and, in fact, none of the above solutions fixed the link problem when returning from the control panel to the previous page.
thumbnail
Jonas X. Yuan, modificado hace 13 años.

RE: SOLVED RE: http:/..../group/control_panel/null error in links

Liferay Master Mensajes: 993 Fecha de incorporación: 27/04/07 Mensajes recientes
Hi Ray, Thanks. Nice fix.

Maybe it would be better to set following as default.

redirect.url.ips.allowed=


same as the allowed domain

redirect.url.domains.allowed=


That is, any IP or domain is allowed by default.

Do it make sense?
Dana Oredson, modificado hace 13 años.

RE: SOLVED RE: http:/..../group/control_panel/null error in links

Junior Member Mensajes: 70 Fecha de incorporación: 14/10/08 Mensajes recientes
Jonas X. Yuan:
Hi Ray, Thanks. Nice fix.

Maybe it would be better to set following as default.

redirect.url.ips.allowed=


same as the allowed domain

redirect.url.domains.allowed=


That is, any IP or domain is allowed by default.

Do it make sense?


Does that actually work? I haven't seen any announcements for 6.0.6, so would like a workaround if available.
Kevin Mui, modificado hace 12 años.

RE: SOLVED RE: http:/..../group/control_panel/null error in links

New Member Mensajes: 6 Fecha de incorporación: 16/05/11 Mensajes recientes
seeing the null error as well. And I think it started after I removed 7cogs from webapps.

Where can I find portal-ext.properties ?
thumbnail
Mani kandan, modificado hace 12 años.

RE: SOLVED RE: http:/..../group/control_panel/null error in links

Expert Mensajes: 492 Fecha de incorporación: 15/09/10 Mensajes recientes
Here the file
thumbnail
Mani kandan, modificado hace 11 años.

RE: http:/..../group/control_panel/null error in links

Expert Mensajes: 492 Fecha de incorporación: 15/09/10 Mensajes recientes
Ray Augé:
Change your

[tt]redirect.url.security.mode=ip[/tt]

value to

[tt]redirect.url.security.mode=domain[/tt]

and you will be fine.



Good one Ray,