zoukankan      html  css  js  c++  java
  • 2.配置范例站点站点

    配置范例站点站点
    序号
    域名
    目录
    1
    www.heytool.com
    /www/html/www.heytool.com
    2
    bbs.heytool.com
    /www/html/bbs.heytool.com

    修改nginx 配置文件:
    # vi nginx.conf
    user nobody nobody; # 运行 nginx 的所属组和所有者

    Nginx 启动关闭
    # /usr/local/nginx-1.0.6/sbin/nginx //启动 nginx

    # /usr/local/nginx-1.0.6/sbin/nginx –t //测试 nginx 配置文件的准确性
    # /usr/local/nginx-1.0.6/sbin/nginx –s reload //重载 nginx
    # /usr/local/nginx-1.0.6/sbin/nginx –s stop //关闭 nginx
    测试
    创建测试站点
    # mkdir –p /www/html/www.heytool.com
    # mkdir –p /www/html/bbs.heytool.com
    # echo “www.heytool.com” > /www/html/www.heytool.com/index.html
    # echo “bbs.heytool.com” > /www/html/bbs.heytool.com/index.html
    启动nginx
    # /usr/local/nginx-1.0.6/sbin/nginx –t //看到 ok 和 successful,说明配置文件没问题
    nginx: the configuration file /usr/local/ nginx-1.0.6/conf/nginx.conf syntax is ok
    nginx: configuration file /usr/local/ nginx-1.0.6/conf/nginx.conf test is successful
    # /usr/local/nginx-1.0.6/sbin/nginx
    绑定hosts,测试
    把两个域名指向 192.168.1.202
    192.168.1.202 www.heytool.com
    192.168.1.202 bbs.heytool.com
    打开 www.heytool.com,如下图:
    nginx
    打开 bbs.heytool.com,如下图:
    nginx
    完毕!!!!

     

  • 相关阅读:
    2019 SDN阅读作业
    第01组 Alpha冲刺(4/6)
    第01组 Alpha冲刺(3/6)
    第01组 Alpha冲刺(2/6)
    2019 SDN上机第3次作业
    第01组 Alpha冲刺(1/6)
    2019 SDN上机第2次作业
    第01组 团队Git现场编程实战
    1755: [Usaco2005 qua]Bank Interest
    3386/1752: [Usaco2004 Nov]Til the Cows Come Home 带奶牛回家
  • 原文地址:https://www.cnblogs.com/mmdln/p/8949924.html
Copyright © 2011-2022 走看看