每個IT工程師都期待擁有一個自己的博客站,本文講述在CentOS 6系統LAMP環境下使用WordPress框架構建個人博客站的詳細過程。
—-構建LAMP環境—-
1,安裝apache,mysql php
yum install -y httpd mysql mysql-server php-mysql php php-devel php-gd php-xml
2,設置服務自啟動
chkconfig --level 3 mysqld on chkconfig --level 3 httpd on
3,啟動服務
/etc/init.d/httpd start /etc/init.d/mysqld start
4,更改mysql數據庫配置
[root@www tools]# mysql_secure_installation
Change the root password? [Y/n] y #修改mysql管理員root密碼
New password:
Re-enter new password:
Password updated successfully!
Remove anonymous users? [Y/n] y #刪除匿名用戶
Disallow root login remotely? [Y/n] n #是否禁止root遠程登錄,選擇否
Remove test database and access to it? [Y/n] y #移除test數據庫
Reload privilege tables now? [Y/n] y #使當前更改立即生效
5,新建wordpress數據庫
[root@www tools]# mysql -uroot -p msql>create database wordpress; mysql> exit
——-下載并安裝wordpress
1,下載wordpress壓縮包,并把壓縮包拷貝至html目錄
[root@www tools]# wget https://cn.wordpress.org/wordpress-4.7.4-zh_CN.tar.gz [root@www tools]# tar -zxvf wordpress-4.7.4-zh_CN.tar.gz [root@www tools]# cp -r workspace/* /var/www/html/ [root@www tools]# cd /var/www/html/ [root@www html]# chmod -R 755 ./*
2,修改wordpress的配置文件中的數據庫名稱,以及用戶密碼,使之與之前的配置一致
[root@www html]# mv wp-config{-sample.php,.php} [root@www html]# vim wp-config.php
/** WordPress數據庫的名稱 */ 23 define('DB_NAME', 'database_name_here'); 24 25 /** MySQL數據庫用戶名 */ 26 define('DB_USER', 'username_here'); 27 28 /** MySQL數據庫密碼 */ 29 define('DB_PASSWORD', 'password_here'); 30 31 /** MySQL主機 */ 32 define('DB_HOST', 'localhost');
—安裝完成。

原創文章,作者:yz_heng,如若轉載,請注明出處:http://www.www58058.com/80036