lnmp安装wordpress

1.1安装mariadb

这里使用yum安装的

Yum install mariadb mariadb-server -y

1.2systemctl start mariadb

netstat -ntlp |grep mysql

1.3安装nginx

使用源码安装

1.4安装php

安装需要的依赖

yum -y install gd curl curl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel bzip2

解压包

tar xf php-5.6.8.tar.bz2

预编译

./configure --prefix=/usr/local/php --enable-fpm --enable-debug --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --enable-mbstring --with-curl --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-config-file-path=/usr/local/php/etc --with-zlib-dir

编译安装

make -j  && make -j install

1.5

[root@v1 php-5.6.8]# cp php.ini-development  /usr/local/php/etc/php.ini

cp /usr/local/php/etc/php-fpm.conf.default  /usr/local/php/etc/php-fpm.conf

copy  启动脚本

[root@v1 php-5.6.8]# cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm

授权启动

[root@v1 php-5.6.8]# chmod +x  /etc/init.d/php-fpm

 

将php-fpm的用户和组改为nginx

[root@v1 php-5.6.8]# vim /usr/local/php/etc/php-fpm.conf

user = nginx

group = nginx

启动php-fpm

[root@v1 php-5.6.8]# /etc/init.d/php-fpm start

Starting php-fpm  done

1.5上传wordpress网站的代码

[root@v1 src]# tar xf wordpress-4.9.4-zh_CN.tar.gz  -C /usr/local/nginx/html/

 将此发布目录授权给nginx用户

[root@v1 src]# chown nginx.   -R /usr/local/nginx/html/wordpress/

创建虚拟主机目录

[root@v1 conf]# mkdir -p /usr/local/nginx/conf/vhost

创建虚拟机主机的配置文件

[root@v1 conf]# vim /usr/local/nginx/conf/vhost/blog.wordpress.com.conf

 

server {

        listen       80;

        server_name blog.wordpress.com;

        #charset koi8-r;

        access_log  logs/wordpress.access.log  main;

        location / {

            root   html/wordpress;

            index  index.php  index.html index.htm;

        }

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html

        #

        error_page   500 502 503 504  /50x.html;

        location = /50x.html {

                root   html;

        }

        location ~ \.php$ {

            root           html/wordpress;

            fastcgi_pass   127.0.0.1:9000;

            fastcgi_index  index.php;

            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;

            include        fastcgi_params;

        }

}

并在主配置文件中 引用

  #gzip  on;

    include vhost/*.conf;

1.6创建数据库

systemctl start mariadb

进入数据库中

mysql

创建数据库 并授权

MariaDB [(none)]> create database wordpress charset utf8;

MariaDB [(none)]> grant all on wordpress.* to "wordpress"@"localhost" identified by "123456";

并使其生效

MariaDB [(none)]> flush privileges;

启动php-fpm

在物理机机器中添加 解析域名

192.168.217.133  blog.wordpress.com

在浏览器 访问blog.wordpress.com

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值