apache虚拟主机配置一例

 更新时间:2013年02月09日 20:20:35   作者:  
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>

相关文章

  • Ubuntu修改密码及密码复杂度策略设置方法

    Ubuntu修改密码及密码复杂度策略设置方法

    这篇文章主要介绍了Ubuntu修改密码及密码复杂度策略设置,方法,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下
    2020-08-08
  • Vim如何使用相对行号实现一切操作详解

    Vim如何使用相对行号实现一切操作详解

    在使用用Vim时时常会遇到像复制多行或者想快速向下/向上移动多行时而不知道行数的情况, 今天发现一个Vim对此有帮助的特性: 相对行号,下面这篇文章主要给大家介绍了关于Vim如何使用相对行号实现一切操作的相关资料,需要的朋友可以参考下。
    2017-11-11
  • Linux实现科学上网

    Linux实现科学上网

    本文给大家介绍的是Linux下使用plink ssh + privoxy 实现局域网共享代理,非常的全面细致,这里推荐给大家。
    2015-03-03
  • Linux里Makefile是什么?它是如何工作的?

    Linux里Makefile是什么?它是如何工作的?

    今天小编就为大家分享一篇关于makefile是什么及其工作原理的文章,小编觉得内容挺不错的,现在分享给大家,具有很好的参考价值,需要的朋友一起跟随小编来看看吧
    2018-09-09
  • linux网络NAT配置方式详解

    linux网络NAT配置方式详解

    这篇文章主要为大家详细介绍了linux网络NAT配置方式,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
    2018-08-08
  • 图解linux安装tomcat(附常用命令)

    图解linux安装tomcat(附常用命令)

    这篇文章主要以图片文字结合的方式为大家介绍了linux安装tomcat,并linux操作tomcat一些常用命令,感兴趣的小伙伴们可以参考一下
    2016-01-01
  • Ubuntu 安装Eclipse 菜单无法使用解决办法

    Ubuntu 安装Eclipse 菜单无法使用解决办法

    这篇文章主要介绍了Ubuntu 安装Eclipse 菜单无法使用解决办法的相关资料,需要的朋友可以参考下
    2017-03-03
  • centos把网卡名称修改为eth0的方法

    centos把网卡名称修改为eth0的方法

    本篇文章主要介绍了centos把网卡名称修改为eth0,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
    2017-02-02
  • 在linux服务器下使用版本控制软件SVN的方法

    在linux服务器下使用版本控制软件SVN的方法

    下面小编就为大家分享一篇在linux服务器下使用版本控制软件SVN的方法,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧
    2017-12-12
  • Linux中如何查看已挂载的文件系统类型详解

    Linux中如何查看已挂载的文件系统类型详解

    这篇文章主要给大家介绍了关于在Linux中如何查看已挂载的文件系统类型的相关资料,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
    2018-11-11

最新评论