1、目標
(1)瞭解LNMP環境的組成。
(2)瞭解LNMP環境的部署與安裝。
(2)瞭解WordPress應用的部署與使用。
2、準備
(1)軟體準備
軟體包
版本
大小
lnmp1。7。tar。gz
1。7
165kB
wordpress-4。7。3-zh_CN。zip
4。7。3
8995KB
CentOS-7-x86_64-DVD-1511。iso
1511
4。03GB
(2)基礎準備
①、準備centos7虛擬機器一臺
②、上傳軟體包到虛擬機器
③、配置本地yum源(使用網路yum源也可以。)
# mount CentOS-7-x86_64-DVD-1511。iso /opt/centos/# cat /etc/yum。repos。d/local。repo[centos]name=centosbaseurl=file:///opt/centosgpgcheck=0enabled=1
3、案例實施
(1)執行lnmp包
# tar -zxf lnmp1。7。tar。gz# cd lnmp1。7。/install。sh
一路下一步即可。
MySQL密碼為:
(2)配置MySQL
# mysql -uroot -plnmp。org#16285mysql> create database wordpress;Query OK, 1 row affected (0。00 sec)mysql> grant all privileges on *。* to root@localhost identified by ‘000000’ with grant option;Query OK, 0 rows affected (0。00 sec)mysql> grant all privileges on *。* to root@“%” identified by ‘000000’ with grant option;Query OK, 0 rows affected (0。01 sec)mysql> Ctrl-C —— exit!
(3)配置wordpress
# 解壓wordpressunzip wordpress-4。7。3-zh_CN。zipls# 刪除nginx預設檔案rm -rf /home/wwwroot/default/index。html# 把wordpress檔案 全部複製到nginx的預設目錄當中cp -rvf wordpress/* /home/wwwroot/default/ls /home/wwwroot/default/# 賦予777許可權chmod 777 /home/wwwroot/default/*# 修改wordpress模板cd /home/wwwroot/default/lscp wp-config-sample。php wp-config。phpvi wp-config。php
(4)驗收
在瀏覽器中輸入虛擬機器IP地址,進入wordpress安裝介面,填寫必要資訊,單機左下角安裝按鈕即可。
安裝完畢後,重新整理頁面,點選登入進入登陸介面,輸入使用者名稱和密碼進入。
4、總結
安裝步驟大致分為:準備虛擬機器➡配置yum源➡安裝lnmp➡配置MySQL➡配置wordpress➡頁面登陸。