wordpress和node.js [英] wordpress and node.js

查看:289
本文介绍了wordpress和node.js的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在同一台服务器机器上安装wordpress和node.js服务器,并且还可以从node.js使用wordpress mysql数据库?也有可能在noh服务器上也安装了noSql以便与node.js一起使用吗?我想将wordpress用于我的门户的前端,但是所有异步工作都与node.js有关,并从wordpress mysql中读取一些数据,并将一些数据写入noSql.有人可以帮助我实现测试目的的步骤.

Is it possible to install wordpress and node.js server on same server maschine and use wordpress mysql database also from node.js? Also is it possible to have noSql also installed on thah server to use with node.js? I want to use wordpress for frontend for my portal, but all asynchronous work to do with node.js and reading some data from wordpress mysql and writing some to noSql. Can someone please help me with steps how to achive this for testing purposes.

感谢您的时间和最诚挚的问候!

Thank you for your time and best regards!

推荐答案

如果您打算使用node来由wordpress提供的JavaScript进行异步访问,那么让它们在其上运行将大大简化您的工作相同的主机和端口.我过去所做的工作如下:

If you're planning on using node for being accessed asynchronously by JavaScript that's being served by wordpress, then it will make your life considerably easier to have them running on the same host and port. What I've done in the past is set up the following:

  1. Apache + PHP + Wordpress在某个端口上运行(8000?)
  2. 节点+ npm +您要在其他端口上运行的其他软件包(9000?)
  3. 具有一些规则的HAProxy侦听端口80,该规则将根据路径将两个服务器中的哪个发送请求到服务器.
  4. MySQL的常规安装以及您选择的任何NoSQL DB.

如果要对端口443上的HTTPS进行相同操作,则HAProxy的最新版本也可以终止SSL.

Recent versions of HAProxy can also terminate SSL, if you want to do the same with HTTPS on port 443.

这是示例HAProxy配置:

Here's a sample HAProxy configuration:

defaults
  log global
  maxconn 4096
  mode http
  option http-server-close
  timeout connect 5s
  timeout client 30s
  timeout server 30s

frontend public
  # HTTP
  bind :80
  use_backend node if { path_beg /services }
  # Everything else to Apache.
  default_backend apache

backend node
  server node1 127.0.0.1:9000

backend apache
  server apache1 127.0.0.1:8000

这篇关于wordpress和node.js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆