阿里云开wordpress

yum install httpd mariadb-server php php-mysql -y
systemctl start httpd
systemctl enable httpd
systemctl start mariadb
systemctl enable mariadb

接下来就是为mysql的root账号设置密码(默认的密码是空)
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.

上面也说了,初次设置Mima为空所以第一步直接回城就wans了

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] Y

上面的意思就是是否设置密码呗,直接点y就完事了
然后输入两次密码

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
… Success!
通常mysql会有一个匿名用户,问你删不删,一般点y删掉

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
… Success!

root用户默认只能访问localhost,以防有人猜密码,是否禁止root登陆,一般选择yes。

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] N
… skipping.

mysql默认创建一个名为test的数据库,这个库任何人都可以访问,是否删除掉,一般不删除。

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] Y
… Success!

意思是上面的修改是否马上生效:输入Y

然后等待mysql的重设

Cleaning up…

All done! If you’ve completed all of the above steps, your MariaDB

installation should now be secure.

这就完事了
然后重启mysql
systemctl restart mariadb

进入mysql数据库
mysql -u root -p
完事后创建一个数据库哦叫wordpress
注意接下来每句命令都要加分号,我之前因为mssql的缘故深受其害,这里折腾了半天

grant all on wordpress.* to wordpress@‘localhost’ identified by ‘wordpress’;

这里是授权命令,给wordpress数据库创立一个专门管理wordpress的用户并授予权限
这里给不懂sql的说一下

某个数据库所有的权限 ALL 后面+ PRIVILEGES

GRANT ALL PRIVILEGES ON 库名.* TO ‘用户’@’%’ IDENTIFIED BY ‘密码’; // *代表所有表, %代表所有IP

mysql
将对象授权用户的基本语句

grant <对象权限列表> on <数据库对象> to <用户列表>

下一句
grant all on wordpress.* to wordpress@’%’ identified by ‘wordpress’;

GRANT -权限- ON 1.库名.表名(全部*) 2.所有数据库 . TO ‘用户名’@‘允许的ip(所有%)’ IDENTIFIED BY ‘用户密码’;

这样 mariadb也算是配置完了
exit
推出

接下来向服务器传wordpress就行,写博客时wordpress官网,不知为何无法访问 没法用wget命令下载

六、测试 PHP 是否安装成功
建立一个 info.php 文件:

vim /var/www/html/info.php
1
然后输入 i 进入编辑模式,在文件中写入下面的 PHP 命令:

<?php phpinfo(); ?>

Esc,退出编辑模式,:wq 保存修改并退出;
在浏览器中输入 ip 地址 /info.php,例如:123.56.183.34/info.php 回车,就可以看到 PHP 的信息了;

测试完成后就rm 删除掉。

使用xshell和xftp可以很方便的上传文件

chmod
t提升权限

chmod -R 777 wp-content/

务必要查看php的版本

centos php版本只有5
wordpress 的php版本最低要7

php -v

php-fpm start
php-fpm enable

一定要看官方的文档

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值