代码之家  ›  专栏  ›  技术社区  ›  Hristo

AJAX推送引擎:无法联系APE服务器

  •  2
  • Hristo  · 技术社区  · 16 年前

    我试图在我的Mac上设置AJAX推送引擎(APE),运行MacOSX10.6.4和Apache2.2.14

    当我运行APE服务器时,输出如下:

    Hristo$ sudo ./aped
    Password:
       _   ___ ___ 
      /_\ | _ \ __|
     / _ \|  _/ _| 
    /_/ \_\_| |___|
    AJAX Push Engine
    
    Bind on port 6969
    
    Version : 1.00
    Build   : Dec  7 2009 23:05:18
    Author  : Weelya (contact@weelya.com)
    
    [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

    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
    

    有没有办法解决这个问题?

    谢谢。

    1 回复  |  直到 16 年前
        1
  •  2
  •   Hristo    16 年前

    我想出来了。部分原因是我所在的网络不允许我做这种事。一旦我转移到一个正常的网络,我做了改变,它的工作。

    以下是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>
    

    所以这意味着我必须在Apache配置文件中包含虚拟主机 httpd.conf 位于 /etc/apache2 . 为此,我取消了位于文件底部的以下行的注释:

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

    local.ape-project.org hosts 文件输入 /etc/

    127.0.0.1       local.ape-project.org
    

    我使用以下来源来指导我: http://www.ape-project.org/wiki/index.php/Advanced_APE_configuration