centos7之安装wordpress

前端之家收集整理的这篇文章主要介绍了centos7之安装wordpress前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

wordpress安装教程如下:

MysqL安装可以参考我的博客园Centos构建Java环境:https://www.cnblogs.com/youcong/p/9118753.html

1.安装apache
yum install httpd

systemctl start httpd

2.安装PHP

yum install -y PHP PHP-MysqL
systemctl restart httpd

vim /var/www/html/info.PHP

<?PHP PHPinfo(); ?>


3.安装PHPmyadmin(补充说明:安装MysqL教程不论是centos还是ubuntu,可以参考我的博客文章)
yum install -y epel-release
yum install -y PHPmyadmin

vim /etc/httpd/conf.d/PHPMyAdmin.conf

配置文件内容如下:

<Directory /usr/share/PHPMyAdmin/>
   AddDefaultCharset UTF-8

   IfModule mod_authz_core.c>
     # Apache 2.4
     RequireAny
    #   Require ip 127.0.0.1
     #  Require ip ::1
      Require all granted
   </>
   IfModule!mod_authz_core.c
     # Apache 2.2
     Order Deny,Allow
     Deny from All
     Allow from 127.0.0.1
     Allow from ::1
   >
Directory>

/usr/share/PHPMyAdmin/setup/>
   
       Require ip 127.0.0.1
       Require ip ::1
     >
</Directory>

重启httpd服务器
systemctl restart httpd

安装完PHPmyadmin一定要输入对应的地址进入PHPMyAdmin管理平台
进入该平台进行用户添加和数据添加
也可以通过命令行的形式:
例如:
# 登录数据库
MysqL -u root -p
# 创建数据库
CREATE DATABASE wordpress;
# 创建数据库用户和密码
CREATE USER wordpressuser@localhost IDENTIFIED BY '123456';
# 设置wordpressuser访问wordpress数据库权限
GRANT ALL PRIVILEGES ON wordpress.* TO wordpressuser@localhost IDENTIFIED BY '123456';
# 刷新数据库设置
FLUSH PRIVILEGES;
# 退出数据库
exit

4.安装wordpress
http://wordpress.org/latest.tar.gz
tar -xzvf latest.tar.gz

解压后并在当前目录下执行:sudo rsync -avP ~/wordpress/ /var/www/html/wordpress/

# 切换到wordpress目录
cd /var/www/html/wordpress
# 复制wp-config.php文件
cp wp-config-sample.PHP wp-config.php
# 编辑wp-config.php文件
sudo vim wp-config.php

默认内容如下:
// ** MysqL settings - You can get this info from your web host ** //
/** The name of the database for wordpress */
define('DB_NAME','database_name_here');
/** MysqL database username */
define('DB_USER','username_here');
/** MysqL database password */
define('DB_PASSWORD','password_here');
/** MysqL hostname */
define('DB_HOST','localhost');

将其修改为:

// ** MysqL settings - You can get this info from your web host ** //
/** The name of the database for wordpress */
define('DB_NAME','wordpress');
/** MysqL database username */
define('DB_USER','wordpress');
/** MysqL database password */
define('DB_PASSWORD','123456');
/** MysqL hostname */
define('DB_HOST','localhost');

完成后在浏览器输入地址:www.example.com/wordpress/wp-admin/install.PHP
按照步骤来,一步一步安装。

猜你在找的Linux相关文章