2010-07-12 52 views
2

我試圖建立AJAX推進引擎(APE)在我的Mac,運行Mac OS X 10.6.4和Apache 2.2.14AJAX推進引擎:無法聯繫APE服務器

當我運行APE的服務器,這是輸出:

Hristo$ sudo ./aped 
Password: 
    _ ___ ___ 
    /_\ | _ \ __| 
/_ \| _/ _| 
/_/ \_\_| |___| 
AJAX Push Engine 

Bind on port 6969 

Version : 1.00 
Build : Dec 7 2009 23:05:18 
Author : Weelya ([email protected]) 

[Module] [spidermonkey] Loading module : Javascript embeded (0.01) - Anthony Catel 
[JS] Loading script ../scripts/framework/mootools.js 
[JS] Loading script ../scripts/framework/Http.js 
[JS] Loading script ../scripts/framework/userslist.js 
[JS] Loading script ../scripts/utils/utils.js 
[JS] Loading script ../scripts/commands/proxy.js 
[JS] Loading script ../scripts/commands/inlinepush.js 
[JS] Loading script ../scripts/examples/nickname.js 
[JS] Loading script ../scripts/examples/move.js 
[JS] Loading script ../scripts/utils/checkTool.js 

ape.conf樣子:

uid { 
     # "aped" switch to this user/group if it run as root 
     user = daemon 
     group = daemon 
} 


Server { 
     port = 6969 
     daemon = no 
     ip_listen = 127.0.0.1 
     domain = localape 
     rlimit_nofile = 10000 
     pid_file = /var/run/aped.pid 
} 

Log { 
     debug = 1 
     use_syslog = 0 
     logfile = ./ape.log 
} 

JSONP { 
     eval_func = Ape.transport.read 
     allowed = 1 
} 

Config { 
#relative to ape.conf 
     modules = ../modules/lib/ 
     modules_conf = ../modules/conf/ 
} 

# Proxy section is used to resolve hostname and allow access to a IP:port (Middleware-TCPSocket feature) 

#Proxy { 
#  id = freenode 
#  host = irc.freenode.net 
#  port = 6667 
#  readonly = false 
#} 

...並在httpd-vhosts.conf文件的虛擬主機的東西看起來像:

# 
# Virtual Hosts 
# 

<Directory /Library/WebServer/Documents/APE> 
    Order Deny,Allow 
    Allow from all 
</Directory> 

# 
# Use name-based virtual hosting. 
# 
NameVirtualHost *:80 

<VirtualHost *:80> 
    ServerName localhost 
    DocumentRoot "/Library/WebServer/Documents" 
</VirtualHost> 

<VirtualHost *:80> 
    Servername localape 
    ServerAlias ape.localape 
    ServerAlias *.ape.localape 

    DocumentRoot "/Library/WebServer/Documents/APE" 
</VirtualHost> 

當我運行在/Tools/Check/index.html測試文件,我通過測試,直到我到了APE服務器在那裏我得到以下錯誤:

Running test : Contacting APE Server 
Can't contact APE Server. Please check the your APE Server is running and the folowing url is pointing to your APE server : http://ape.localape:6969 
Something went wrong. If you can't fix it by yourself post a message on the newsgroups with the output below or join our IRC channel 

任何想法,如何解決這一問題?

謝謝。

回答

2

我想通了。部分問題是我所在的網絡不允許我做這種事情。一旦我轉移到一個正常的網絡,我做出了改變,並且工作。

以下是APE的配置文件。只有我在這裏所做的更改均在前兩節:

uid { 
     # "aped" switch to this user/group if it run as root 
     user = Hristo 
     group = admin 
} 


Server { 
     port = 6969 
     daemon = no 
     ip_listen = 127.0.0.1 
     domain = local.ape-project.org 
     rlimit_nofile = 10000 
     pid_file = /var/run/aped.pid 
} 

接下來,我改變了一些東西,在虛擬主機文件httpd-vhosts.conf位於/etc/apache2/extra/。這是什麼樣子:

<Directory /Library/WebServer/Documents/APE> 
    Order Deny,Allow 
    Allow from all 
</Directory> 

NameVirtualHost *:80 

<VirtualHost *:80> 
    ServerName localhost 
    DocumentRoot "/Library/WebServer/Documents" 
</VirtualHost> 

<VirtualHost *:80> 
    Servername local.ape-project.org 
    ServerAlias ape.local.ape-project.org 
    ServerAlias *.ape.local.ape-project.org 
    DocumentRoot "/Library/WebServer/Documents/APE" 
</VirtualHost> 

因此,這意味着我必須包括位於/etc/apache2 Apache的配置文件httpd.conf在虛擬主機。到這一點,我未註釋下面線,其位於朝向所述文件的底部:

# Virtual hosts 
Include /private/etc/apache2/extra/httpd-vhosts.conf 

最後,我在/etc/加入local.ape-project.orghosts文件:

127.0.0.1  local.ape-project.org 

我用下面的源指導我:http://www.ape-project.org/wiki/index.php/Advanced_APE_configuration

希望這會有所幫助。