zoukankan      html  css  js  c++  java
  • Apache多站点设定

    多端口

    vi httpd.conf
    Listen 8090
    <VirtualHost *:8090>
      ServerName  localhost
      Documentroot  "/Users/dir/8090"
    </virtualHost>
    <Directory "/Users/dir/8090">
        Options Indexes FollowSymLinks
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>
    

    另外一种方式

    vhost设定
    
    http.conf
    <Directory />
    
        AllowOverride none
    
        #Require all denied
    
    </Directory>
    
    加载vhost.conf
    
    
    vhost.conf 
    <VirtualHost *:80>
        #ServerAdmin webmaster@dummy-host2.example.com
        DocumentRoot "/Users/zhoutingze/project/maturi/maturi/docroot/web"
        ServerName adtuu-project.com
        ServerAlias www.adtuu-project.com
        #ErrorLog "logs/dummy-host2.example.com-error_log"
        #CustomLog "logs/dummy-host2.example.com-access_log" common
    </VirtualHost>
    
    <Directory "/Users/zhoutingze/project/maturi/maturi/docroot/web">
           Options Indexes FollowSymLinks Includes ExecCGI
           AllowOverride All
           Order allow,deny
           Allow from all
    </Directory>
    
    
    
    <VirtualHost *:80>
        #ServerAdmin webmaster@dummy-host2.example.com
        DocumentRoot "/Users/zhoutingze/webroot"
        ServerName adtuu-server.com
        ServerAlias www.adtuu-server.com
        #ErrorLog "logs/dummy-host2.example.com-error_log"
        #CustomLog "logs/dummy-host2.example.com-access_log" common
    </VirtualHost>
    
    <Directory "/Users/zhoutingze/webroot">
           Options Indexes FollowSymLinks Includes ExecCGI
           AllowOverride All
           Order allow,deny
           Allow from all
    </Directory>
    
    
    
    
    
    # Virtual Hosts
    #
    # Required modules: mod_log_config
    
    # If you want to maintain multiple domains/hostnames on your
    # machine you can setup VirtualHost containers for them. Most configurations
    # use only name-based virtual hosts so the server doesn't need to worry about
    # IP addresses. This is indicated by the asterisks in the directives below.
    #
    # Please see the documentation at 
    # <URL:http://httpd.apache.org/docs/2.4/vhosts/>
    # for further details before you try to setup virtual hosts.
    #
    # You may use the command line option '-S' to verify your virtual host
    # configuration.
    
    #
    # VirtualHost example:
    # Almost any Apache directive may go into a VirtualHost container.
    # The first VirtualHost section is used for all requests that do not
    # match a ServerName or ServerAlias in any <VirtualHost> block.
    #
    <VirtualHost *:80>
        #ServerAdmin webmaster@dummy-host2.example.com
        DocumentRoot "/Users/zhoutingze/project/maturi/maturi/docroot/web"
        ServerName adtuu-project.com
        ServerAlias www.adtuu-project.com
        #ErrorLog "logs/dummy-host2.example.com-error_log"
        #CustomLog "logs/dummy-host2.example.com-access_log" common
    </VirtualHost>
    
    <Directory "/Users/zhoutingze/project/maturi/maturi/docroot/web">
           Options Indexes FollowSymLinks Includes ExecCGI
           AllowOverride All
           Order allow,deny
           Allow from all
    </Directory>
    
    
    
    <VirtualHost *:80>
        #ServerAdmin webmaster@dummy-host2.example.com
        DocumentRoot "/Users/zhoutingze/webroot"
        ServerName adtuu-server.com
        ServerAlias www.adtuu-server.com
        #ErrorLog "logs/dummy-host2.example.com-error_log"
        #CustomLog "logs/dummy-host2.example.com-access_log" common
    </VirtualHost>
    
    <Directory "/Users/zhoutingze/webroot">
           Options Indexes FollowSymLinks Includes ExecCGI
           AllowOverride All
           Order allow,deny
           Allow from all
    </Directory>
    

      

  • 相关阅读:
    Django 06模板语言的复用
    Django 07模型层—单表操作
    Django 05模板-变量、过滤器、 标签
    Django 04(视图层基础01)
    Django 03 (路由层基础)
    Django--02(项目创建,数据请求迁移,单表orm增删改查)
    Web 文本、reset操作、高级选择器、边界圆角、a的四大伪类、精灵图
    web前端 基础选择器、长度与颜色、display、嵌套、盒模型
    MySQL之数据库的常用语句
    PHP中级篇 Apache配置httpd-vhosts虚拟主机总结及注意事项(转载)
  • 原文地址:https://www.cnblogs.com/adtuu/p/4723521.html
Copyright © 2011-2022 走看看