zoukankan      html  css  js  c++  java
  • 搭建网站

    搭建单网站

    搭建www.etiantian.org 
    
            网站流程
            1.修改nginx.conf文件 
    
            worker_processes  1;
            events {
                worker_connections  1024;
            }
            http {
                include       mime.types;
                default_type  application/octet-stream;
                sendfile        on;
                keepalive_timeout  65;
                server {
                    listen       80;
                    server_name  www.etiantian.org 
    
            ;
                    location / {
                        root   html/www;
                        index  index.html index.htm;
                    }
                    error_page   500 502 503 504  /50x.html;
                    location = /50x.html {
                        root   html;
                    }
                }
            }
    
            2.创建环境 
            mkdir -p /application/nginx-1.12.2/html/{www,bbs,blog}
            for name in www bbs blog;do echo $name.etiantian.org 
            > /application/nginx-1.12.2/html/$name/index.html ;done
            
            for name in www bbs blog;do cat /application/nginx-1.12.2/html/$name/index.html ;done
    
            3.检查语法并重启 
    
            [root@oldboyedu-s6 nginx-1.12.2]# /application/nginx-1.12.2/sbin/nginx -t
            nginx: the configuration file /application/nginx-1.12.2/conf/nginx.conf syntax is ok
            nginx: configuration file /application/nginx-1.12.2/conf/nginx.conf test is successful
            [root@oldboyedu-s6 nginx-1.12.2]# /application/nginx-1.12.2/sbin/nginx -s reload 
    
            4.windows测试 浏览器(注意缓存)
            1)修改 etchosts 
            10.0.0.200 
    
              www.etiantian.org 
    
             bbs.etiantian.org 
    
             blog.etiantian.org 
    
             
    
            2)浏览器测试 
    
            5.Linux命令行测试 
            curl -vH Host: www.etiantian.org 
    
             10.0.0.200 

    搭建多网站

    搭建多个网站:
    [root@oldboyedu-s6 nginx-1.12.2]# cat conf/nginx.conf
    worker_processes  1;
    events {
        worker_connections  1024;
    }
    http {
        include       mime.types;
        default_type  application/octet-stream;
        sendfile        on;
        keepalive_timeout  65;
        server {
            listen       80;
            server_name  www.etiantian.org 
    
    ;
            location / {
                root   html/www;
                index  index.html index.htm;
            }
            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
                root   html;
            }
        }
        server {      
            listen       80;
            server_name  bbs.etiantian.org 
    
    ;
            location / {
                root   html/bbs;
                index  index.html index.htm;
            }
            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
                root   html;
            }
        }   
        server {      
            listen       80;
            server_name  blog.etiantian.org 
    
    ;
            location / {
                root   html/blog;
                index  index.html index.htm;
            }
            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
                root   html;
            }
        }   
    
    }
  • 相关阅读:
    关于表格
    split函数
    javac classpath和java classpath
    ORA01460: 转换请求无法实现或不合理 的原因
    业务流程学习(1)
    启动oracle10监听器错误:本地计算机上的OracleOraDb10g_home1TNSListener服务启动后又停止了 解决方案
    CF1594F. Ideal Farm
    CF1373G. Pawns
    CF1373F. Network Coverage
    CF1515F. Phoenix and Earthquake
  • 原文地址:https://www.cnblogs.com/zhongbokun/p/8573974.html
Copyright © 2011-2022 走看看