根據需求安裝相關軟件,搭建實驗環境:
#CentOS 6:Httpd,PHP,mysql-server,php-mysql
#CentOS 7:Httpd,php,php-mysql mariadb-server
-
下載wordpress程序,并解壓至/var/www/html/目錄下
[root@centos077 html]# pwd
/var/www/html
[root@centos077html]#wget https://cn.wordpress.org/wordpress-4.7.4-zh_CN.zip
[root@centos077 html]#unzip wordpress-4.3.1-zh_CN.zip
[root@centos077 html]# ll
總用量 7360
-rw-r–r–. 1 root root 16 4月 16 16:28 index.html
-rwxrwxrwx. 1 root root 111 4月 21 19:48 test2.php
-rw-r–r–. 1 root root 20 4月 21 16:49 test.php
drwxr-xr-x. 5 root root 4096 4月 21 21:27 wordpress
-rw-r–r–. 1 root root 7518362 4月 21 16:03 wordpress-4.3.1-zh_CN.zip
[root@centos077 html]#chmod 777 wordpress
[root@centos077 ~]# systemctl start mariadb.service
[root@centos077 html]#mysql
mysql > create database wpdb; //創建數據庫wpdb
mysql > show databases; //查詢
mysql > grant all privileges on *.* to wpuser@’%’ identified by “walker”; //允許用戶wpuser,密碼walker,從所有主機-‘%’,訪問mysql服務器的所有文件-*.*。
mysql > grant all privileges on *.* to wpuser@’localhost’ identified by “walker”; //允許用戶wpuser,密碼walker,僅從本地主機訪問mysql服務器的所有文件。
mysql> flush privileges; //刷新MySQL的系統權限相關表
-
避免登錄時候名稱被反解,修改/etc/my.cnf添加以下配置
vim /etc/my.cnf
添加skip_name_resolve=on
#瀏覽器打開http://172.18.51.77/wordpress進行頁面安裝:




原創文章,作者:Mr-Xiao,如若轉載,請注明出處:http://www.www58058.com/74373