Giter Site home page Giter Site logo

Comments (9)

lookfwd avatar lookfwd commented on August 14, 2024

Hello, from within the VM, http://web:9312 should work. from outside the VM (i.e. from a browser) http://localhost:9312 should work. Are you querying from within the VM or ouside?

from scrapybook.

zhongwang123 avatar zhongwang123 commented on August 14, 2024

I am sorry to not express well....I am query outside of VM with http://localhost:9312 and failed,within the Vm I can query http://localhost:9312 without error

from scrapybook.

zhongwang123 avatar zhongwang123 commented on August 14, 2024

After 'vagrant up',if I run 'vagrant ssh',I will enter the 'dev',and I will meet curl(7) if I run 'curl localhost:9312'
however, if I run 'vagrant ssh web' after 'vagrant up', I will enter 'web' and I can query localhost:9312 successfullly

from scrapybook.

lookfwd avatar lookfwd commented on August 14, 2024

After 'vagrant up',if I run 'vagrant ssh',I will enter the 'dev',and I will meet curl(7) if I run 'curl localhost:9312'

Yes, this is correct.

In page 227 you can find a table with how URLs change on "dev". When you login on those virtual machines, you login on a virtual network that looks like the one in page 226. This way, in order to curl from dev to web, you do curl web:9312 because it's another virtual machine. If you are logged in on web with vagrant ssh web, curl localhost:9312 will work because that's the web server. This is a realistic environment... In production you will typically have distinct database, search, scrapyd and web (likely outside your network) servers.

I am query outside of VM with http://localhost:9312 and failed

This is a bit unexpected. We will have to follow-up if this persists after restarting

from scrapybook.

zhongwang123 avatar zhongwang123 commented on August 14, 2024

I seem to understand a little......but if I want to query the web outside the VM,what should I do?
the 'localhost:9312' seems not work in the chrome

from scrapybook.

zhongwang123 avatar zhongwang123 commented on August 14, 2024

thank you very much, the problem has troubled me much, I have restarting many times, however......

from scrapybook.

lookfwd avatar lookfwd commented on August 14, 2024

if I want to query the web outside the VM,what should I do?

If you go to page 227 of the book, you will find a list of URLs to try. Is it just the localchost:9312 that doesn't work or all of them (in the 2nd column-there)?

If it's just 9312, then it's likely a port conflict i.e. you have something already running in 9312. In page 239 I have a few tips on re-mapping the port. All you basically have to do is to comment out line 25 from Vagrantfile.dockerhost (this line maps port 9312 to 9312 of the host) and add in line 31 (just after end) something like the following line, which will re-map port 9312 to 9316.

config.vm.network "forwarded_port", guest: 9312, host: 9316

from scrapybook.

zhongwang123 avatar zhongwang123 commented on August 14, 2024

Thank you every much! I have found that I have made a mistake when editing the Vagrantfile.dockerhost. Thanks a lot!

from scrapybook.

lookfwd avatar lookfwd commented on August 14, 2024

You're awesome! Well done for hacking Vagrantfile and for fixing it! :) Cheers!

from scrapybook.

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.