centos7 搭建WordPress详细步骤

WordPress是使用PHP语言开发的博客平台,用户能够在支持PHP和MySQL数据库的服务器上架设属于本身的网站。也能够把 WordPress看成一个内容管理系统(CMS)来使用。我此次实验是把腾讯云上的centos7.4搭建成我的博客。php

#安装LAMP
yum install httpd mariadb mariadb-server php php-mysql -y html

#新建测试php页
echo "<? phpinfo (); ?>" > /var/www/html/phpinfo.php mysql

#启动httpd
systemctl restart httpd sql

#重启防火墙,并容许http经过
systemctl restart firewalld
firewall-cmd --permanent --add-service=http数据库

centos7 搭建WordPress详细步骤

#启动数据库,并设置密码,
systemctl restart mariadb
mysql -u root -p
set password = password('123456');vim

建立数据库centos

MariaDB [(none)]> create database wordpress;服务器

建立用户ide

MariaDB [(none)]> create user 'laotang6'@'localhost' identified by '123456';wordpress

用户受权

MariaDB [(none)]> grant all on wordpress.* to 'laotang6'@'localhost';

centos7 搭建WordPress详细步骤
exit

#安装WordPress中文版
wget https://cn.wordpress.org/wordpress-4.9.4-zh_CN.tar.gz
#解压
tar xzvf wordpress-4.9.4-zh_CN.tar.gz
cd wordpress/

mv * /var/www/html/

cd /var/www/html/

chmod 777 -R wp-content/

#启动httpd
systemctl restart httpd

游览器访问:
centos7 搭建WordPress详细步骤

填入咱们前面建立的数据库跟数据库用户和密码。
centos7 搭建WordPress详细步骤

出现这个状况,咱们在/var/www/html/手动建立文件就能够了
centos7 搭建WordPress详细步骤

vim /var/www/html/wp-config.php
将上图提示的文件内容复制进去

centos7 搭建WordPress详细步骤

centos7 搭建WordPress详细步骤

centos7 搭建WordPress详细步骤

如上,WordPress基础已经配置完成了
接着配置FTP,让WordPress可以下载跟上传文件

yum install vsftpd -y
systemctl restart vsftpd

firewall-cmd --permanent --add-service=ftp
firewall-cmd --reload

新建用户,跟密码
useradd laotang6
passwd laotang6
centos7 搭建WordPress详细步骤

媒体库默认最大文件为2M,
centos7 搭建WordPress详细步骤

咱们这里更改成50M:

vim /etc/php.ini

upload_max_filesize = 50M
post_max_size = 50M

systemctl restart httpd

centos7 搭建WordPress详细步骤

首页:
centos7 搭建WordPress详细步骤

相关文章
相关标签/搜索