Liferay博客URL和虚拟主机

时间:2012-06-06 14:16:50

标签: java jsp tomcat utf-8 liferay

我们公司在没有虚拟主机的情况下运行Liferay。我们使用VM IP和端口80打开我们的门户网站。这个设置没有任何问题。

当我向Liferay添加虚拟主机并在我的机器上更改DNS时 - 我无法打开任何具有长俄语名称的资产(文章)。

Tomcat控制台:

WARN  [404_jsp:109] /home/-/asset_publisher/JbL5ejmhvwSa/content/%D1%80%D0%B5%D1%88%D0%B5%D0%BD%D0%B8%D1%8F-%D0%B8%D0%BD%D1%82%D0%B5%D1%80%D0%BF%D1%80%D0%BE%D0%BA%D0%BE%D0%BC-%D0%BF%D0%BE-%D0%BE%D0%BF%D1%82%D0%B8%D0%BC%D0%B8%D0%B7%D0%B0%D1%86%D0%B8%D0%B8-%D1%80%D0%B0%D0%B1%D0%BE%D1%87%D0%B5%D0%B3%D0%BE-%D0%B2%D1%80%D0%B5%D0%BC%D0%B5%D0%BD%D0%B8-%D1%81%D0%BE%D1%82%D1%80%D1%83%D0%B4%D0%BD%D0%B8%D0%BA%D0%BE%D0%B2-%D0%BD%D0%B0-%D0%B1%D0%B0%D0%B7%D0%B5-%D0%BF%D1%80%D0%BE%D0%B4%D1%83%D0%BA%D1%82%D0%BE%D0%B2-ibm

启用虚拟主机的网址(无法正常工作)

http://companyname.com/home/-/asset_publisher/JbL5ejmhvwSa/content/%D1%80%D0%B5%D1%88%D0%B5%D0%BD%D0%B8%D1%8F-%D0%B8%D0%BD%D1%82%D0%B5%D1%80%D0%BF%D1%80%D0%BE%D0%BA%D0%BE%D0%BC-%D0%BF%D0%BE-%D0%BE%D0%BF%D1%82%D0%B8%D0%BC%D0%B8%D0%B7%D0%B0%D1%86%D0%B8%D0%B8-%D1%80%D0%B0%D0%B1%D0%BE%D1%87%D0%B5%D0%B3%D0%BE-%D0%B2%D1%80%D0%B5%D0%BC%D0%B5%D0%BD%D0%B8-%D1%81%D0%BE%D1%82%D1%80%D1%83%D0%B4%D0%BD%D0%B8%D0%BA%D0%BE%D0%B2-%D0%BD%D0%B0-%D0%B1%D0%B0%D0%B7%D0%B5-%D0%BF%D1%80%D0%BE%D0%B4%D1%83%D0%BA%D1%82%D0%BE%D0%B2-ibm?redirect=http%3A%2F%2Finterprocom.ru%2Fhome%3Fp_p_id%3D101_INSTANCE_JbL5ejmhvwSa%26p_p_lifecycle%3D0%26p_p_state%3Dnormal%26p_p_mode%3Dview%26p_p_col_id%3Dcolumn-2%26p_p_col_pos%3D1%26p_p_col_count%3D2

虚拟主机禁用网址(正常工作)

http://192.168.10.35/web/guest/home/-/asset_publisher/JbL5ejmhvwSa/content/%D1%80%D0%B5%D1%88%D0%B5%D0%BD%D0%B8%D1%8F-%D0%B8%D0%BD%D1%82%D0%B5%D1%80%D0%BF%D1%80%D0%BE%D0%BA%D0%BE%D0%BC-%D0%BF%D0%BE-%D0%BE%D0%BF%D1%82%D0%B8%D0%BC%D0%B8%D0%B7%D0%B0%D1%86%D0%B8%D0%B8-%D1%80%D0%B0%D0%B1%D0%BE%D1%87%D0%B5%D0%B3%D0%BE-%D0%B2%D1%80%D0%B5%D0%BC%D0%B5%D0%BD%D0%B8-%D1%81%D0%BE%D1%82%D1%80%D1%83%D0%B4%D0%BD%D0%B8%D0%BA%D0%BE%D0%B2-%D0%BD%D0%B0-%D0%B1%D0%B0%D0%B7%D0%B5-%D0%BF%D1%80%D0%BE%D0%B4%D1%83%D0%BA%D1%82%D0%BE%D0%B2-ibm?redirect=http%3A%2F%2F192.168.10.45%2Fweb%2Fguest%2Fhome%3Fp_p_id%3D101_INSTANCE_JbL5ejmhvwSa%26p_p_lifecycle%3D0%26p_p_state%3Dnormal%26p_p_mode%3Dview%26p_p_col_id%3Dcolumn-2%26p_p_col_pos%3D1%26p_p_col_count%3D2

我们上市前几天。我们将使用我们的域名companyname.com

我担心我们会遇到同样的问题。

4 个答案:

答案 0 :(得分:0)

无法立即解决根本问题:您还可以使用带有主机名的最后一个选项:没有虚拟主机名,只需将名称解析为192.168.10.35(在上线时更改为实际IP)。

另外,你在哪个版本的Liferay?

答案 1 :(得分:0)

请参阅此问题,我会帮助您:Liferay: After changing Public Virtual Host settings, can't log in

另外,您可以在生成的jsp代码tomcat/work/...中看到为什么这不起作用。 最后,您可以调试Liferay并找到解决方案:)调试Liferay的简单方法是获取Liferay IDE并添加Liferay Source作为eclipse项目。祝你好运。

答案 2 :(得分:0)

即使我面对这个问题,并观察到使用liferay的虚拟主机映射,当与访客站点中的条目相关时,带有特殊字符的url不会显示。

  

通过映射虚拟主机,将从URL中删除Web / guest部分。

现在,如果您尝试在网址之前手动添加网络/访客,在您的情况下

尝试使用以下网址

进行访问

http://companyname.com/web/guest/home/-/asset_publisher/JbL5ejmhvwSa/content/%D1%80%D0%B5%D1%88%D0%B5%D0%BD%D0%B8%D1%8F-%D0%B8%D0%BD%D1%82%D0%B5%D1%80%D0%BF%D1%80%D0%BE%D0%BA%D0%BE%D0%BC-%D0%BF%D0%BE-%D0%BE%D0%BF%D1%82%D0%B8%D0%BC%D0%B8%D0%B7%D0%B0%D1%86%D0%B8%D0%B8-%D1%80%D0%B0%D0%B1%D0%BE%D1%87%D0%B5%D0%B3%D0%BE-%D0%B2%D1%80%D0%B5%D0%BC%D0%B5%D0%BD%D0%B8-%D1%81%D0%BE%D1%82%D1%80%D1%83%D0%B4%D0%BD%D0%B8%D0%BA%D0%BE%D0%B2-%D0%BD%D0%B0-%D0%B1%D0%B0%D0%B7%D0%B5-%D0%BF%D1%80%D0%BE%D0%B4%D1%83%D0%BA%D1%82%D0%BE%D0%B2-ibm?redirect=http%3A%2F%2Finterprocom.ru%2Fhome%3Fp_p_id%3D101_INSTANCE_JbL5ejmhvwSa%26p_p_lifecycle%3D0%26p_p_state%3Dnormal%26p_p_mode%3Dview%26p_p_col_id%3Dcolumn-2%26p_p_col_pos%3D1%26p_p_col_count%3D2

它应该有用。

  

因此,解决此问题的一种可能方法是保留虚拟主机   映射到您的Windows /您的OS主机文件并将虚拟主机重命名为   Liferay中的localhost位于控件中Portal选项卡下的门户设置中   面板。

步骤进行:

1) In hosts file keep the mapping as you have done i.e 
   192.168.10.35           companyname.com

2) In liferay, remove the virtual host mapping i.e rename virtual host to localhost in "portal settings" under "Portal" tab in control panel.

and try to access your entry and it will work.

这是非常有趣的行为/可能是liferay中的一个错误。

希望这有帮助。

答案 3 :(得分:-1)

因此,您在本地主机上测试Liferay,然后尝试移动真实域并面临一些奇怪的行为。

您要做的第一件事是检查控制面板并在那里输入新的虚拟主机。

enter image description here

我不确定这一点,因为我们现在正在使用6.0而且我不记得我们是如何修复的。如果我的建议没有帮助,请检查此问题的其他评论。