您现在的位置是:首页 > cms教程 > WordPress教程WordPress教程
centos7安装wordpress教程步骤方法
傲蕾2025-02-18WordPress教程已有人查阅
导读安装之前:建议安装各种软件一、安装apache测试环境建议关闭防火墙和SELinux1.2.1首先需要创建一个存放网站的目录(文件夹)1.2.2修改apache配置文件(默认配置文件是/etc/httpd/conf/http.conf)
安装之前:建议安装各种软件
测试环境建议关闭防火墙和SELinux
1.1安装apache
1.2.1首先需要创建一个存放网站的目录(文件夹)
2.1安装mariadb
Centos7已经没有自带mysql了,默认自带的是Mariadb
3.1安装PHP
3.1.1 配置源:(或者去官网下载更新的版本上传到服务器)
4.1首先登陆MariaDB为WordPress建立数据库及用户
5.1下载wordpress
5.2修改文件夹权限
打开浏览器输入网址:http://test.cn/wp-admin/index.php 然后初始化配置即可
[root@localhost ~]# yum -y install wget zip unzip net-tools
一、安装apache测试环境建议关闭防火墙和SELinux
1.1安装apache
[root@localhost ~]# yum -y install httpd
1.2配置apache1.2.1首先需要创建一个存放网站的目录(文件夹)
[root@localhost ~]# cd /home/
[root@localhost www]# mkdir test //创建站点目录,这里创建了一个test站点目录
1.2.2修改apache配置文件(默认配置文件是/etc/httpd/conf/http.conf)
[root@localhost conf.d]# cd /etc/httpd/conf/
[root@localhost conf]# vim httpd.conf //增加以下内容,红色部分根据自己的实际情况修改
<VirtualHost *:80>
Serveradmin 123456
ServerName.test.cn
DocumentRoot /home/ /test
<Directory "/home/ /test">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*).htmp$ index.html
</IfModule>
</Directory>
</VirtualHost>
[root@localhost conf]# systemctl start httpd
[root@localhost conf]# systemctl enbale httpd
二、安装mariadb(Mysql)2.1安装mariadb
Centos7已经没有自带mysql了,默认自带的是Mariadb
[root@localhost ~]# yum -y install mariadb-server mariadb
[root@localhost ~]# systemctl start mariadb
[root@localhost ~]# systemctl enable mariadb
2.2 初始化mariadb,并配置root密码:
[root@localhost ~]# mysql_secure_installation //初始化mariadb并配置数据库的root密码
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none): (输入原始root密码,默认无,直接回车)
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
Set root password? [Y/n] Y (是否设置root密码,一般都需要设置一个密码)
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] y (是否移除匿名用户,为了安全建议删除)
... skipping.
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] y (是否禁止远程root登陆,为了安全建议禁止)
... skipping.
By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] y (是否删除测试数据库,为了安全,建议删除)
... skipping.
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] Y (重新载入)
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!
[root@localhost ~]#
三、安装PHP3.1安装PHP
3.1.1 配置源:(或者去官网下载更新的版本上传到服务器)
[root@localhost ~]# rpm -Uvh http://mirror.webtatic.com/yum/el7/epel-release.rpm
[root@localhost ~]# rpm -Uvh http://mirror.webtatic.com/yum/el7/webtatic-release.rpm
3.1.2安装fpm和组件,fpm是php的进程管理器
[root@localhost ~]# yum -y install php56w-fpm //(也可以php70w-fpm,或者更高的版本)
[root@localhost ~]# yum search php //查看php有哪些组件
[root@localhost ~]# yum -y install php56w.x86_64 php56w-cli.x86_64 php56w-common.x86_64 php56w-gd.x86_64 php56w-mbstring.x86_64 php56w-mcrypt.x86_64 php56w-mysql.x86_64 php56w-pdo.x86_64 //安装php组件
四、配置WordPress数据库4.1首先登陆MariaDB为WordPress建立数据库及用户
[root@localhost ~]# mysql -u root -p
Enter password: //输入数据库密码进入数据库
MariaDB [(none)]>
MariaDB [(none)]> create database wordpressdb; //新建的数据库为wordpressdb
MariaDB [(none)]> CREATE USER wordpressuser@localhost IDENTIFIED BY '123456'; //新建用户为wordpressuser,密码为123456
MariaDB [(none)]> grant all privileges on wordpressdb.* to wordpressuser@localhost; //并为新建的wordpressuser这个用户赋予@localhost(即本地)的权限
MariaDB [(none)]> flush privileges; //刷新用户权限
MariaDB [(none)]> exit
五、安装WordPress5.1下载wordpress
[root@localhost ~]# cd /home/ /test
[root@localhost test]# wget http://wordpress.org/latest.zip
[root@localhost test]# unzip -q latest.zip
或者可以在windows电脑里面下载好了上传到 /home/ /test这个文件夹5.2修改文件夹权限
[root@localhost test]# chown -R apache:apache /home/ /test
5.3编辑配置文件
[root@localhost ~]# cd /home/ /test/wordpress //进入wordpress解压的目录里面
[root@localhost test]# cp wp-config-sample.php wp-config.php //先把配置文件的原始文件备份一个
[root@localhost test]# vim wp-config.php //修改配置
/** The name of the database for WordPress */
define( 'DB_NAME', 'wordpressdb' ); //修改为第四步自己新建数据库的名称
/** MySQL database username */
define( 'DB_USER', 'wordpressuser' ); //修改为第四步自己新建数据库用户的用户名
/** MySQL database password */
define( 'DB_PASSWORD', '123456' ); //修改为第四步自己新建数据库用户的密码
修改后保存退出,并重启服务
[root@localhost ~]# systemctl restart httpd.service
[root@localhost ~]# systemctl restart mariadb.service
六、登陆wordpress打开浏览器输入网址:http://test.cn/wp-admin/index.php 然后初始化配置即可
本文标签:
很赞哦! ()
图文教程
docker搭建wordpress博客的实现方法
环境:centos7、docker、vmwareworkstation虚拟机1 拉取mysql:5.7 镜像,使用mysql镜像运行一容器2 运行容器 查看状态3 拉取wordpress镜像4 运行wordpress 容器,查看状态
WordPress插件制作添加菜单的方法
上一篇编写了一个简单的插件,让大家对插件的简单制作有个了解,这一篇我们在更深一步,当我们激活插件后后台会显示菜单出来,然后通过单击菜单显示自己定义好的信息。
kali攻击wordpress,trunkey+linux安装wordpress的方法
今天越来越多的企业利用SAAS(Software as a Service)工具应用在他们的业务中。例如,他们经常使用WordPress作为他们网站的内容管理系统,或者在局域网中使用Drupal框架。
wordpress网站怎么添加栏目
用wordpress程序建站时,往往很难去设置产品的大小、重量、单价等参数,好在wordpress有一个自定义栏目功能。
相关源码
-
(自适应)科技产品设备技术作品pbootcms网站模板带下载和招聘基于PbootCMS内核开发的高端科技企业模板,采用响应式布局技术,适配各类移动终端设备。模板设计聚焦科技行业特性,通过模块化结构实现企业形象展示、技术成果发布与人才招募等核心需求查看源码 -
(PC+WAP)蓝色智能环保机械设备网站营销型pbootcms模板下载本模板基于PbootCMS系统开发,为环保设备制造企业设计,特别适合展示环保机械、智能装备等产品。采用响应式技术,确保各类设备参数和技术方案在不同终端上都能清晰展示。查看源码 -
(PC+WAP)绿色资源回收新能源环保设备pbootcms源码下载基于PbootCMS系统深度开发的环保行业模板,特别适配资源回收设备、新能源技术、环境治理装备等企业的线上展示需求。集成产品库、解决方案、环保案例等专业模块,助力企业高效传递绿色价值。查看源码 -
(自适应)英文外贸电子设备网站模板三级子目录基于PbootCMS内核开发的响应式英文网站模板,为外贸企业打造,支持多行业快速适配。通过简洁高效的代码架构,帮助企业低成本构建专业海外形象,实现更好客户触达与订单转化。查看源码 -
(自适应)驾校培训学车活动免费pbootcms源码下载本模板基于PbootCMS内核开发,为驾校培训行业打造,具备完善的招生展示、课程预约、教练团队展示等功能模块。响应式设计适配各类移动终端,数据实时同步管理,助您高效开展线上业务。查看源码 -
pbootcms模板(PC+WAP)火锅加盟餐饮美食类带留言源码基于PbootCMS内核深度开发,为火锅、餐饮品牌打造的营销型解决方案。采用红色主题传递行业活力,实现PC与WAP端适配。查看源码
| 分享笔记 (共有 篇笔记) |

