apache虚拟域名配置(Apache虚拟主机的配置和泛域名解析实现代码)
apache虚拟域名配置
Apache虚拟主机的配置和泛域名解析实现代码
虚拟主机的配置
基于IP地址的虚拟主机配置
Listen 80
DocumentRoot /www/zz
ServerName www.zz.net
DocumentRoot /www/zz2
ServerName www.zz2.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/zz-80
ServerName www.zz.net
DocumentRoot /www/zz-8080
ServerName www.zz.net
DocumentRoot /www/example2-80
ServerName www.zz.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/zz
ServerName www.zz.net
ServerAlias zz.net. *.zz.net
# 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/zz
ServerName www.zz.net
# 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.zz.net
DocumentRoot /www/domain-80
ServerName www.zz.net
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/zz
ServerName www.zz.net
DocumentRoot /www/example2
ServerName www.example2.org
DocumentRoot /www/example3
ServerName www.example3.net
网站泛域名解析
添加一个虚拟主机配置(如下):
DocumentRoot d:/web/zz # 网站根目录的绝对路径
ServerName www.zz.net # 网站域名
ServerAlias *.zz.net # 网站泛域名
APACHE泛域名配置参考
NameVirtualHost 192.168.0.110
<VirtualHost 192.168.0.110:80>
DocumentRoot "E:/InterRoot/workplace/"
ServerName www.workplace.com
<Directory "E:/InterRoot/workplace/">
AllowOverride FileInfo
Options Indexes FollowSymLinks Includes
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost 192.168.0.110:80>
DocumentRoot "E:/InterRoot/busymouse_test/"
ServerName www.test.com
<Directory "E:/InterRoot/busymouse_test/">
AllowOverride FileInfo
Options Indexes FollowSymLinks Includes
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost 192.168.0.110:80>
DocumentRoot "E:/InterRoot/iptv_for_browser/auth"
ServerName auth.billing.com
ServerAlias auth.billing.com *.auth.billing.com
#泛域名解析
ErrorLog "E:/InterRoot/iptv_for_browser/serverlog/apache.log"
<Directory "E:/InterRoot/iptv_for_browser/auth">
AllowOverride FileInfo
Options Indexes FollowSymLinks Includes
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost 192.168.0.110:80>
DocumentRoot "E:/InterRoot/iptv_for_browser/api"
ServerName voiz.billing.com
ErrorLog "E:/InterRoot/iptv_for_browser/serverlog/apache.log"
<Directory "E:/InterRoot/iptv_for_browser/api">
AllowOverride FileInfo
Options Indexes FollowSymLinks Includes
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost 192.168.0.110:80>
DocumentRoot "E:/InterRoot/iptv_for_browser/user"
ServerName user.billing.com
ErrorLog "E:/InterRoot/iptv_for_browser/serverlog/apache.log"
<Directory "E:/InterRoot/iptv_for_browser/user">
AllowOverride FileInfo
Options Indexes FollowSymLinks Includes
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost 192.168.0.110:80>
DocumentRoot "E:/InterRoot/iptv_for_browser/center"
ServerName center.billing.com
ErrorLog "E:/InterRoot/iptv_for_browser/serverlog/apache.log"
<Directory "E:/InterRoot/iptv_for_browser/center">
AllowOverride FileInfo
Options Indexes FollowSymLinks Includes
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost 192.168.0.110:80>
DocumentRoot "E:/InterRoot/iptv_for_browser/img"
ServerName img.billing.com
ErrorLog "E:/InterRoot/iptv_for_browser/serverlog/apache.log"
<Directory "E:/InterRoot/iptv_for_browser/img">
AllowOverride FileInfo
Options Indexes FollowSymLinks Includes
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost 192.168.0.110:80>
DocumentRoot "E:/InterRoot/iptv_for_browser/log"
ServerName log.billing.com
ErrorLog "E:/InterRoot/iptv_for_browser/serverlog/apache.log"
<Directory "E:/InterRoot/iptv_for_browser/log">
AllowOverride FileInfo
Options Indexes FollowSymLinks Includes
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost 192.168.0.110:80>
DocumentRoot "E:\InterRoot\billing_new\front"
ServerName admin.billing.com
ErrorLog "E:/InterRoot/iptv_for_browser/serverlog/apache.log"
<Directory "E:\InterRoot\billing_new\front">
AllowOverride FileInfo
Options Indexes FollowSymLinks Includes
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
- apache安全配置(apache在win2003下的安全设置配合文件夹权限目录,很好很安全)
- 怎么搭建apache服务器(Apache配置多个站点的方法)
- nginx和apache服务器配置(Apache、Nginx 服务配置服务器端包含SSI)
- apachessl证书怎么获取(Apache SSL服务器配置SSL详解)
- 怎么用apache自定义网站根目录(Apache 二级域名实现方法介绍)
- 静态web服务器nginx(WEB服务器该选择 Apache 还是 Nginx?)
- discuz apache伪静态(apache中伪静态配置和使用Apache虚拟主机下Discuz伪静态)
- jvm运动数据区总结(JVM上高性能数据格式库包Apache Arrow入门和架构详解Gkatziouras)
- phpstudy8.0使用教程视频(phpstudy v8.1 Apache伪静态配置图文教程)
- apache各种配置(让Apache支持Rewrite静态页面重写的方法)
- 自己搭建域名解析服务器(apache 二级域名解析实现方法)
- clickhouse 底层架构(使用 Apache Superset 可视化 ClickHouse 数据的两种方法)
- apache搭建php环境(Windows上安装Apache2、PHP5、MySQL5及与Resin配合实现多系统之整合)
- 安装apache服务失败怎么办(Apache安装后出现服务无法启动服务里启动出现错误代码1)
- nginx更改html内容(apache与iis下让html格式的页面也同样具有shtml的动态解析)
- apache 的服务器配置(正确维护配置Apache服务器的方法 保护系统安全)
- 韩国泡菜做法(韩国泡菜的做法步骤)
- 泰国旅游攻略(泰国旅游攻略必去景点)
- 越难春卷(越难春卷皮怎么用)
- 休闲VS新古典 办公家居简约设计(办公家居简约设计)
- 15个新成 园 位置公布 深圳龙岗2022年共建花园建设又有大动作(15个新成园位置公布)
- 记者手记 书记带我去 巡街(记者手记书记带我去)
热门推荐
- python编写小程序实现密码验证(python实现扫描ip地址的小程序)
- MVC中outputcache缓存
- python 简单算法(python实现爬山算法的思路详解)
- Python实现模拟点击(用python实现刷点击率的示例代码)
- mysql 索引举例(MySQL 各个索引的使用详解)
- docker里面安装redis(Docker上实现Redis集群搭建)
- javascript动作事件有哪些(JavaScript之事件循环案例讲解)
- python自动处理图片(python制作图片缩略图)
- 读取浏览器历史的行为(解析浏览器的一些“滚动”行为鉴赏)
- linux怎么退出括号模式(Linux使用stty显示修改终端行设置)
排行榜
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9