CentOS/RHEL6.5中使用WordPress快速建站?

Tags: 資料庫, 建站,

WordPress是一種使用PHP語言開發的部落格平臺,使用者可以在支援PHP和MySQL資料庫的伺服器上架設屬於自己的網站

工具/原料

系統:CentOS 6.5

使用工具:MySql php httpd phpMyAdmin3.5 WordPress_CN 4.3

方法/步驟

步驟一:

下載WordPress4.3,phpMyAdmin3.5

https://yunpan.cn/OcukDd47DKzGvd 訪問密碼 2a40

解壓軟體包

tar xf wordpress-4.3.1-zh_CN

tar xf phpMyAdmin-v3.5.2.2-all-languages

使用UTSC 中的yum源

wget -O /etc/yum.repos.d/centos.repo https://lug.ustc.edu.cn/wiki/_export/code/mirrors/help/centos?codeblock=2

安裝軟體

yum install httpd php php-mysql php-mbstring mysql-server

步驟二:

配置Mysql

service mysqld start #啟動Mysql的守護程序

chkconfig mysqld on #將Mysql設定為開機啟動

mysqladmin password “填你的密碼” #設定Mysql root使用者密碼

mysql –uroot –p“填寫你的密碼” –e ‘create database wordpress;’ #建立資料庫

配置Apache Httpd

service httpd start #啟動httpd守護程序

chkconfig httpd on #將httpd設定為開機啟動

mkdir /var/www/wordpress #建立網站主目錄

mv /root/ wordpress-4.3.1-zh_CN/* /var/www/wordpress #將wordpress網頁檔案移到網頁根目錄中

vim /etc/httpd/conf.d/wordpress.conf #配置httpd配置檔案

ServerName www.anyisalin.com #設定你的域名

DocumentRoot /var/www/wordpress #網頁根目錄

儲存退出

service httpd restart #重啟httpd守護程序

restorecon -RFvv /var/www/ #重置一下SElinux上下文

iptables -L #檢查防火牆規則,是否允許80埠通過,iptables -F 暫時清空防火牆規則

chmod –R 777 /var/www/wordpress #設定網站目錄許可權,如果想快速安裝則使用這個,但是不安全

步驟三:

安裝WordPress

開啟瀏覽器,輸入伺服器IP或域名

CentOS/RHEL6.5中使用WordPress快速建站

填寫你剛才配置的Mysql的資訊

CentOS/RHEL6.5中使用WordPress快速建站

點選提交後

如果剛才沒有更改許可權,則會出現這個介面,可以在wordpress網頁主目錄下建立wp-config.conf檔案,將下列資料複製進去

CentOS/RHEL6.5中使用WordPress快速建站

如果剛才修改了許可權,則出現這個介面,點選進行安裝

CentOS/RHEL6.5中使用WordPress快速建站

設定站點資訊,管理員使用者名稱密碼和電子郵件

CentOS/RHEL6.5中使用WordPress快速建站

安裝完成,即可登入

CentOS/RHEL6.5中使用WordPress快速建站

在日常使用時一般使用phpMyAdmin通過Web介面來管理資料庫

PhpMyAdmin配置

剛才將phpMyAdmin 移動到網頁主目錄中

mv phpMyAdmin-v3.5.2.2-all-languages phpadmin #修改phpMyAdmin目錄名稱

vim phpadmin/libraries/config.default.php #修改phpMyAdmin配置檔案

將下面兩行改為

$cfg['Servers'][$i]['user'] = 'root';

$cfg['Servers'][$i]['password'] = 'Mysql資料庫root使用者密碼';

儲存退出

通過瀏覽器進行測試

CentOS/RHEL6.5中使用WordPress快速建站

相關問題答案