apache虚拟主机配置一例
作者:
apache虚拟主机配置一例,有需要的朋友可以参考下
复制代码 代码如下:
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:http://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.com
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /opt/2
ServerName 2.com
</VirtualHost>
#<VirtualHost *:443>
# DocumentRoot /home/hello
# ServerName hello.baidu.com
#</VirtualHost>
您可能感兴趣的文章:
- apache虚拟主机三种配置方式小结
- 在Apache服务器上添加虚拟主机功能的方法
- 给Apache虚拟主机增加端口的方法
- apache服务器一个ip(如:127.0.0.1)和多个域名(虚拟主机)的绑定
- apache虚拟主机的配置指南
- apache中使用mod_gnutls模块实现多个SSL站点配置(多个HTTPS协议的虚拟主机)
- apache配置虚拟主机的方法详解
- 13个实用的Apache Rewrite重写规则
- Apache伪静态Rewrite详解
- Apache Rewrite实现URL的301跳转和域名跳转
- Apache Rewrite url重定向功能的简单配置
- 用ISAPI_Rewrite让IIS也支持如Apache下.htaccess的URL重写
- Apache中Virtual Host虚拟主机配置及rewrite参数说明