简体   繁体   English

如何将WordPress博客与Grails应用程序集成?

[英]How do I integrate WordPress blogs with my Grails application?

I had my static site with which WordPress blogs were integrated. 我有一个集成了WordPress博客的静态站点。 Now I have made a Grails application with which I want to integrate those WordPress blogs. 现在,我已经制作了一个Grails应用程序,希望与之集成那些WordPress博客。

I had put the WordPress folder copied from my previous site to the web-app folder of my Grails application. 我已将从以前的站点复制的WordPress文件夹放置到Grails应用程序的web-app文件夹中。 But I am not able to access the WordPress folder, as when I hit URL - http://localhost:8080/myApplicaiton/wordpress/ , it shows this error: 但是我无法访问WordPress文件夹,因为当我点击URL- http:// localhost:8080 / myApplicaiton / wordpress /时 ,它显示此错误:

Error 500: java.net.SocketTimeoutException: Read timed out 错误500:java.net.SocketTimeoutException:读取超时

Also, in my urlMappings.groovy one of the mappings I need is 另外,在我的urlMappings.groovy中,我需要的映射之一是

"/$generalPageURL"(controller:'myConroller', action:'myAction')

And if I put in the above mapping, all requests for WordPress goes to myAction of myController . 如果我输入上面的映射,所有对WordPress的请求都将发送到myController myAction Is there any way out to still reach the WordPress folder defined inside web-app folder with the above mapping? 有什么办法可以通过上述映射仍然到达在web-app文件夹内定义的WordPress文件夹?

This may sound silly, but your WordPress blog need PHP in order to run. 这听起来可能很愚蠢,但是您的WordPress博客需要PHP才能运行。 You maybe better off using an HTTP server like Apache with PHP on the front and use either a mod_proxy or mod_jk type of configuration to connect the two applications (Grails and WordPress) together. 您可能最好使用前端带有PHP的HTTP服务器(如Apache),并使用mod_proxymod_jk类型的配置将两个应用程序(Grails和WordPress)连接在一起。 That way your users can see http://www.yoursite.com/wordpress and http://www.yoursite.com/grailssite , with the HTTP requests being handled by Apache and then have it pass the Grails part off to Jetty / GlassFish or whatever you are using. 这样,您的用户可以查看http://www.yoursite.com/wordpresshttp://www.yoursite.com/grailssite ,其中HTTP请求由Apache处理,然后将Grails部分传递给Jetty / GlassFish或您正在使用的任何东西。

我认为您需要以相反的顺序apache来重定向到php网站,而不是grails来重定向到apache服务器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM