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>
- apachephp安装配置教程交流(Apache中利用mod_rewrite实现防盗链)
- nginx反向代理及原理(传说中的反向代理,Nginx+Apache软件配置Web服务器)
- apache和yii域名配置(yii框架数据库关联查询操作示例)
- php框架laravel使用(laravel5环境隐藏index.php后缀apache的方法)
- apache搭建php环境(Windows上安装Apache2、PHP5、MySQL5及与Resin配合实现多系统之整合)
- gzip指令配置参数用法(Gzip在apache2中的设置和squid对它的处理)
- apache虚拟目录配置(Apache 添加虚拟目录注意事项)
- xampp二次安装方法(xampp中apache在windows7下无法启动的解决方法)
- apache实时框架(教你快速开启Apache SkyWalking的自监控)
- web服务器iis安全访问机制(IIS与APACHE实现HTTP重定向到HTTPS)
- linux安装nginx启动页面访问不到(apache,nginx上传目录无执行权限的设置方法)
- apache跳转配置(Apache 的 order deny allow 设置说明)
- 安装apache服务器配置(Apache 配置详解最好的APACHE配置教程)
- discuz apache伪静态(apache中伪静态配置和使用Apache虚拟主机下Discuz伪静态)
- dedecms标签调用原理(DEDECMS安全设置 执行php脚本限制设置方法apache+nginx)
- nginx服务器和apache服务器(Nginx vs Apache两大web服务器比较)
- 怎么做好SEO(怎么做好seo内容优化)
- 冬季钓鱼子线用 长 还是 短(冬季钓鱼子线用)
- 鱼竿 夏钓短,冬钓长 ,一定是这样 认清优缺点在选竿(鱼竿夏钓短冬钓长)
- 鲢鳙钓底还是钓浮 流水的水域应怎样做钓(鲢鳙钓底还是钓浮)
- 入秋后的第二场苹果发布会来了 全新M1系列芯片登场(入秋后的第二场苹果发布会来了)
- 苹果正式发布自研芯片M1 5nm 32核心 彻底放弃Intel(苹果正式发布自研芯片M1)
热门推荐
- vue图片组件使用方法(Vue图片裁剪组件实例代码)
- dedecms怎么调用标签(织梦DEDECMS dede:arclist,dede:list获取附加表字段内容的方法)
- react绑定详解(React列表栏及购物车组件使用详解)
- pandas删除特定条件的行(pandas删除指定行详解)
- dataframe取几列数据(dataframe 按条件替换某一列中的值方法)
- python排列组合计算方法(Python实现的排列组合、破解密码算法示例)
- phpstudy创建网站无权限(phpStudy配置多站点多域名和多端口的方法)
- docker部署redis集群查看版本(docker下的 redis 之持久化存储详解)
- sqlserver数据类型和长度(SqlServer 数据库 三大 范式)
- linux下如何启动phpstudy面板(详解phpstudy linux web面板小皮面板V0.2版本正式发布)
排行榜
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9