Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
http:/..../group/control_panel/null error in links Hennie de Villiers May 11, 2010 3:38 AM
RE: http:/..../group/control_panel/null error in links Zsolt Balogh May 11, 2010 7:30 AM
RE: http:/..../group/control_panel/null error in links Hennie de Villiers May 11, 2010 7:47 AM
RE: http:/..../group/control_panel/null error in links David Tompos June 4, 2010 2:05 PM
RE: http:/..../group/control_panel/null error in links Jorge Ferrer June 15, 2010 5:26 AM
RE: http:/..../group/control_panel/null error in links Anton Klein July 13, 2010 12:28 PM
RE: http:/..../group/control_panel/null error in links Jorge Ferrer July 15, 2010 2:38 AM
RE: http:/..../group/control_panel/null error in links Pekka Järveläinen July 20, 2010 11:44 PM
RE: http:/..../group/control_panel/null error in links Jignesh Thakkar July 29, 2010 12:47 AM
RE: http:/..../group/control_panel/null error in links Manikandan S June 5, 2011 11:51 PM
RE: http:/..../group/control_panel/null error in links Cid Moreno Miranda September 27, 2011 5:08 PM
RE: http:/..../group/control_panel/null error in links Tobias Käfer August 20, 2010 2:36 AM
RE: http:/..../group/control_panel/null error in links Ray Augé August 20, 2010 7:50 AM
RE: http:/..../group/control_panel/null error in links William Fleming September 30, 2010 1:20 AM
RE: http:/..../group/control_panel/null error in links Ray Augé September 30, 2010 6:25 AM
SOLVED RE: http:/..../group/control_panel/null error in links Harshal Shah October 26, 2010 9:15 AM
RE: SOLVED RE: http:/..../group/control_panel/null error in links Felipe Sere October 28, 2010 4:57 AM
RE: SOLVED RE: http:/..../group/control_panel/null error in links Zsolt Balogh October 28, 2010 5:07 AM
RE: SOLVED RE: http:/..../group/control_panel/null error in links Harshal Shah October 28, 2010 8:10 AM
RE: SOLVED RE: http:/..../group/control_panel/null error in links Jari Fredriksson November 26, 2010 7:42 AM
RE: SOLVED RE: http:/..../group/control_panel/null error in links Ray Augé November 26, 2010 7:52 AM
RE: SOLVED RE: http:/..../group/control_panel/null error in links Ray Augé November 26, 2010 8:18 AM
RE: SOLVED RE: http:/..../group/control_panel/null error in links Ray Augé November 26, 2010 8:45 AM
RE: SOLVED RE: http:/..../group/control_panel/null error in links Jari Fredriksson November 26, 2010 11:45 AM
RE: SOLVED RE: http:/..../group/control_panel/null error in links benjamin challamel December 17, 2010 7:51 AM
RE: SOLVED RE: http:/..../group/control_panel/null error in links Dana Oredson January 26, 2011 1:48 PM
RE: SOLVED RE: http:/..../group/control_panel/null error in links Ray Augé January 26, 2011 1:51 PM
RE: SOLVED RE: http:/..../group/control_panel/null error in links Tom Thomas April 13, 2011 1:34 PM
RE: SOLVED RE: http:/..../group/control_panel/null error in links Jonas Yuan January 1, 2011 1:02 PM
RE: SOLVED RE: http:/..../group/control_panel/null error in links Dana Oredson January 26, 2011 1:47 PM
RE: SOLVED RE: http:/..../group/control_panel/null error in links Kevin Mui May 16, 2011 9:56 AM
RE: SOLVED RE: http:/..../group/control_panel/null error in links Manikandan S August 19, 2011 12:34 AM
RE: http:/..../group/control_panel/null error in links Manikandan S September 11, 2012 10:33 PM
Hennie de Villiers
http:/..../group/control_panel/null error in links
May 11, 2010 3:38 AM
Answer

Hennie de Villiers

Rank: Junior Member

Posts: 75

Join Date: April 1, 2009

Recent Posts

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
Zsolt Balogh
RE: http:/..../group/control_panel/null error in links
May 11, 2010 7:30 AM
Answer

Zsolt Balogh

LIFERAY STAFF

Rank: Expert

Posts: 459

Join Date: March 23, 2009

Recent Posts

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:

 1##
 2## Redirect
 3##
 4
 5    #
 6    # Set this property to "ip" or "domain" for the redirect security method. If
 7    # set to "domain", the portal will only redirect users to domains listed in
 8    # the property "redirect.url.domain.allowed". If set to "ip", the portal
 9    # will only redirect to domains whose IP address resolve to an IP address
10    # listed in the property "redirect.url.ip.allowed".
11    #
12    #redirect.url.security.mode=domain
13    redirect.url.security.mode=ip
14
15    #
16    # Input a list of comma delimited domains which the portal is allowed to
17    # redirect to. Input a blank list to allow any domain.
18    #
19    redirect.url.domains.allowed=
20
21    #
22    # Input a list of comma delimited IPs which the portal is allowed to
23    # redirect to. Input a blank list to allow any IP. SERVER_IP will be
24    # replaced with the IP of the host server.
25    #
26    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
Hennie de Villiers
RE: http:/..../group/control_panel/null error in links
May 11, 2010 7:47 AM
Answer

Hennie de Villiers

Rank: Junior Member

Posts: 75

Join Date: April 1, 2009

Recent Posts

Thanks for the input... Much appreciated...
David Tompos
RE: http:/..../group/control_panel/null error in links
June 4, 2010 2:05 PM
Answer

David Tompos

Rank: New Member

Posts: 1

Join Date: March 20, 2010

Recent Posts

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.
Jorge Ferrer
RE: http:/..../group/control_panel/null error in links
June 15, 2010 5:26 AM
Answer

Jorge Ferrer

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2757

Join Date: August 31, 2006

Recent Posts

Hi David,

Did you apply the solution explained by Zsolt?
Anton Klein
RE: http:/..../group/control_panel/null error in links
July 13, 2010 12:28 PM
Answer

Anton Klein

Rank: New Member

Posts: 1

Join Date: July 13, 2010

Recent Posts

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
Jorge Ferrer
RE: http:/..../group/control_panel/null error in links
July 15, 2010 2:38 AM
Answer

Jorge Ferrer

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2757

Join Date: August 31, 2006

Recent Posts

Hi Anton,

Did you also set up the property redirect.url.ips.allowed ? That's the most important one.
Pekka Järveläinen
RE: http:/..../group/control_panel/null error in links
July 20, 2010 11:44 PM
Answer

Pekka Järveläinen

Rank: New Member

Posts: 5

Join Date: July 19, 2010

Recent Posts

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
Jignesh Thakkar
RE: http:/..../group/control_panel/null error in links
July 29, 2010 12:47 AM
Answer

Jignesh Thakkar

Rank: New Member

Posts: 24

Join Date: May 9, 2010

Recent Posts

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.
Tobias Käfer
RE: http:/..../group/control_panel/null error in links
August 20, 2010 2:36 AM
Answer

Tobias Käfer

Rank: Regular Member

Posts: 128

Join Date: March 28, 2008

Recent Posts

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:
 1....
 2        _computerName = System.getProperty("env.COMPUTERNAME");
 3
 4        if (Validator.isNull(_computerName)) {
 5            _computerName = System.getProperty("env.HOST");
 6        }
 7
 8        if (Validator.isNull(_computerName)) {
 9            _computerName = System.getProperty("env.HOSTNAME");
10        }
11
12        if (Validator.isNull(_computerName)) {
13            try {
14                _computerName = InetAddress.getLocalHost().getHostName();
15            }
16            catch (UnknownHostException uhe) {
17            }
18        }
19
20        try {
21            _computerAddress = InetAddress.getByName(
22                _computerName).getHostAddress();
23        }
24....


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:
1127.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:
  1. You have to remove "myhost" from "/etc/hosts"
  2. 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.
  3. You set "env.COMPUTERNAME", "env.HOST" or "env.HOSTNAME" to "myhost.mydomain.com".
Ray Augé
RE: http:/..../group/control_panel/null error in links
August 20, 2010 7:50 AM
Answer

Ray Augé

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1171

Join Date: February 7, 2005

Recent Posts

Change your

redirect.url.security.mode=ip

value to

redirect.url.security.mode=domain

and you will be fine.
William Fleming
RE: http:/..../group/control_panel/null error in links
September 30, 2010 1:20 AM
Answer

William Fleming

Rank: Regular Member

Posts: 180

Join Date: September 15, 2010

Recent Posts

Ray Augé:
Change your

redirect.url.security.mode=ip

value to

redirect.url.security.mode=domain

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
Ray Augé
RE: http:/..../group/control_panel/null error in links
September 30, 2010 6:25 AM
Answer

Ray Augé

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1171

Join Date: February 7, 2005

Recent Posts

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).
Harshal Shah
SOLVED RE: http:/..../group/control_panel/null error in links
October 26, 2010 9:15 AM
Answer

Harshal Shah

Rank: Junior Member

Posts: 49

Join Date: May 25, 2010

Recent Posts

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.
Felipe Sere
RE: SOLVED RE: http:/..../group/control_panel/null error in links
October 28, 2010 4:57 AM
Answer

Felipe Sere

Rank: Junior Member

Posts: 87

Join Date: January 27, 2010

Recent Posts

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
Zsolt Balogh
RE: SOLVED RE: http:/..../group/control_panel/null error in links
October 28, 2010 5:07 AM
Answer

Zsolt Balogh

LIFERAY STAFF

Rank: Expert

Posts: 459

Join Date: March 23, 2009

Recent Posts

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
Harshal Shah
RE: SOLVED RE: http:/..../group/control_panel/null error in links
October 28, 2010 8:10 AM
Answer

Harshal Shah

Rank: Junior Member

Posts: 49

Join Date: May 25, 2010

Recent Posts

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
Jari Fredriksson
RE: SOLVED RE: http:/..../group/control_panel/null error in links
November 26, 2010 7:42 AM
Answer

Jari Fredriksson

Rank: New Member

Posts: 23

Join Date: September 14, 2010

Recent Posts

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?
Ray Augé
RE: SOLVED RE: http:/..../group/control_panel/null error in links
November 26, 2010 7:52 AM
Answer

Ray Augé

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1171

Join Date: February 7, 2005

Recent Posts

Your domain list should contain any addresses that might show up in request "Host" header.

So, try:

redirect.url.domains.allowed=example.com,liferay.example.com,www.example.com

Also, just for kicks, can you post your reverse proxy settings if it's not too complex?
Ray Augé
RE: SOLVED RE: http:/..../group/control_panel/null error in links
November 26, 2010 8:18 AM
Answer

Ray Augé

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1171

Join Date: February 7, 2005

Recent Posts

Effectively when using redirect.url.security.mode=domain you may end having to specify all the domains set as virtual hosts on communities or orgs throughout the portal in the list redirect.url.domains.allowed.

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 com.liferay.portal.util.PortalImpl.escapeRedirect(String url) :

 1@@ -660,15 +661,31 @@ public class PortalImpl implements Portal {
 2     public String escapeRedirect(String url) {
 3         if (Validator.isNull(url) || !HttpUtil.hasDomain(url)) {
 4             return url;
 5         }
 6
 7+        String domain = StringUtil.split(
 8+            HttpUtil.getDomain(url), StringPool.COLON)[0];
 9+
10         try {
11-            String securityMode = PropsValues.REDIRECT_URL_SECURITY_MODE;
12+            CompanyLocalServiceUtil.getCompanyByVirtualHost(domain);
13+
14+            return url;
15+        }
16+        catch (Exception e) {
17+        }
18+
19+        try {
20+            LayoutSetLocalServiceUtil.getLayoutSet(domain);
21+
22+            return url;
23+        }
24+        catch (Exception e) {
25+        }
26
27-            String domain = StringUtil.split(
28-                HttpUtil.getDomain(url), StringPool.COLON)[0];
29+        try {
30+            String securityMode = PropsValues.REDIRECT_URL_SECURITY_MODE;
31
32             if (securityMode.equals("domain")) {
33                 String[] allowedDomains =
34                     PropsValues.REDIRECT_URL_DOMAINS_ALLOWED;
35


I didn't test this patch but it seems pretty logical to assume that whatever the redirect.url.security.mode 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?
Ray Augé
RE: SOLVED RE: http:/..../group/control_panel/null error in links
November 26, 2010 8:45 AM
Answer

Ray Augé

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1171

Join Date: February 7, 2005

Recent Posts

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.
Jari Fredriksson
RE: SOLVED RE: http:/..../group/control_panel/null error in links
November 26, 2010 11:45 AM
Answer

Jari Fredriksson

Rank: New Member

Posts: 23

Join Date: September 14, 2010

Recent Posts

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
RE: SOLVED RE: http:/..../group/control_panel/null error in links
December 17, 2010 7:51 AM
Answer

benjamin challamel

Rank: New Member

Posts: 17

Join Date: December 15, 2010

Recent Posts

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
Jonas Yuan
RE: SOLVED RE: http:/..../group/control_panel/null error in links
January 1, 2011 1:02 PM
Answer

Jonas Yuan

Rank: Liferay Master

Posts: 993

Join Date: April 26, 2007

Recent Posts

Hi Ray, Thanks. Nice fix.

Maybe it would be better to set following as default.

1redirect.url.ips.allowed=


same as the allowed domain

1redirect.url.domains.allowed=


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

Do it make sense?
Dana Oredson
RE: SOLVED RE: http:/..../group/control_panel/null error in links
January 26, 2011 1:47 PM
Answer

Dana Oredson

Rank: Junior Member

Posts: 70

Join Date: October 14, 2008

Recent Posts

Jonas X. Yuan:
Hi Ray, Thanks. Nice fix.

Maybe it would be better to set following as default.

1redirect.url.ips.allowed=


same as the allowed domain

1redirect.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.
Dana Oredson
RE: SOLVED RE: http:/..../group/control_panel/null error in links
January 26, 2011 1:48 PM
Answer

Dana Oredson

Rank: Junior Member

Posts: 70

Join Date: October 14, 2008

Recent Posts

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?)
Ray Augé
RE: SOLVED RE: http:/..../group/control_panel/null error in links
January 26, 2011 1:51 PM
Answer

Ray Augé

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1171

Join Date: February 7, 2005

Recent Posts

app server.
Tom Thomas
RE: SOLVED RE: http:/..../group/control_panel/null error in links
April 13, 2011 1:34 PM
Answer

Tom Thomas

Rank: Junior Member

Posts: 33

Join Date: September 10, 2009

Recent Posts

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.
Kevin Mui
RE: SOLVED RE: http:/..../group/control_panel/null error in links
May 16, 2011 9:56 AM
Answer

Kevin Mui

Rank: New Member

Posts: 6

Join Date: May 16, 2011

Recent Posts

seeing the null error as well. And I think it started after I removed 7cogs from webapps.

Where can I find portal-ext.properties ?
Manikandan S
RE: http:/..../group/control_panel/null error in links
June 5, 2011 11:51 PM
Answer

Manikandan S

Rank: Expert

Posts: 492

Join Date: September 15, 2010

Recent Posts

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
Manikandan S
RE: SOLVED RE: http:/..../group/control_panel/null error in links
August 19, 2011 12:34 AM
Answer

Manikandan S

Rank: Expert

Posts: 492

Join Date: September 15, 2010

Recent Posts

Here the file
Attachments: portal-ext.properties (235.4k)
Cid Moreno Miranda
RE: http:/..../group/control_panel/null error in links
September 27, 2011 5:08 PM
Answer

Cid Moreno Miranda

Rank: New Member

Posts: 1

Join Date: September 27, 2011

Recent Posts

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!
Manikandan S
RE: http:/..../group/control_panel/null error in links
September 11, 2012 10:33 PM
Answer

Manikandan S

Rank: Expert

Posts: 492

Join Date: September 15, 2010

Recent Posts

Ray Augé:
Change your

redirect.url.security.mode=ip

value to

redirect.url.security.mode=domain

and you will be fine.



Good one Ray,