<ins id="nhtrr"><th id="nhtrr"></th></ins>

<cite id="nhtrr"><track id="nhtrr"></track></cite>

        <b id="nhtrr"><output id="nhtrr"><thead id="nhtrr"></thead></output></b><delect id="nhtrr"></delect>
          <delect id="nhtrr"></delect>

            歡迎加入EUCMS官方QQ交流群,與更多EUCMS用戶一起討論,共同發財!

            QQ群:1222386
            > 資訊中心 >> 建站技術 >>正文
            教你如何用apache同ip多站點架設
            2020-12-03 41 0
            這里是指同一IP綁定N個域名,有二種方式實現
            方法1、僅修改httpd.conf
            假設二個域名bbs.xxx.com與blog.xxx.com
            打開httpd.conf
            將文件拖到最下面,加上


            view plaincopy to clipboardprint?
             
             ServerName bbs.xxx.com   #域名  
             DocumentRoot "F:/website/bbs"   #該域名對應的目錄地址    
               #該節點是配置權限、默認首頁啊等等東東。  
             Options FollowSymLinks IncludesNOEXEC Indexes  
             DirectoryIndex  index.php   
             AllowOverride None   
             Order Deny,Allow   
             Allow from all      
             
             
             
             
             ServerName blog.xxx.com  
             DocumentRoot "D:/PHPSite/wordpress"  
               
             Options FollowSymLinks IncludesNOEXEC Indexes  
             DirectoryIndex  index.php   
             AllowOverride None   
             Order Deny,Allow   
             Allow from all   
             
             


             ServerName bbs.xxx.com   #域名
             DocumentRoot "F:/website/bbs"   #該域名對應的目錄地址 
               #該節點是配置權限、默認首頁啊等等東東。
             Options FollowSymLinks IncludesNOEXEC Indexes
             DirectoryIndex  index.php
             AllowOverride None
             Order Deny,Allow
             Allow from all   




             ServerName blog.xxx.com
             DocumentRoot "D:/PHPSite/wordpress"

             Options FollowSymLinks IncludesNOEXEC Indexes
             DirectoryIndex  index.php
             AllowOverride None
             Order Deny,Allow
             Allow from all



            重啟apache,就OK啦。當然你要修改你的hosts文件。

            方法2、修改\PhpServer\Apache2.2\conf\extra\httpd-vhosts.conf
            直接將上面一段copy到httpd-vhosts.conf的最后即可。
            實際上看名字就知道httpd-vhosts.conf是一個虛擬站點配置集中地,方便管理。
            也就是如下:
            view plaincopy to clipboardprint?
            #  
            # 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  
             
            #  
            # 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.  
            #  
             
             
             
             ServerName bbs.xxx.com   #域名  
             DocumentRoot "F:/website/bbs"   #該域名對應的目錄地址    
               #該節點是配置權限、默認首頁啊等等東東。  
             Options FollowSymLinks IncludesNOEXEC Indexes  
             DirectoryIndex  index.php   
             AllowOverride None   
             Order Deny,Allow   
             Allow from all      
             
             
             
             
             
             ServerName blog.xxx.com  
             DocumentRoot "D:/PHPSite/wordpress"  
               
             Options FollowSymLinks IncludesNOEXEC Indexes  
             DirectoryIndex  index.php   
             AllowOverride None   
             Order Deny,Allow   
             Allow from all   
             
             

            #
            # 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

            #
            # 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.
            #



             ServerName bbs.xxx.com   #域名
             DocumentRoot "F:/website/bbs"   #該域名對應的目錄地址 
               #該節點是配置權限、默認首頁啊等等東東。
             Options FollowSymLinks IncludesNOEXEC Indexes
             DirectoryIndex  index.php
             AllowOverride None
             Order Deny,Allow
             Allow from all   





             ServerName blog.xxx.com
             DocumentRoot "D:/PHPSite/wordpress"

             Options FollowSymLinks IncludesNOEXEC Indexes
             DirectoryIndex  index.php
             AllowOverride None
             Order Deny,Allow
             Allow from all



            重啟apache。
            如果不行的話,看你的httpd.conf是否啟用了vhost
            打開httpd.conf,找到
            # Virtual hosts
            Include conf/extra/httpd-vhosts.conf
            看是否啟用,即去掉Include conf/extra/httpd-vhosts.conf前的#
            重啟apache,爽去吧。

             

            你覺得這篇文章怎么樣?

            0 0
            參與討論
            請自覺遵守互聯網相關的政策法規,嚴禁發布色情、暴力、反動的言論。
            成品站
            購買流程
          1. 注冊會員
          2. 選擇網站模板
          3. 免費開通試用
          4. 綁定域名試用
          5. 選擇套餐
          6. 付款轉正
          7. 域名正式生效
          8. 網站正式上線
          9. 分站:
            掃描關注微信

            掃描加微信

            13852154923

            0516-66628816

            工作日 9:00-12:00 13:30-18:00
            周六及部分節假日提供值班服務
            2186398
            群:1222386
            免費做網站 整形網 德國王牌建材
            Copyright@2003-2021 EUCMS智能建站平臺版權所有 Powered by EUCMS-v6.3 | 網站地圖 蘇ICP備13022644號
            噗呲噗呲捣出白沫蜜汁