# 1.git clone 最新 Vanilla 版本(或者下载相应的 Vanilla release 版本)
git clone https://github.com/idevz/vanilla.git
# 2. 切换到 Vanilla 文件夹
cd vanilla
# 3.编译 vanilla: ./setup-framework -v $VANILLA_PROJ_ROOT -o $OPENRESTY_ROOT 其中 $VANILLA_PROJ_ROOT 为 vanilla 框架安装目录。 -o 为 openresty 安装目录
./setup-framework -v /application/vanilla -o /application/openresty
#1. 创建 vanilla 的运行用户
useradd -s /sbin/nologin -M nginx
id nginx # 可以查看到创建的用户
# 2、创建 vanilla 项目, -a 为 项目路径,-u 为执行用户 -g 为用户组 (在根目录 /home/webserver 下创建名为 cms 的项目)
./setup-vanilla-demoapp -a /home/webserver/cms -u nginx -g nginx
# 3、删掉默认 Nginx 服务
pkill -9 nginx
# 4、切换到项目文件夹 编辑项目配置文件,改成你要的
cd /home/webserver/cms
cd nginx_conf
vim va-nginx.conf
vim va-nginx-development.conf
# 5、同步配置文件到运行目录
./va-cms-service initconf dev -f #开发模式
./va-cms-service initconf -f #生产模式
# 6、启动项目(2选1)
./va-cms-service start dev # 启动开发模式
./va-cms-service start # 启动生产模式