Apache下同一个IP配置多个虚拟主机
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Apache下同一个IP配置多个虚拟主机
NameVirtualHost192.100.100.1
ServerAdminnjzadmin@
DocumentRoot/wwwroot
ErrorLoglogs/-error_log
Customloglogs/a-Access_logcommon
ServerAdminsonymusic@
DocumentRoot/wwwroot2
ErrorLoglogs/-error_log
CustomLoglogs/-access_logcommon
Apache配置httpd.conf设置一个IP两个域名的方法 如何让两个域名对应同一个IP,然后能识别出不同的网站
本身Virtual Hosting技术分IP-based和Host-based。IP-based Virtual Hosting是指运行网站服务器的计算机有多个 IP地址(IP Address),访问不同的IP地址就可以取得不同的网站。Host-based Virtual Hosting则是指在DNS上多个网域 都是指向同一个IP地址,网页浏览器(WWW Browser)透过HTTP协定告知网页服务器要访问那个网站。
一个IP地址,多域名配置:
Listen 80
NameVirtualHost 61.139.72.10
DocumentRoot /var/www/html/
ServerName
DocumentRoot /var/www/html/
CustomLog /var/www/html/logs/home-access_log common
ServerName
多IP多域名配置:
DocumentRoot "/usr/local/apache/a"
ServerName
ServerAlias
DirectoryIndex index.html index.php
NameVirtualHost 192.168.1.2:80
DocumentRoot "/usr/local/apache/b"
ServerName
ServerAlias
DirectoryIndex index.php
DocumentRoot "/usr/local/apache/c"
ServerName
ServerAlias
DirectoryIndex index.php
------------------------------------------------------------------------------------------
nclude: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog /var/log/httpd/access.log combined ServerSignature On官方给的例子:/docs/2.2/vhosts/examples.html