Hello everyone and I have such a question, how to start the web server so that it works? Those. I have ip 91.79.74.4, and how to make it so that you can go to it and you have a website, such as 93.186.224.240.

What I have:

  1. I have a macbook and a wonderful program MAMP (analog denwer), in order to start the server (192.168.1.2)

  2. zte router (192.168.1.1)

When I drive in my ip (91.79.74.4), I get my modem authentication, and I want my website to appear.

  • and apache for what? Use Wirth hosting - user21708

4 answers 4

It did not work with your router, but in the simplest case you should do the following:

  1. In order not to specify a specific port each time you log on to your site, you need to change the default port for the admin on the router (modem) in the settings. For example, to make it not 80, but 8080. True, then you will have to write not just http://192.168.1.1, but http://192.168.1.1:8080 every time you enter the admin panel. port is not standard for the protocol http.
  2. After that, you configure "port forwarding" (port forwarding), where you set 80 as the incoming and outgoing port, the protocol is tcp and your IP (192.168.1.2)

After that, all requests from the tcp protocol to port 80 will be sent by your router to your computer.

    I would not do that ...
    On the beech:
    1. configure your wonderful program to listen to port 80 on localhost (127.0.0.1);
    2. we test the pages on the server until we set up as necessary (in the browser we fill in this address and look at the pages);
    3. after that we reconfigure the web server to listen to the 8080th port on your local address of the beech (suppose it is 192.168.1.2)
    On the router:
    1. read the decoy decoder, and in accordance with it, set up port forwarding: from port 80.79.74.4.4 to port 8080 from the external address 91.79.74.4;
    2. if there is a server indication function in the router, we write 192.168.1.2 in there

    We give the address (external) to friends and ask to potestit. If you want to work with domain names (well, so that you are searched for by name: Vasya_pupkin), then we set up DDNS - many routers have this option (previously registered with DDNS).

    • And what is the practical meaning of your opinion in relation to my version? - Dex
    • 1. You do not need to reconfigure the web configurator of the router (especially since not all routers provide this feature); 2. How are you going to create a loop inside network> router> external_address_booker> internal network? - there will not be a simple port forwarding. - Justicet

    You can also add to what was said!

    1. Register any domain (example.ru)
    2. Register on wreedns.ws, get DNS server records (IP set 91.79.74.4), register them for the domain.

    And when you go to example.ru, you’ll go to your laptop.

      In most modern routers, there is a feature of not "forwarding", but "port forwarding". That is - the mapping of the same port to another (internal) address. In principle, this is the same "forwarding", only the port does not change, only the address changes.

      But if it is port 80 (HTTP), then you lose web access to the router itself. Stick - it is about the two ends!

      • Nobody loses web access. Just do not need to go to the site to an external address, because this address belongs to the router. You need to go to 127.0.0.1, then there will be no problems with getting into the admin area. - Int
      • 127.0.0.1 is localhost, that is, the internal address is not the router, but the actual computer. Therefore, it is useless to go there! - areshin
      • if the web server is configured for lokalhost, then it is necessary to go to lokalhost! - Justicet
      • Read the question from the author carefully. It is not necessary from localhost, but from the outside! - areshin