首先你得擁有自己的雲服務器,我是乘着牛客網活動時買的特價雲服務器 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就可以訪問了