CentOS7.2基于LNMP搭建Wordpress
本次搭建LAMP+Wordpress环境如下
MySQL | php |
---|---|
Wordpress_CN 4.9 | nginx |
CentOS 7.2 | 192.168.100.10 |
1、 安装mariadb、php、nginx、wget
2、修改php-fpm 和 nginx 配置文件
3、下载wordpress并配置
4、网页进入后台
1、主节点(master)配置
yum -y install nginx mariadb mariadb-server php php-server wget php-fpm php-mysql
启动nginx,mariadb,并初始化mairadbsystemctl start maraidb
/usr/sbin/nginxmysql_secure_installation #设置数据库root用户密码
2、修改php-fpm 和 nginx 配置文件
编辑配置文件 vi /etc/nginx/conf.d/default.conf
修改第 10 30-36行
location / {root /usr/share/nginx/wordpress/; index index.php index.html index.htm; //在这里加上 index.php}
location ~ \.php$ {root /usr/share/nginx/wordpress/; //修改为网站目录fastcgi_pass 127.0.0.1:9000;fastcgi_index index.php;fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; //修改 /scripts 为 $document_rootinclude fastcgi_params;}
编辑php-fpm配置文件
[root@localhost ~]# vi /etc/php-fpm.d/www.conf
修改 39 41行文件 将apache变为 nginx
启动php
[root@localhost ~]# systemctl start php-fpm
3、下载wordpress并配置
# wget https://cn.wordpress.org/wordpress-4.9-zh_CN.tar.gz
可以先下载到电脑上面再传到服务器里面
解压tar包
tar -zxf wordpress-4.9-zh_CN.tar.gz
登录mysql,创建wordpress数据库和用户
MariaDB [(none)]> create database `wordpress-db`;
MariaDB [(none)]> grant all privileges on `wordpress-db`.* to 'wordpress'@'localhost' identified by '000000';
MariaDB [(none)]> flush privileges;
创建和编辑 wp-config.php 文件
[root@server ~]# cp wordpress/wp-config-sample.php wordpress/wp-config.php
[root@server ~]# vi wordpress/wp-config.php
更改权限
[root@localhost ~]# chown -R nginx:nginx /usr/share/nginx/
修改数据库名称 数据库用户及密码
复制 wordpress 安装目录的内容
cp -r wordpress/* /usr/share/nginx/html/
移除原有目录的页面文件
mv /usr/share/nginx/html/* /opt/
重启nginx和mariadb服务
[root@server ~]# systemctl restart mariadb
[root@server ~]# /usr/sbin/nginx -s reload
4、网页进入后台
浏览器输入IP地址进行安装
192.168.100.10/wp-admin
CentOS7.2基于LNMP搭建Wordpress相关推荐
- CentOS 7.4 基于LNMP搭建wordpress
之前有好多次搭建wordpress的经历,有在Ubuntu系统上,有在CentOS7.2系统上,但都是搭完还是稀里糊涂的,因为好多都是教程上照着敲的.这次好好出个教程,以便以后方便查看. 准备工作:C ...
- CentOS7.2基于LAMP搭建WordPress,并自定义Logo和名称
本次搭建LAMP+Wordpress环境如下 MySQL php Wordpress_CN 4.9 Apache CentOS 7.2 192.168.200.10 1. 安装mariadb.php. ...
- 实操:基于LNMP搭建zabbix监控
文章目录 一:环境准备: 二:zabbix概述 2.1 查看官网 2.2 zabbix与nagios 2.3 zzbbix介绍 2.4 zabbix软件包 三:基于LNMP搭建zabbix 3.1 创 ...
- Centos7 分离部署lnmp+discuz+wordpress 及Redis
一.环境 软件版本 Nginx: 1.16.1 Php: 5.6 Mariadb: 5.5.6 Redis: 5.0 Discuz: 3.4 Wordpress: 5.4.2 二.流程(思路) 1.先 ...
- CentOS7.2基于LNMP+WordPress离线安装
本次搭建LAMP+Wordpress环境如下 MySQL php Wordpress_CN 4.9 nginx CentOS 7.2 192.168.100.10 提供的包在/root/lnmp目录下 ...
- 部署LNMP并利用LNMP搭建wordpress论坛
1.LNMP是什么? LNMP是指一组通常一起使用来运行动态网站或者服务器的自由软件名称首字母缩写.L指Linux,N指Nginx,M一般指MySQL,也可以指MariaDB,P一般指PHP,也可以指 ...
- Nginx 实践案例(源码编译安装方式):利用LNMP搭建wordpress站点
镜像下载.域名解析.时间同步请点击 阿里云开源镜像站 LNMP是Linux + Nginx + MySQL + PHP 四个系统的首字母缩写,相对于 LAMP(Linux + Apache + My ...
- centos7.5 下LNMP搭建
一.概述 系统版本:centos7.5 软件版本:nginx 1.14.0 :mysql 8.0.12 ;php70w 安装方式:yum安装 所需yum源: 1.阿里云yum源:centos7 和ep ...
- CentOS7 系统基于Vim8搭建Go语言开发环境
链接:https://pdf.us/2018/11/10/2194.html 问题1:vim-go: could not find 'gopls'. Run :GoInstallBinaries to ...
最新文章
- CentOS下python-mysqldb安装
- 一位7亿收入产品经理的五大绝招
- vue学习记录: 遇到过的问题记录
- python之路_文件操作解析
- 8 MyBatis动态SQL
- 什么注解可以改变BigDecimal类型的字段返回的小数位数?
- leetcode数组汇总_[LeetCode] 300. 最长上升子序列
- 【HDU - 5883】The Best Path(判断欧拉回路)
- Python3小程序:把连续的16进制UTF8编码转换为字符串
- 余额宝收益冻结是什么意思?
- 获取小程序 openid
- C++基础::typeid、type_info
- 代码实现21种常见设计模式
- 阿里巴巴中台战略--事务与柔性事务
- Android源码编译过程及刷机过程详解
- 关于Android的方向传感器
- 一个数如果恰好等于它的因子之和,这个数就称为“完数”。例如6=1+2+3.编程找出1000以内的所有完数。
- 阿里X82Y的解决方案及接口
- Microsoft Help Viewer help查看器所需的内容文件缺失或者损坏 解决办法
- 【有感】失去人性,失去很多;失去兽性,失去一切