安裝lnmp到Linux服務器
這一步?jīng)]什么好說的,lnmp.org 提供了各種 Linux 發(fā)行版的一鍵安裝腳本,按照官方的說明安裝就可以了,一般能一次安裝成功。
創(chuàng)建虛擬主機
1、登陸之后輸入 ./vhost.sh,回車
提示:Please input domain(請輸入域名):
輸入你要綁定的域名(頂級域名,不帶www),如:wpzhiku.com,回車
提示:Do you want to add more domain name? (y/n)(想添加更多域名嗎?)
輸入y,按回車
提示:Please input the directory for the domain:wpzhiku.com(請輸入wpzhiku.com的目錄)
輸入二級域名,一般是:m.meixiuxuan.cn,回車
提示:Please input the directory for the domain:wpzhiku.com(請輸入wpzhiku.com的目錄)
不用輸入,直接回車
提示: Allow Rewrite rule? (y/n)(是否允許重定向,最好開啟,WordPress偽靜態(tài)功能需要)
輸入y,回車
提示: Please input the rewrite of programme :(偽靜態(tài)規(guī)則名稱,lnmp內(nèi)置了很多偽靜態(tài)規(guī)則)
輸入wordpress,回車
提示:Allow access_log? (y/n)(是否允許訪問日志)
輸入y,回車
提示:Type access_log name(Default access log file:wpzhiku.com.log):(訪問日志文件名)
不用輸入,直接回車
提示:Press any key to start create virtul host…(點任意鍵開始創(chuàng)建虛擬主機)
按任意鍵,開始創(chuàng)建虛擬主機
提示:
Your domain:wpzhiku.com
Directory of wpzhiku.com: /home/wwwroot/wpzhiku.com
有以上提示說明虛擬主機已經(jīng)創(chuàng)建成功。
創(chuàng)建數(shù)據(jù)庫
打開數(shù)據(jù)庫管理地址:http://你的服務器ip/tools/phpmyadmin/
- 用戶名:root
- 密碼:安裝lnmp時設置的數(shù)據(jù)庫密碼
登陸之后,點擊“用戶》添加用戶”

然后:
- 輸入用戶名,也就是數(shù)據(jù)庫的用戶名
- host(主機),一般選localhost
- 密碼,直接點擊生成密碼,生成一個隨機的密碼
- 用戶數(shù)據(jù)庫,勾選“創(chuàng)建與用戶同名的數(shù)據(jù)庫并授予所有權限”,用戶名也是數(shù)據(jù)庫名
- 然后點擊右下角的執(zhí)行,不出意外的情況下,數(shù)據(jù)庫就可以建好了。



