基于IP地址的虚拟主机配置
  Listen 80
  DocumentRoot /www/example1
  ServerName www.example1.com
  DocumentRoot /www/example2
  ServerName www.example2.org

  基于IP和多端口的虚拟主机配置
  Listen 172.20.30.40:80
  Listen 172.20.30.40:8080
  Listen 172.20.30.50:80
  Listen 172.20.30.50:8080
  DocumentRoot /www/example1-80
  ServerName www.example1.com
  DocumentRoot /www/example1-8080
  ServerName www.example1.com
  DocumentRoot /www/example2-80
  ServerName www.example1.org
  DocumentRoot /www/example2-8080
  ServerName www.example2.org

  单个IP地址的服务器上基于域名的虚拟主机配置:
  # Ensure that Apache listens on port 80
  Listen 80
  # Listen for virtual host requests on all IP addresses
  NameVirtualHost *:80
  DocumentRoot /www/example1
  ServerName www.example1.com
  ServerAlias example1.com. *.example1.com
  # Other directives here
  DocumentRoot /www/example2
  ServerName www.example2.org
  # Other directives here

  在多个IP地址的服务器上配置基于域名的虚拟主机:
  Listen 80
  # This is the “main” server running on 172.20.30.40
  ServerName server.domain.com
  DocumentRoot /www/mainserver
  # This is the other address
  NameVirtualHost 172.20.30.50
  DocumentRoot /www/example1
  ServerName www.example1.com
  # Other directives here …
  DocumentRoot /www/example2
  ServerName www.example2.org
  # Other directives here …

  在不同的端口上运行不同的站点:
  基于多端口的服务器上配置基于域名的虚拟主机。
  Listen 80
  Listen 8080
  NameVirtualHost 172.20.30.40:80
  NameVirtualHost 172.20.30.40:8080
  ServerName www.example1.com
  DocumentRoot /www/domain-80
  ServerName www.example1.com
  DocumentRoot /www/domain-8080
  ServerName www.example2.org
  DocumentRoot /www/otherdomain-80
  ServerName www.example2.org
  DocumentRoot /www/otherdomain-8080

  基于域名和基于IP的混合虚拟主机的配置:
  Listen 80
  NameVirtualHost 172.20.30.40
  DocumentRoot /www/example1
  ServerName www.example1.com
  DocumentRoot /www/example2
  ServerName www.example2.org
  DocumentRoot /www/example3
  ServerName www.example3.net

  网站泛域名解析
  添加一个虚拟主机配置(如下):
  DocumentRoot d:/web/server110.com # 网站根目录的绝对路径
  ServerName www.server110.com # 网站域名
  ServerAlias *.server110.com # 网站泛域名

原文地址:http://www.server110.com/apache/201310/2783.html

【转】Apache虚拟主机的配置和泛解析域名的绑定的更多相关文章

  1. apache 虚拟主机详细配置:http.conf配置详解

    apache 虚拟主机详细配置:http.conf配置详解 Apache的配置文件http.conf参数含义详解 Apache的配置由httpd.conf文件配置,因此下面的配置指令都是在httpd. ...

  2. Apache虚拟主机的配置

    虚拟主机的配置 基于IP地址的虚拟主机配置Listen 80DocumentRoot /www/example1ServerName www.example1.comDocumentRoot /www ...

  3. Apache虚拟主机(vhost)配置教程

    使用apache来配置虚拟主机,在单一系统上运行多个网站. 现在很多linux主机使用apache作为web服务器的,大部分是基于这个原理来配置虚拟主机的. 下面就windows下以apache 2. ...

  4. Apache 虚拟主机 VirtualHost 配置

    虚拟主机 (Virtual Host) 是在同一台机器搭建属于不同域名或者基于不同 IP 的多个网站服务的技术. 可以为运行在同一物理机器上的各个网站指配不同的 IP 和端口, 也可让多个网站拥有不同 ...

  5. Windows下Apache 虚拟主机 VirtualHost 配置

    以下方式适合原生 Apache, XAMPP 和 WAMP 套件 1.修改Apache配置文件(httpd.conf),如下: # Virtual hostsInclude conf/extra/ht ...

  6. Apache虚拟主机&伪静态配置

    Apache基本操作 安装:yum install httpd 启动:systemctl start httpd 查看进程:ps -ef | grep httpd 查看端口:sudo netstat ...

  7. apache 虚拟主机的配置

    一.基于IP 1. 假设服务器有个IP地址为192.168.1.10,使用ifconfig在同一个网络接口eth0上绑定3个IP: [root@localhost root]# ifconfig et ...

  8. Nginx 虚拟主机 VirtualHost 配置

    Nginx 是一个轻量级高性能的 Web 服务器, 并发处理能力强, 对资源消耗小, 无论是静态服务器还是小网站, Nginx 表现更加出色, 作为 Apache 的补充和替代使用率越来越高. 我在& ...

  9. apache虚拟主机设置泛域名的方法

    在apache虚拟主机中设置泛域名解析,主要是用到ServerAlias 的配置. 1.支持多域名 例如,让mail.jbxue.org.smtp.jbxue.org.pop3.jbxue.org 都 ...

随机推荐

  1. python中出现 “'gbk' codec can't decode byte 0xf3 in position 20: illegal multibyte sequence”问题

    其实是打开文件方法open()中的模式有r,w,a等. 请看: r 以只读方式打开文件.文件的指针将会放在文件的开头.这是默认模式. rb 以二进制格式打开一个文件用于只读.文件指针将会放在文件的开头 ...

  2. [Linux Memory] 用/proc/stat计算cpu的占用率

    转载自:http://blog.csdn.net/pppjob/article/details/4060336 在Linux下,CPU利用率分为用户态,系统态和空闲态,分别表示CPU处于用户态执行的时 ...

  3. Android检测网络连接

    Android检测网络连接 import android.app.AlertDialog; import android.content.Context; import android.content ...

  4. SQL Compare 10.4.8.87 Edition 数据库比较工具 完全破解+使用教程

    一.使用教程 SQL Compare是编程人员常用的比较两个数据库之间差异的工具.可以用来比较数据库里面的对象.比如存储过程,数据库中的数据,表的结构. 下面我就简单介绍一下如何使用 1.选择要比较的 ...

  5. 可视化Tensorboard图中的符号意义

    可视化Tensorboard图中的符号意义

  6. 模拟源码深入理解Vue数据驱动原理(2)

    我们说到如果监听的属性是个对象呢?那么这个对象中的其他属性岂不就是监听不了了吗?如下: 倘若user中的name.age属性变化,如何知道它们变化了呢?今儿,就来解决这一问题. 通过走读Vue源码,发 ...

  7. 扩展JButton实现自己的图片按钮

    实现效果: 代码: import java.awt.Color; import java.awt.Dimension; import java.awt.Font; import java.awt.In ...

  8. Android系统常用的权限

    开机自动允许  android.permission.RECEIVE_BOOT_COMPLETED,允许程序开机自动运行. 电量统计  android.permission.BATTERY_STATS ...

  9. 优秀运维人员20道必会iptables面试题(转载)

    (一)企业面试口试题 1.详述iptales工作流程以及规则过滤顺序? 2.iptables有几个表以及每个表有几个链? 3.iptables的几个表以及每个表对应链的作用,对应企业应用场景? 4.画 ...

  10. 原来这是一个经典面试题-------Day61

    前几天在table的操作中,记录了动态生成表格的三种方式: 1.html语言的拼接:用字符串或者数组拼接在html语言中,这个理解起来最直观 2.插入行和列:insertRow()和insertCel ...