行业资讯

首页 > 新闻资讯 > 行业资讯 > apache虚拟主机配置一例

apache虚拟主机配置一例

2025-05-17 07:22:29   来源:   阅读:
复制代码 代码如下:
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
#
# 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 block.
#
#
# 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
#


DocumentRoot /opt/all_dir
ServerName *


DocumentRoot /opt/1
ServerName 1.com


DocumentRoot /opt/2
ServerName 2.com

#
# DocumentRoot /home/hello
# ServerName hello.baidu.com
#

本文《apache虚拟主机配置一例》发布于君君营销文章,作者:admin,如若转载,请注明出处:/news/hyzx/92162.html,否则禁止转载,谢谢配合!

联系我们

18221295083
上海市浦东新区航头镇沪南公路4583号
上海市青浦区蟠龙路899号
18221295083
zhanglongfu@ijunjun.com
  • 联系我们
  • 关于我们
  • 二维码


    官方微信

    小程序
    返回
    顶部
    咨询

    扫描微信二维码,添加好友

    电话

    24小时电话:

    18221295083
    微信

    官方微信