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>
- idea中tomcat快速部署(IDEA编辑器整合Apache Tomcat的详细教程)
- 做网站是使用nginx还是apache(web服务器软件Apache与Nginx的对比分析)
- 如何用wampserver打开自己写的php(WampServer下安装多个版本的PHP、mysql、apache图文教程)
- apache服务配置详解(Apache Web服务器的完全安装指南)
- apache服务器设置301(Apache Rewrite实现URL的301跳转和域名跳转)
- apache各种配置(让Apache支持Rewrite静态页面重写的方法)
- apache配置详解(apache2.2和php5.2.17在windows下整合过程的错误解决方法)
- 搭建php和mysql的运行环境(Windows环境开发PHP完整配置教程Apache+Mysql+PHP)
- apache用户认证配置(apache开启.htaccess及.htaccess的使用方法)
- linux如何查看apache日志(限制 Apache日志文件大小的方法)
- 如何使用自定义discuz代码(Apache,IIS下Discuz x1.5伪静态设置方法)
- nginx和apache服务器配置(Apache、Nginx 服务配置服务器端包含SSI)
- apache实时框架(教你快速开启Apache SkyWalking的自监控)
- apache跳转配置(Apache 的 order deny allow 设置说明)
- dockerfile的镜像原理(dockerfile制作apache镜像的方法)
- apache服务配置详解(apache配置开启网站服务步骤)
- 法国面包(法国面包法棍)
- 微信(微信分身)
- 双十二(双十二和双十一哪个划算)
- 佛肚竹盆景的养护之道(佛肚竹盆景的养护之道)
- 包水饺(包水饺手法怎么包视频)
- 越南河粉(越南河粉来自哪里)
热门推荐
- php7优化技巧(php7性能提升的原因详解)
- php怎么实现多线程(PHP实现的多进程控制demo示例)
- pythonsocket详细用法(Python中的Socket 与 ScoketServer 通信及遇到问题解决方法)
- 超级小旋风asp服务器软件简单使用说明(超级小旋风asp服务器软件简单使用说明)
- docker镜像内安装python包(如何使用Docker搭建pypi私有仓库)
- 用js做一个计算器(使用JS实现简易计算器)
- 如何把阿里云盘加入到快捷操作(阿里云如何挂载数据盘?阿里云挂载数据盘一键脚本)
- html5的文件类型声明(浅析HTML5中的download属性使用)
- 个人如何选择阿里云服务器(个人如何选择阿里云服务器的配置)
- 关系数据库中的范式
排行榜
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9