新聞中心

EEPW首頁(yè) > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > nginx環(huán)境建好后搭建虛擬站點(diǎn)基本流程

nginx環(huán)境建好后搭建虛擬站點(diǎn)基本流程

作者: 時(shí)間:2016-09-12 來(lái)源:網(wǎng)絡(luò) 收藏

因?yàn)榘岩粔K空的磁盤(pán)掛在 home 上了 ... 建議不要掛在 home 目錄 ...

本文引用地址:http://www.butianyuan.cn/article/201609/303768.htm

cd /home/wwwroot/ (進(jìn)到站點(diǎn)目錄)

mkdir xxx.xxx (創(chuàng)建文件夾,一般以域名命名文件夾)

cd xxx.xxx (進(jìn)入剛才自己創(chuàng)建的文件夾)

1、下載形式:

wget xxx.xxx/xxx.xxx

可以直接的,直接下載到目錄下面,然后解壓 。。。

2、上傳形式:

必須先建個(gè) ftp

puredb 這種形式:

pure-pw useradd xxx.xxxftp -u ftpgroup -d /home/wwwroot/xxx.xxx -m # xxx.xxxftp 是用戶名 ftpgroup 是 ftp 用戶(非虛擬用戶) -d 后跟 xxx.xxxftp 用戶目錄 -m 直接生成 puredb 不用 mkdb

傳好后同樣解壓。

創(chuàng)建mysql賬戶

mysql -u root -p # 回車(chē)輸入密碼

create database xxx.xxx; # 創(chuàng)建數(shù)據(jù)庫(kù) (xxx.xxx 為數(shù)據(jù)庫(kù)名)。

create user 'xxx.xxx'@'localhost' identified by 'password'; # 創(chuàng)建數(shù)據(jù)庫(kù)用戶名 xxx.xxx 為用戶名 password 為用戶名對(duì)應(yīng)的密碼;

grant all privileges on xxx.xxx.* to 'xxx.xxx'@'localhost; # 為 xxx.xxx 這個(gè)數(shù)據(jù)庫(kù)指定 xxx.xxx 這個(gè)數(shù)據(jù)庫(kù)用戶名,并指定所有權(quán)限;

OK 退出;

測(cè)試 新建賬戶是否可用

mysql -u xxx.xxx -p # 輸入剛才的password ;

show databases; # 查看是否有xxx.xxx 這個(gè)數(shù)據(jù)庫(kù);

解壓到剛才新建的那個(gè)站點(diǎn)文件根目錄后:

導(dǎo)入數(shù)據(jù)庫(kù):

用剛才新建的數(shù)據(jù)庫(kù)賬戶登錄,并導(dǎo)入;

source /home/wwwroot/xxx.xxx/xxx.xxx.sql;

OK

創(chuàng)建配置文件

cd /usr/local//conf # 這路徑有環(huán)境決定

不知道路徑可以 whereis

cp default.conf xxx.xxx.conf

vi xxx.xxx.conf

修改 server_name 后的站點(diǎn)名為 www.xxx.xxx; 或者 xxx.xxx 由要求決定 ;

修改 root 后的根目錄為 /home/wwwroot/xxx.xxx 完整路徑

OK

修改 data/com.inc.php 文件

對(duì)應(yīng)數(shù)據(jù)庫(kù)、賬戶、密碼。

最后一步,解析



關(guān)鍵詞: nginx 虛擬站點(diǎn) linux

評(píng)論


相關(guān)推薦

技術(shù)專區(qū)

關(guān)閉