首先你得拥有自己的云服务器,我是乘着牛客网活动时买的特价云服务器 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就可以访问了