Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[已解决] apache 同一个IP,同一个端口,绑定多个域名

[复制链接]
allney 发表于 2010-7-26 17:27:04 | 显示全部楼层 |阅读模式
在httpd.conf配置文件中加入一下配置:
NameVirtualHost 10.1.26.195
<VirtualHost 10.1.26.195>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot "E:/wwwroot"
    ServerName http://10.1.26.195/sg-erphr
    DirectoryIndex index.php
    ErrorLog "E:/wwwroot/ErrorLog"
    CustomLog "E:/wwwroot/CustomLog"
</VirtualHost>
<VirtualHost 10.1.26.195>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot "F:/wwwroot"
    ServerName http://10.1.26.195/bbs
    DirectoryIndex index.php
    ErrorLog "F:/wwwroot/ErrorLog"
    CustomLog "F:/wwwroot/CustomLog"
</VirtualHost>
启动apache报错:the requested operation has failed
遇到这样的问题怎么解决,谢谢,我是在内网中搭建的
showwell 发表于 2010-7-26 17:36:38 | 显示全部楼层
本帖最后由 showwell 于 2010-7-26 17:44 编辑

ServerName 后面的改成域名
参考这个
NameVirtualHost *:80

<VirtualHost *:80>

ServerName www.domain.tld
ServerAlias domain.tld *.domain.tld
DocumentRoot /www/domain

</VirtualHost>

<VirtualHost *:80>

ServerName www.otherdomain.tld
DocumentRoot /www/otherdomain

</VirtualHost>
回复

使用道具 举报

 楼主| allney 发表于 2010-7-27 13:54:05 | 显示全部楼层
回复 showwell 的帖子


    还是不行.我把现在的配置贴出来,现在情况是前面一个VirtualHost可以访问,后面那个VirtualHost 不能访问.
NameVirtualHost 10.1.26.195
<VirtualHost 10.1.26.195>
    ServerAdmin admin@cognos
    ServerName zzxhr.cognos:80
    UseCanonicalName Off
    DocumentRoot "F:/wwwroot"
    <Directory />
            Options FollowSymLinks
            AllowOverride None
    </Directory>
    <Directory "F:/wwwroot">
        Options Indexes FollowSymLinks
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

<VirtualHost 10.1.26.195>
    ServerAdmin admin@cognos
    ServerName zzxhr.cognos:80
    UseCanonicalName Off
    DocumentRoot "E:/wwwroot"
    <Directory />
            Options FollowSymLinks
            AllowOverride None
    </Directory>
    <Directory "E:/wwwroot">
        Options Indexes FollowSymLinks
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>
回复

使用道具 举报

happy13888 发表于 2010-7-31 13:00:55 | 显示全部楼层
apache主机头设置和iis类似,但也有差别,百度一下,你就知道。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-5-18 16:23 , Processed in 0.101341 second(s), 16 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表