第一个里程碑: 创建扩展目录, 生成虚拟主机配置文件
- mkdir extra
- sed -n '10,15p' nginx.conf>extra/www.conf
- sed -n '16,21p' nginx.conf>extra/bbs.conf
- sed -n '22,27p' nginx.conf>extra/blog.conf
第二个里程碑: 修改 nginx 主配置文件, 加载相应虚拟主机配置文件
- [root@web01 conf]# cat nginx.conf
- worker_processes 1;
- events {
- worker_connections 1024;
- }
- http {
- include mime.types;
- default_type application/octet-stream;
- sendfile on;
- keepalive_timeout 65;
- include extra/www.conf;
- include extra/bbs.conf;
- include extra/blog.conf;
- }
第三里程碑: 重启服务, 进行检验测试
来源: http://www.bubuko.com/infodetail-2717717.html