1、首先進行lamp框架的搭建
服務器環境:Linux Centos 7.2.1511 64位
內存:2G
磁盤空間100GB
IP地址:10.55.10.79
進行httpd,php,php-mysql,mariadb-server的安裝,安裝均使用yum安裝
~]# yum -y install httpd php php-mysql mariadb-server
進行防火墻和selinux的關閉
systemctl stop firewalld.service
systemctl disable firewalld.service
編輯selinux的配置文檔/etc/sel/etc/selinux/config將SELINUX=選項設置為disable
setenforce=0
2、配置httpd server
創建itblog網站目錄
mkdir /itblog
創建虛擬主機
vim /etc/httpd/conf.d/virtualhosts.conf
<VirtualHost *:80>
ServerName itblog.cptw.com.cn
DocumentRoot "/itblog"
<Directory "/itblog">
Options None
AllowOverride None
Require all granted
</Directory>
</VirtualHost>
注釋掉/etc/httpd/conf/httpd.conf中的DocumentRoot
進行http服務開啟
systemctl start httpd
通過ssl -tnl查看80端口是否已經開啟或者通過systemctl status httpd進行狀態查看
3、配置mariadb,創建wordpress所需的數據庫
root@itblog wordpress]# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 5.5.50-MariaDB MariaDB Server
Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> GRANT ALL ON wpdb.* TO wpuser@'10.%.%.%' IDENTIFIED BY 'wppass';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> create database wpdb
-> ;
Query OK, 1 row affected (0.00 sec)
修改mariadb配置文檔
vim /etc/my.cf
[mysqld]
skip_name_resolve = ON
開啟數據庫systemctl start mariadb.service
4、解壓wordpress至網站目錄
~]#unzip -c wordpress-4.5.3-zh_CN.zip
~]# cp -rf wordpress /itblog
修改wordpress配置文檔
~#] mv wp-config-sample.php wp-config.php
~#]vim wp-config.php
/** WordPress數據庫的名稱 */
[root@itblog wordpress]# vim wp-config.php
define('DB_NAME', 'wpdb');
/** MySQL數據庫用戶名 */
define('DB_USER', 'wpuser');
/** MySQL數據庫密碼 */
define('DB_PASSWORD', '######');
/** MySQL主機 */
define('DB_HOST', '10.55.10.79');
/** 創建數據表時默認的文字編碼 */
define('DB_CHARSET', 'utf8');
此時網站即可正常訪問并進行初始化設置即可
6、 插件安裝
wordpress自帶的文檔編輯插件很土
安裝Kindeditor For WordPress插件即可
安裝插件問題
要執行請求的操作,WordPress需要訪問您網頁服務器的權限。 請輸入您的FTP登錄憑據
http://www.itbulu.com/wordpress-ftp.html
編輯wp-config-php的配置檔,末行添加
define("FS_METHOD", "direct");
define("FS_CHMOD_DIR", 0777);
define("FS_CHMOD_FILE", 0777);
原創文章,作者:N23-蘇州-void,如若轉載,請注明出處:http://www.www58058.com/57393