一,搭建Wordpress實體環境需求:
WordPress 3.3.2的伺服器需求
php 5.2.4 或者更高版本
MySQL 5.0 或者更高版本
二,搭建Wordpress步驟
1.擷取Wordpress軟體包
Wordpress的簡體中文官方網站http://cn.wordpress.org/
2.安裝Wordpress
解壓:tar -zxvf wordpress-3.3.2-zh_CN.tar.gz -C /data/
cd /data/wordpress
cp wp-config-sample.php wp-config.php (只能用cp不能用 mv)
3.Mysql資料庫的配置
mysql>grant all privileges on wordpress.* to wordpress@'Wordpress伺服器IP地址' identified by "wordpress";
4.vim wp-config.php,修改資料庫名,使用者名稱,密碼及其資料庫伺服器的IP地址
// ** MySQL 設定 - 具體資訊來自您正在使用的主機 ** //
/** WordPress 資料庫的名稱 */
define('DB_NAME', 'wordpress');
/** MySQL 資料庫使用者名稱 */
define('DB_USER', 'wordpress');
/** MySQL 資料庫密碼 */
define('DB_PASSWORD', 'wordpress');
/** MySQL 主機 */
define('DB_HOST', 'mysql資料庫的IP地址');
在Apache的主設定檔裡面添加Wordpress虛擬機器主機
5.配置Apache的虛擬機器主機
vim /usr/local/httpd/conf/httpd.conf
<VirtualHost *:8080>
ServerAdmin shifeng_zhang88@163.com
DocumentRoot /data/wordpress
ServerName test.wordpress.com
</VirtualHost>
重啟Apache服務的服務,在用戶端進行測試
6.Wordpress環境測試,如果test.wordpress.com的網域名稱沒有註冊,需要修改原生hosts檔案,在hosts檔案裡面添加如下內容
Wordpress伺服器的IP地址 test.wordpress.com
在瀏覽器輸入下面地址http://test.wordpress.com:8080出現下面的錯誤,初步判斷是沒有許可權訪問。
查看Apache的錯誤記錄檔資訊如下: