如何在CentOS7上安装WordPress个人博客

首先你得拥有自己的云服务器,我是乘着牛客网活动时买的特价云服务器 9元白嫖一年 真香

这里介绍一个快速ssh自己服务器的方法 在~/.ssh/config文件中写下

Host cloudPC 
    Hostname xxx.xxx.xxx.xxx 
    Port 22
    User root 

这里的Hostname就是你的主机ip

 

1.安装Apache PHP Mariadb 

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

并且在这里设置开机启动 如果要查看unit运行状态可以通过

systemctl status httpd
systemctl status mariadb

2.初始化你的数据库

#初始化数据库密码
mysql_secure_installation

#中间记得自己设置密码啦

#创建一个数据库wordpress
mysql -u root -p
MariaDB [(none)]> create database wordpress character set utf8 collate utf8_bin;
MariaDB [(none)]> grant all on wordpress.* to  wordpress@'localhost' identified by 'wordpress';
MariaDB [(none)]> grant all on wordpress.* to  wordpress@'%' identified by 'wordpress';
MariaDB [(none)]> exit

3.安装你的WordPress

#下载包
wget https://cn.wordpress.org/wordpress-4.8.1-zh_CN.tar.gz
tar -zxf wordpress-4.8.1-zh_CN.tar.gz /var/www/html
systemctl restart httpd
#接下来在浏览器输入你的 主机IP/wordpress 就可以访问了

这里默认你没有修改 /etc/httpd/conf/httpd.conf  文件内容 

注意 修改这个文件可以修改访问云服务器时进入的文件夹哦

4.最后的最后

根据网页的提示进行安装 要在 /var/www/html/wordpress/中设置wp-config.php就可以访问了

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值