• 搭建网站


    搭建单网站

    搭建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;
            }
        }   
    
    }
  • 相关阅读:
    傻瓜教程:asp.net(c#) 如何配置authentication,完成基于表单的身份验证
    ajax与php交互的get和post两种实现方式
    php 存储过程
    一万小时天才理论
    servlet阅读
    post and get
    合并两个有序数组(重新开始)
    Java参数传递问题
    一万小时(如何实现)阅读
    java IO 流的学习(我们到底能走多远系列1)
  • 原文地址:https://www.cnblogs.com/zhongbokun/p/8573974.html
Copyright © 2020-2023  润新知