apache php wordpress,PHPFPMWordpress

Get [Wordpress|http://wordpress.org/] running on Apache 2.4 using PHP-FPM.

I am running multiple wordpress sites on a single web server, but want to keep them as isolated as possible.

This config emulates the .htaccess setup traditionally found in wordpress sites, but is a lot faster

## No longer needed

#RewriteCond %{REQUEST_FILENAME} !-f

#RewriteRule ^ /index.php [L]

Here is the VirtualHost setup:

ServerName blog1.example.com

ServerAlias *.blog1.example.com

DocumentRoot "/var/www/html/blog1.example.com"

Require all granted

DirectoryIndex index.php

AllowOverride FileInfo

FallbackResource /index.php

FallbackResource disabled

ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9001/var/www/html/blog1.example.com/$1

ServerName blog2.example.com

ServerAlias *.blog2.example.com

DocumentRoot "/var/www/html/blog2.example.com"

Require all granted

DirectoryIndex index.php

AllowOverride FileInfo

FallbackResource /index.php

FallbackResource disabled

ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9002/var/www/html/blog2.example.com/$1

My php-fpm setup (should be improved to include chroot) is pretty stock from php.net

Note these are not complete files, but just the main snippets to show what was done

#/etc/php-fpm.conf

include=/etc/php-fpm.d/*.conf

#/etc/php-fpm.d/blog1.conf

[wp_blog1]

listen = 127.0.0.1:9001

listen.allowed_clients = 127.0.0.1

user = wp_blog1

group = apache

...

#/etc/php-fpm.d/blog2.conf

[wp_blog2]

listen = 127.0.0.1:9002

listen.allowed_clients = 127.0.0.1

user = wp_blog2

group = apache

...

Then on my web servers:

useradd -d /var/www/html -s /sbin/nologin -g apache wp_blog1

useradd -d /var/www/html -s /sbin/nologin -g apache wp_blog2

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值