本文記錄在使用WordPress過程當中的問題和解決。php
比較順利沒有問題,具體以下(CentOS 6.5,DO的CentOS7 image裏默認的yum源沒有mysql-serve比較奇怪r):html
安裝apache、mysql和phpmysql
yum install httpd mysql-server mysql php php-mysql
下載wordpress安裝包sql
wget https://wordpress.org/latest.tar.gz
解壓縮wordpress安裝包apache
tar zxvf latest.tar.gz
把wordpress移動到apache目錄下瀏覽器
mv /root/wp/wordpress /var/www/html
修改document root服務器
vi /etc/httpd/conf/httpd.conf
修改:
ServerName www.mydomain.com
並在文件最後增長下面的設置:
<VirtualHost *:80>
DocumentRoot /var/www/html/wordpress
ServerName www.mydomain.com
</VirtualHost>
注意:若是有多個<VirtualHost>,須要在httpd.conf裏啓用下面這個配置:
NameVirutalHost *:80
啓動apache和mysql服務器dom
service httpd start
service mysqld start
建立mysql用戶(在mysql命令行裏)ide
>create database wordpress;
>grant all privileges ON wordpress.* TO 'username'@'localhost' identified by 'mypassword' with grant option; >flush privileges;
此時能夠在瀏覽器裏訪問http://www.mydomain.com進入wordpress的安裝嚮導,並按嚮導完成剩下的設置工做。wordpress
一、若wordpress嚮導提示沒法創建"wp-config.php"文件,可手工在wordpress目錄下創建此文件。
二、上傳圖片時提示「Unable to create directory wp-content/uploads/2014/11. Is its parent directory writable by the server?」或「沒法創建目錄wp-content/uploads/2014/11。有沒有上級目錄的寫權限?」
試了網上一些辦法沒起做用,實際試驗下來這樣解決:
1)在wp-content下創建uploads目錄,並執行「chown -R nobody:nobody uploads」;
2)將wp-content和wp-content/uploads的權限所有設置爲777(chmod 777)。
三、上傳plugin時提示須要ftp用戶名密碼
這也是因爲權限不正確引發的,解決方法是將wordpress所在目錄的全部者設爲apache(在有些系統裏多是www):
chown -R apache /var/www/html/wordpress
四、加載google字體慢致使blog打開很慢
經過安裝插件,用國內鏡像字體網址替代google字體網址。參考連接
(未完待續)