apache单ip多域名多目录配置Demo
来源:互联网 发布:向着网络强国杨帆远航 编辑:程序博客网 时间:2024/05/17 08:31
配置httpd.conf文件
比如原来是这种只是指向一个目录的配置
DocumentRoot "/opt/lampp/htdocs/ppe112"<Directory "/opt/lampp/htdocs/ppe112"> # # Possible values for the Options directive are "None", "All", # or any combination of: # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews # # Note that "MultiViews" must be named *explicitly* --- "Options All" # doesn't give it to you. # # The Options directive is both complicated and important. Please see # http://httpd.apache.org/docs/trunk/mod/core.html#options # for more information. # #Options Indexes FollowSymLinks # XAMPP Options Indexes FollowSymLinks ExecCGI Includes # # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit # #AllowOverride None # since XAMPP 1.4: AllowOverride All # # Controls who can get stuff from this server. # Require all granted</Directory>
把这段话变成
<VirtualHost 198.199.107.XXX> #重点这里填主机的内网ip地址 ServerName www.AAA.com DocumentRoot "/opt/lampp/htdocs/AAA" <Directory "/opt/lampp/htdocs/AAA"> Options Indexes FollowSymLinks ExecCGI Includes AllowOverride All Require all granted </Directory></VirtualHost><VirtualHost 198.199.107.XXX> #重点这里填主机的内网ip地址 ServerName www.BBB.com DocumentRoot "/opt/lampp/htdocs/BBB" <Directory "/opt/lampp/htdocs/BBB"> Options Indexes FollowSymLinks ExecCGI Includes AllowOverride All Require all granted </Directory></VirtualHost>
这样就实现了AAA网站和BBB网站同时在服务器上共存,外部两个域名指向同一个ip,内部解析到不同服务器目录的操作。
PS:这里这里只能正常访问www.AAA.com www.BBB.com这两个,如果要直接访问AAA.com BBB.com 也需要如上再配置一遍。
0 0
- apache单ip多域名多目录配置Demo
- apache单ip多域名多目录配置
- apache + tomcat 单IP多域名多应用配置(1)
- apache + tomcat 单IP多域名多应用配置(2)
- apache本地虚拟主机配置(多域名,单IP)【转】
- apache 本地配置虚拟主机,单ip多域名
- 利用Apache进行单IP多域名配置
- centos下apache多域名单ip配置
- 关于Apache的单IP多域名和二级域名的配置
- apache虚拟主机设置(单IP多域名)
- apache 配置---- 同一个域名配置多个root目录
- Nginx 单IP绑定多域名配置 顶级域名重定向到www域名
- Apache配置多域名
- Apache配置多域名
- apache配置多域名
- apache多域名配置
- apache多域名配置
- apache多目录多域名
- iframe异步加载技术及性能
- android watson
- 使用Tomcat+Redis来实现集群部署中的Session共享问题
- 风功率预测系统
- Qt QuaZip 解压zip文件
- apache单ip多域名多目录配置Demo
- js获取元素高度比较
- 白盒测试中的六种覆盖方法及案例分析
- IE浏览器兼容问题
- 靠谱阿姨 APP 个人原创设计
- 如果你也和我一样茫然
- java集合框架概述
- GreenDao查询,有时会查不到数据,解决方法。
- spring Bean的实例化