apache虚拟主机配置一例

admin3年前主机评测43
复制代码 代码如下:

fivetrees extra # cat httpd-vhosts.conf_bak
#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
#NameVirtualHost *:443
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
#<VirtualHost 192.168.1.66>
#        RewriteEngine On
#        RewriteMap      lowercase       int:tolower
#        RewriteMap      vhost   txt:/usr/local/apache/conf/host.txt
#        RewriteCond     %{HTTP_HOST}    !^$
#        RewriteCond     ${lowercase:%{HTTP_HOST}|NONE}  ^(.+)$
#        RewriteRule     ^/(.*...)$ ${vhost:%1...}/$1
#</VirtualHost>
<VirtualHost *:80>
        DocumentRoot /opt/all_dir
        ServerName *
</VirtualHost>
<VirtualHost *:80>
        DocumentRoot /opt/1
        ServerName 1
</VirtualHost>
<VirtualHost *:80>
        DocumentRoot /opt/2
        ServerName 2
</VirtualHost>

 

#<VirtualHost *:443>
#        DocumentRoot /home/hello
#        ServerName hello.baidu
#</VirtualHost>

免责声明:本文内容来自用户上传并发布,站点仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。请核实广告和内容真实性,谨慎使用。

相关文章

vps主机不能取代虚拟主机的四大理由

众所周知,VPS主机比虚拟主机要“高大上”些,在性能优势上都比虚拟主机好很多。那性能卓越的VPS为什么直到现在都没有完全取代虚拟主机呢?这是因为虚拟主机也有它自身的优势,而且V...

高防御虚拟主机能防止哪些网络攻击

高防御虚拟主机能防止的网络攻击有:1、带宽消耗攻击,包括常见的TCP洪水攻击、UDP及ICMP洪流攻击;2、系统资源消耗攻击,包括恶意误用TCP/IP协议通信和畸形报文攻击;3、对应用层的攻击,包括H...

华夏名网河南vps经典1型(华夏域名官网)

华夏名网是国内知名的域名注册和虚拟主机服务商之一,其在河南地区推出的VPS经典1型备受用户好评。此外,华夏名网还为用户提供了完善的技术支持和售后服务,让用户无后顾之忧。用户可以在官网上直接查询并注册自...

合租虚拟主机怎么用

合租虚拟主机是多个用户共享一台服务器资源的一种虚拟主机服务,使用方法与独立虚拟主机类似,下面是一些使用方法:1、注册账号在合租虚拟主机服务提供商的官网上注册一个账号,并完成认证和支付。2、登录控制面板...

美国虚拟主机分为哪几类

美国虚拟主机的分类:1、根据网站语言分类,分为美国PHP虚拟主机、美国ASP虚拟主机、美国net虚拟主机,及美国JSP虚拟主机等;2、根据操作系统分类,分为美国Linux虚拟主机,美国Windows虚...

云服务器和虚拟主机有哪些不同点

云服务器和虚拟主机的不同点有:1、使用不同,云服务器使用前,要先进行操作系统安装,且后期要时刻关注服务器的各种指标和运行情况,虚拟主机由技术人员设置好一切,用户把网站数据上传到网站空间就能马上使用;2...