V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
jiezhi
V2EX  ›  Cloud9

[求助] 在 raspberry pi 上安装了 cloud 9,本地可以打开,局域网内另外机器访问不了

  •  
  •   jiezhi · 2015-11-12 20:51:12 +08:00 · 5699 次点击
    这是一个创建于 3336 天前的主题,其中的信息可能已经有所发展或是发生改变。

    按照这里在树莓派上安装好了 c9 ,执行node server.js也可以正常运行了:

    ➜  c9sdk git:(master) ✗ node server.js
    Starting standalone
    Connect server listening at http://127.0.0.1:8181
    CDN: version standalone initialized /home/pi/Documents/c9sdk/build
    Started '/home/pi/Documents/c9sdk/configs/standalone' with config 'standalone'!
    

    通过lynx 127.0.0.1:8181也可以在本地正常访问,但是通过电脑访问 http://pi_ip:8181 却无法访问( ssh 可以正常连接该 pi ),我想知道到底是哪个地方没配置好么,还是打开方式不对?

    PS:pi based on centos

    第 1 条附言  ·  2015-11-13 11:11:52 +08:00

    谢谢各位,参考这里执行了如下命令:

    ➜  c9sdk git:(master) ✗ ./server.js -l 0.0.0.0
    Starting standalone
    Authentication is required when not running on localhost.
    If you would like to expose this service to other hosts or the Internet
    at large, please specify -a user:pass to set a username and password
    (or use -a : to force no login).
    Use --listen localhost to only listen on the localhost interface and
    and suppress this message.
    
    Connect server listening at http://127.0.0.1:8181
    CDN: version standalone initialized /home/pi/Documents/c9sdk/build
    Started '/home/pi/Documents/c9sdk/configs/standalone' with config 'standalone'!
    ^C%
    

    嗯,加个用户名和密码就可以了

    ➜  c9sdk git:(master) ✗ ./server.js -l 0.0.0.0 -a admin:123
    Starting standalone
    Warning: running Cloud9 without using HTTP authentication.
    Run using --listen localhost instead to only expose Cloud9 to localhost,
    or use -a username:password to setup HTTP authentication
    
    Connect server listening at http://192.168.1.184:8181
    Using basic authentication
    CDN: version standalone initialized /home/pi/Documents/c9sdk/build
    Started '/home/pi/Documents/c9sdk/configs/standalone' with config 'standalone'!
    cache /home/pi/Documents/c9sdk/build/standalone/skin/default/dark.css
    wrapping module lib/architect/architect
    wrapping module async
    wrapping module smith
    wrapping module vfs-socket/consumer
    

    在另外的机器可以访问啦啦

    6 条回复    2015-11-12 22:50:33 +08:00
    zeacev
        1
    zeacev  
       2015-11-12 22:20:10 +08:00 via Android
    我就想知道这东西怎么在 Linux 下安装成功, Ubuntu 和 CentOS 下装了不下十次都莫名其妙不成功
    kendetrics
        2
    kendetrics  
       2015-11-12 22:21:36 +08:00
    防火墙,或者路由器开了内网隔离
    shunia
        3
    shunia  
       2015-11-12 22:33:04 +08:00   ❤️ 1
    127.0.0.1? 是不是应该指定 0.0.0.0:8181
    shunia
        4
    shunia  
       2015-11-12 22:33:34 +08:00
    另外现在这东西是不是叫 ace 啦?
    JJaicmkmy
        5
    JJaicmkmy  
       2015-11-12 22:41:41 +08:00 via iPad   ❤️ 1
    三楼正解,应该监听 0.0.0.0
    iloveayu
        6
    iloveayu  
       2015-11-12 22:50:33 +08:00 via Android   ❤️ 1
    @shunia +1 127.0.0.1 只能本机访问
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   999 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 21:45 · PVG 05:45 · LAX 13:45 · JFK 16:45
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.