Linux小課堂開課了(10)-centos 7.3搭建wordpress

centos 7.3搭建wordpress

1、先安裝apache
[root@localhost ~]# yum -y install httpd
[root@localhost ~]# systemctl restart httpd
[root@localhost ~]# systemctl enable httpd
[root@localhost ~]# firewall-cmd --permanent --add-service=http
[root@localhost ~]# firewall-cmd –reload
打開瀏覽器測試
Linux小課堂開課了(10)-centos 7.3搭建wordpress

2、安裝MariaDB數據庫
[root@localhost ~]# yum -y install mariadb-server mariadb
[root@localhost ~]# systemctl restart mariadb
[root@localhost ~]# systemctl enable mariadb
對數據庫進行設置
[root@localhost ~]# mysql_secure_installation
提示輸入數據庫密碼,第一個先回車,接下來設置密碼
Linux小課堂開課了(10)-centos 7.3搭建wordpress
接下來默認選y至結束
Linux小課堂開課了(10)-centos 7.3搭建wordpress

3、安裝php
特別注意,用yum install -y php php-mysql安裝的php版本是php5.4,而安裝wordpress是需要php5.6,所以換一個方法進行安裝
先安裝php軟件yun庫
[root@localhost ~]# rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm
[root@localhost ~]# rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
安裝php5.6
[root@localhost ~]# yum install -y php56w php56w-opcache php56w-xml php56w-mcrypt php56w-gd php56w-mysql php56w-intl php56w-mbstring
Linux小課堂開課了(10)-centos 7.3搭建wordpress
Linux小課堂開課了(10)-centos 7.3搭建wordpress
重啓一下apache服務
root@localhost ~]# systemctl restart httpd
測試一下php
[root@localhost ~]# vim /var/www/html/info.php
<?php
phpinfo();
?>
打開瀏覽器測試一下
Linux小課堂開課了(10)-centos 7.3搭建wordpress

4、安裝phpMyAdmin
先安裝epel
[root@localhost ~]# yum install -y epel-release,再安裝phpMyAdmin
[root@localhost ~]# yum -y install phpmyadmin
Linux小課堂開課了(10)-centos 7.3搭建wordpress
phpMyAdmin的httpd設置,配置文件爲/etc/httpd/conf.d/phpMyAdmin.conf
[root@localhost ~]# vim /etc/httpd/conf.d/phpMyAdmin.conf
Linux小課堂開課了(10)-centos 7.3搭建wordpress
修改後如圖
Linux小課堂開課了(10)-centos 7.3搭建wordpress
Wq保存好後重啓apache服務
[root@localhost ~]# systemctl restart httpd
打開瀏覽器測試
Linux小課堂開課了(10)-centos 7.3搭建wordpress

5、創建wordpress數據庫
登錄數據庫
[root@localhost ~]# mysql -u root –p
創建數據庫
MariaDB [(none)]> CREATE DATABASE wordpress;
設置數據庫用戶名與密碼
MariaDB [(none)]> CREATE USER wordpressuser@localhost IDENTIFIED BY 'wordress_password';
設置wordpressuser訪問wordpress數據庫權限
MariaDB [(none)]> GRANT ALL PRIVILEGES ON wordpress.* TO wordpressuser@localhost IDENTIFIED BY 'wordress_password';

刷新數據庫設置
MariaDB [(none)]> FLUSH PRIVILEGES;

6、安裝wordpress
[root@localhost ~]# cd /var/www/html/
[root@localhost html]# mkdir opt
[root@localhost html]# mkdir wordpress
[root@localhost html]# cd opt
[root@localhost opt]# wget https://cn.wordpress.org/wordpress-4.9.1-zh_CN.tar.gz
[root@localhost opt]# tar xzvf wordpress-4.9.1-zh_CN.tar.gz -C /var/www/html/wordpress/
[root@localhost opt# cd /var/www/html/wordpress/wordpress/
[root@localhost wordpress]# cp wp-config-sample.php wp-config.php
編輯wp-config.php
[root@localhost wordpress]# vim wp-config.php
Linux小課堂開課了(10)-centos 7.3搭建wordpress

打開瀏覽器
Linux小課堂開課了(10)-centos 7.3搭建wordpress
輸入http://192.168.11.137/wordpress/wordpress/wp-admin/install.php

Linux小課堂開課了(10)-centos 7.3搭建wordpress
Linux小課堂開課了(10)-centos 7.3搭建wordpress
Linux小課堂開課了(10)-centos 7.3搭建wordpress
Linux小課堂開課了(10)-centos 7.3搭建wordpress
此刻,centos 7.3搭建wordpress完成。

未完,待續~

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章