利用段口分虚拟主机,还有的,在Google搜索一下
http://www.google.cn/search?hl=zh-CN&newwindow=1&client=firefox-a&rls=org.mozilla:zh-CN:official&hs=gJS&sa=X&oi=spell&resnum=0&ct=result&cd=1&q=Apache+Virtualhost&spell=1代码(httpd.conf):#站点一:80段口虚拟主机
<VirtualHost *:80>
#例如站点一的根目录为D:\phpMyAdmin\80
DocumentRoot "D:\phpMyAdmin\80"
ServerName 127.0.0.1
</Virtualhost>#站点二:81段口虚拟主机
<VirtualHost *:81>
#例如站点二的根目录为D:\phpMyAdmin\81
DocumentRoot "D:\phpMyAdmin\81"
ServerName 127.0.0.1
</Virtualhost>#站点三:82段口虚拟主机
<VirtualHost *:82>
#例如站点一的根目录为D:\phpMyAdmin\82
DocumentRoot "D:\phpMyAdmin\82"
ServerName 127.0.0.1
</Virtualhost>#站点四:83段口虚拟主机
<VirtualHost *:83>
#例如站点二的根目录为D:\phpMyAdmin\83
DocumentRoot "D:\phpMyAdmin\83"
ServerName 127.0.0.1
</Virtualhost>

解决方案 »

  1.   

    <IfModule alias_module>
        #
        # Redirect: Allows you to tell clients about documents that used to 
        # exist in your server's namespace, but do not anymore. The client 
        # will make a new request for the document at its new location.
        # Example:
        # Redirect permanent /foo http://meng/bar    #
        # Alias: Maps web paths into filesystem paths and is used to
        # access content that does not live under the DocumentRoot.
        # Example:
        # Alias /webpath /full/filesystem/path
         
         Alias /bbs "e:/bbs"
         Alias /ba "e:/b1027"
         Alias /d "d:"
         Alias /FileUpload "e:/FileUpload"
         Alias /z "d:/zoheflash"
        #
        # If you include a trailing / on /webpath then the server will
        # require it to be present in the URL.  You will also likely
        # need to provide a <Directory> section to allow access to
        # the filesystem path.    #
        # ScriptAlias: This controls which directories contain server scripts. 
        # ScriptAliases are essentially the same as Aliases, except that
        # documents in the target directory are treated as applications and
        # run by the server when requested rather than as documents sent to the
        # client.  The same rules about trailing "/" apply to ScriptAlias
        # directives as to Alias.
        #
        ScriptAlias /cgi-bin/ "D:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/"</IfModule>
    这是我用的虚拟目录配置
      

  2.   

    2楼在,他说的是虚拟目录,不是虚拟主机
    Alias /test d:/doc/aaa
    <Directory d:/doc/aaa>
        AllowOverride None
        Options None
        Order allow,deny
        Allow from all
    </Directory>
      

  3.   


    虚拟主机或是虚拟目录跟PHP有什么关系?