2012-08-15 68 views
1

我想配置Apache供職於多個端口,但是當我添加多個listen指令,我收到了204多聽指令

工作正常,只有一個聽指令(僅在虛擬主機和相應的端口)

這裏是我的虛擬主機配置:

# Listen 
Listen 8013 
Listen 8015 
Listen 8019 

# NameVirtualHost 
NameVirtualHost *:8013 
NameVirtualHost *:8015 
NameVirtualHost *:8019 

# Projects 
<VirtualHost *:8013> 
    ServerName local.dev 

    DocumentRoot "/Users/laskew/DEV" 
    <Directory "/Users/laskew/DEV"> 

     Options Indexes FollowSymLinks Includes 
     AllowOverride All 
     Order allow,deny 
     Allow from all 
    </Directory> 
</VirtualHost> 

# Subversion 
<VirtualHost *:8015> 
    ServerName local.svn 

    DocumentRoot "/Users/laskew/SVN" 

    <Directory "/Users/laskew/SVN"> 
    Options Indexes FollowSymLinks Includes 
    AllowOverride All 
    Order allow,deny 
    Allow from all 
    </Directory> 
</VirtualHost> 


# Git 
<VirtualHost *:8019> 
    ServerName local.git 

    DocumentRoot "/Users/laskew/GITHUB" 

    <Directory "/Users/laskew/GITHUB"> 
    Options Indexes FollowSymLinks Includes 
    AllowOverride All 
    Order allow,deny 
    Allow from all 
    </Directory> 
</VirtualHost> 

回答

2

確保在你的「的httpd.conf」你有它設置爲監聽端口80。我認爲它總是需要被該端口上偵聽。

此外,您還需要在httpd.conf文件的末尾添加指令「AcceptMutex flock」。

+1

不,Apache可以配置爲偵聽任何端口,但不限於端口80.端口80是Web瀏覽器的默認端口,用於查找您的服務器,但僅此而已。 – 2012-11-16 15:42:40

+1

「AcceptMutex flock」指令解決了問題。 – LukeAskew 2013-02-28 00:04:09