centos7.3搭建LNMP并部署wordpress站点

  

<强>

一、拓扑图

 centos7.3搭建LNMP并部署wordpress站点“> <br/> </p> <p>二,准备工作:</p> <p>,,,, 1。三台独立主机(虚拟机)</p> <p>,,,,,,,, nginx: 10.0.0.11 </p> <p>,,,,,,,, php-fpm: 10.0.0.2 </p> <p>,,,,,,,, mariadb: 10.0.0.13 </p> <p>,,,,,,,,准备好百胜环境(推荐阿里云百胜源,请百度搜索)</p> <p>,,,, 2。相关的软件包准备</p> <p>,,10.0.0.11才能(nginx) </p> <p>,,,,,,,,,使用yum安装nginx - y </p> <p>,,10.0.0.2才能(php-fpm) </p> <p>,,,,,,,,, yum安装php-fpm php mysql, php-mbstring php-mcrypt php-xcache - y </p> <p>,,10.0.0.13才能(mariadb) </p> <p>,,,,,,,,,使用yum安装mariadb-server - y </p> <p>三,搭建步骤</p> <p> 1. nginx主机操作</p> <p>,,,, 1。安装</p> <pre类= yum  install  nginx  - y

,,, 2。配置nginx支持反向代理php-fpm

vi /etc/nginx conf.d/huwho.conf   ,,,server  {   ,,,,,,,listen  80;   ,,,,,,,server_name  www.huwho.com,,,,, #网络站点域名   ,,,,,,,index  index.php  index.html 你可以;   ,,,,,,,#定义一个nginx的web站点,放置web静态资源   ,,,,,,,的位置/,{   ,,,,,,,root /web/www;   ,,,,,,,index  index.html  index.htm  index . php。   ,,,,,,,}   ,,,,,,,#定义一个web状态页   ,,,,,,,的位置/status  {   ,,,,,,,stub_status;   ,,,,,,,}   ,,,,,,,# pass 从而PHP  scripts 用FastCGI  server  listening 提醒10.0.0.2:9000   ,,,,,,,#反向代理php,放置网络动态资源   ,,,,,,,的位置~ *,\美元。php, {   ,,,,,,,root /web/www/php;,,,,,,,,,,,,,,,, # php的站点根目录   ,,,,,,,fastcgi_pass  10.0.0.2:9000;,,,,,,,, # fastcgi的地址   ,,,,,,,fastcgi_index  index . php。   ,,,,,,,fastcgi_param  SCRIPT_FILENAME /web/www/php/fastcgi_script_name美元;   ,,,,,,,include  fastcgi_params;   ,,,,,,,}   ,,,}

,,, 3。创建相应的目录

mkdir /web/www/, -pv    echo  nginx  web  test 祝辞祝辞,/web/www/

,,, 4。启动nginx服务并测试

systemctl  start  nginx

 centos7.3搭建LNMP并部署wordpress站点


2. php-fpm主机操作

,,,, 1。安装

yum  install  php-fpm  php-mysql , php-mbstring  php-mcrypt  php-xcache  - y

,,,, 2. php-fpm配置文件修改

,,,,修改图中三处位置

vi /etc/php-fpm.d/www.conf

 centos7.3搭建LNMP并部署wordpress站点

 centos7.3搭建LNMP并部署wordpress站点

,,, 3。启动php-fpm服务

systemctl  start  php-fpm   (root@localhost  ~) #, ss  -tln   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null

centos7.3搭建LNMP并部署wordpress站点