Code Monkey home page Code Monkey logo

Comments (13)

spance avatar spance commented on July 28, 2024

4是ipv4地址的意思。
访问地址就是这个监听地址的ip或者对应的域名加上端口号。
例如http://1.2.3.4:8080或者http://domain.net:8080

from ezgoo.

wangqinhu avatar wangqinhu commented on July 28, 2024

谢谢您的答复。

如果是这样,我在浏览器键入这个地址是否应该可以访问到 Google 页面?

目前我这边环境输入这个地址后(http://1.2.3.4:8080 http://1.2.3.4:8080/ ,IP 已替换,Apache 服务正常)无法打开网页,不知道是否我操作方面还有什么没有理解?

谢谢,

祝好。

王秦虎

On Oct 20, 2014, at 9:33 PM, Spance [email protected] wrote:

4是ipv4地址的意思。
访问地址就是这个监听地址的ip或者对应的域名加上端口号。
例如http://1.2.3.4:8080


Reply to this email directly or view it on GitHub #2 (comment).

from ezgoo.

spance avatar spance commented on July 28, 2024

你是用Apache做前端反代AirGoogle的吗?如果是,那你就要把apache的配置(和引用的配置)贴出来看看。
最好把你的服务器环境详细的解释一下。

from ezgoo.

wangqinhu avatar wangqinhu commented on July 28, 2024

原谅我网络小白了,看到 AirGoogle 以为 Apache 那边不需要设置,临时按网上的说法配置如下,还是不行,不知您可否提供一个本地可用的示例配置?在您有时间的时候,谢谢。

<IfModule mod_proxy.c> 
 ProxyRequests off 
 <Proxy *>     
  Order deny,allow 
  Allow from all 
 </Proxy> 
 ProxyPass / http://127.0.0.1:8080 
 ProxyPassReverse / http://127.0.0.1:8080
</IfModule>

from ezgoo.

spance avatar spance commented on July 28, 2024

看这个apache.conf没啥问题。这样来检查吧,在服务上:
w3m http://localhost:8080 # 检查airGoogle监听是否正常,按q键退出
w3m http://localhost:<apache port> # 看服务器本地apache监听是否正常和反代是否正常
服务上的这2个检查都没问题,而你本地还是不通的话,就要检查你到服务器之间的防火墙问题了。

from ezgoo.

wangqinhu avatar wangqinhu commented on July 28, 2024

揣摩了半天,感觉我的 Apache 的代理可能还是写的有问题,运行 node server.js 后则无法加载网页,如下。

~ » w3m http://0.0.0.0:8080
w3m: Can't load http://0.0.0.0:8080.
~ » w3m http://0.0.0.0:80  
w3m: Can't load http://0.0.0.0:80.

注释掉 proxy 配置时 80 端口可以正常访问,8080 没有设置无法加载。

不知道可否提供一个完整的 Apache 反代示例?让新手将该文件追加到 httpd.conf 或者 extra/proxy-html.conf 或者单独 include 进去?

谢谢!

from ezgoo.

spance avatar spance commented on July 28, 2024

w3m后面的地址不要用0.0.0.0这不是一个合法单播地址,要么用localhost要么用127.0.0.1 loopback地址要么物理网卡地址类似10.x等等。
w3m: Can't load http://0.0.0.0:8080.这个没法说明nodejs的监听是否正常,建议你先检查这部分。

from ezgoo.

wangqinhu avatar wangqinhu commented on July 28, 2024

本地测试未成功,目前还没找到原因。

在 nodejitsu 上部署,返回如下错误:

info:    Analyzing application dependencies in node server.js
info:    Checking app availability AirGoogle
info:    Creating app AirGoogle
info:    Creating snapshot 1.0
info:    Uploading: [=============================] 100%
error:   Error running command deploy
error:   Nodejitsu Error (404): Item not found
help:    For help with this error contact Nodejitsu Support:
help:      webchat: <http://webchat.nodejitsu.com/>
help:          irc: <irc://chat.freenode.net/#nodejitsu>
help:        email: <[email protected]>
help:    
help:      Copy and paste this output to a gist (http://gist.github.com/)
info:    Nodejitsu not ok

w3m 测试错误如下(与本地部署相同):

Service Unavailable

The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please
try again later.

from ezgoo.

spance avatar spance commented on July 28, 2024

nodejitsu 我没用过,它那个错误中不包括明确的错误原因。
总之,这个部署非常简单。
在服务器上 download这个项目到任意目录下,然后node server.js看到running就说明跑起来了,然后继续用w3m localhost:8080验证。
如果这步有问题,把看到错误告诉我(nodejs错误和其它);如果没问题,再讨论下一步前端nginx/apache反代的问题。
如果还搞不清的话发邮件给我,约个时间帮你远程看看。

from ezgoo.

hplc avatar hplc commented on July 28, 2024

部署Apache为前端是OK的(包括SSL),我这就是用的Apache。
因为本地8080端口被其他进程占用,我需要换个端口,关键就是:

ProxyPass / http://127.0.0.1:8081/
ProxyPassReverse / http://127.0.0.1:8081/

PS:前端强制https的检测对Apache无效,会操作页面loop死掉。我另外起个Issue吧。

from ezgoo.

wangqinhu avatar wangqinhu commented on July 28, 2024

前端应该是没有问题的,以下是在 nodejitsu上部署 helloworld 和 airgoogle 的过程和所有提示信息:

部署 helloworld

~ » pwd
/Users/wangqinhu
~ » cd helloworld
helloworld » cat server.js
var http = require('http');
http.createServer(function (req, res) {
        res.writeHead(200, {'Content-Type': 'text/plain'});
        res.end('hello world\n');
}).listen(8080);
helloworld » jitsu deploy
info:    Welcome to Nodejitsu wangqinhu
info:    jitsu v0.14.0, node v0.10.32
info:    It worked if it ends with Nodejitsu ok
info:    Executing command deploy
warn:    There is no package.json file in /Users/wangqinhu/helloworld
warn:    Creating package.json at /Users/wangqinhu/helloworld/package.json
help:    
help:    A package.json stores meta-data about an app
help:    In order to continue we'll need to gather some information about the app
help:    
help:    Press ^C at any time to quit.
help:    to select a default value, press ENTER
prompt: Application name:  (helloworld) 
prompt: Subdomain name:  (wangqinhu-helloworld) 
prompt: scripts.start:  (node server.js) 
prompt: version:  (0.0.0) 
prompt: engines.node:  (0.10.x) 
warn:    About to write /Users/wangqinhu/helloworld/package.json
data:    
data:    {
data:        engines: { node: '0.10.x' },
data:        name: 'helloworld',
data:        scripts: { start: 'node server.js' },
data:        subdomain: 'wangqinhu-helloworld',
data:        version: '0.0.0'
data:    }
data:    
prompt: Is this ok?:  (yes) 
info:    Analyzing application dependencies in node server.js
info:    Checking app availability helloworld
info:    Creating app helloworld
info:    Creating snapshot 0.0.0
info:    Uploading: [=============================] 100%
npm WARN package.json [email protected] No description
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No README data
info:    Done creating snapshot 0.0.0
info:    Updating app helloworld
info:    Activating snapshot 0.0.0 for helloworld
info:    Starting app helloworld
info:    App helloworld is now started
info:    http://wangqinhu-helloworld.nodejitsu.com on Port 80
info:    Nodejitsu ok

部署 airgoogle

helloworld » cd ~/airgoogle
airgoogle git:(master) » jitsu deploy
info:    Welcome to Nodejitsu wangqinhu
info:    jitsu v0.14.0, node v0.10.32
info:    It worked if it ends with Nodejitsu ok
info:    Executing command deploy
warn:    
warn:    The package.json file is missing required fields:
warn:    
warn:      Subdomain name,   scripts.start
warn:    
warn:    Prompting user for required fields.
warn:    Press ^C at any time to quit.
warn:    
prompt: Subdomain name:  (wangqinhu-airgoogle) 
prompt: scripts.start:  (node server.js) 
warn:    About to write /Users/wangqinhu/airgoogle/package.json
data:    
data:    {
data:        author: 'Spance Wong <[email protected]>',
data:        description: 'AirGoogle is a very handy Google search mirror, and includes a few improved features.',
data:        engines: { node: '0.10.x', npm: '1.3.x' },
data:        main: 'server.js',
data:        name: 'AirGoogle',
data:        repository: { type: 'git', url: 'https://github.com/spance/AirGoogle.git' },
data:        scripts: { start: 'node server.js' },
data:        subdomain: 'wangqinhu-airgoogle',
data:        version: '1.0'
data:    }
data:    
prompt: Is this ok?:  (yes) 
info:    Analyzing application dependencies in node server.js
info:    Checking app availability AirGoogle
info:    Creating app AirGoogle
info:    Creating snapshot 1.0
info:    Uploading: [=============================] 100%
error:   Error running command deploy
error:   Nodejitsu Error (404): Item not found
help:    For help with this error contact Nodejitsu Support:
help:      webchat: <http://webchat.nodejitsu.com/>
help:          irc: <irc://chat.freenode.net/#nodejitsu>
help:        email: <[email protected]>
help:    
help:      Copy and paste this output to a gist (http://gist.github.com/)
info:    Nodejitsu not ok

Apache 设置如下:

airgoogle git:(master) ✗ » tail -11 /etc/apache2/httpd.conf
<IfModule mod_proxy.c>
    ProxyRequests on 
    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>
    ProxyPass /hw http://wangqinhu-helloworld.jit.su
    ProxyPassReverse /hw http://wangqinhu-helloworld.jit.su
    ProxyPass /ag http://wangqinhu-airgoogle.jit.su
    ProxyPassReverse /ag http://wangqinhu-airgoogle.jit.su
</IfModule>

测试结果如下:

~ » w3m http://localhost/hw

hello world

~ » w3m http://localhost/ag

[brand]

400

wangqinhu-airgoogle.jit.su is currently stopped

from ezgoo.

spance avatar spance commented on July 28, 2024

错误主要是这2句

error:   Error running command deploy
error:   Nodejitsu Error (404): Item not found

你说这里面能看出来什么问题?如果Nodejitsu有客服就要问问了,或者换吧。
你可以试试在vps或者其它各类paas上部署,有很多人也是这么搞的,都没有问题。
比如看一个武汉同学的例子 https://hjc.im/oah-test/
另外,这俩天很快就会发新版本。

from ezgoo.

wangqinhu avatar wangqinhu commented on July 28, 2024

感谢 @spance 的热心解答,问题已解决:将 package.json 内的版本号改成 1.0.0 即可成功部署在 nodejitsu,当前版本 1.1.0 可以直接部署成功。
感谢给大家带来 airGoogle!

from ezgoo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.