Accessing Debian server via IP externally

Asked

Viewed 55 times

1

I released in my Apache 2 the port 8080 so that it can be accessed externally, I can access so:

http://meu_ip:8080/nome_de_uma_pasta

It would be possible to access the server only with My IP? Without putting :8080

thus

http://meu_ip/nome_de_uma_pasta
  • 1

    Creating a dynamic dns, maybe. Or setting to port 80.

  • 1

    You can try port forwarding in your gateway

  • @Wictorchaves how would I do that? In my modem admin?

  • I can give you the idea, but it tells you where to go is complicated, because each modem/ router is one way, but it works like this, everything that arrives at port 80 will be directed to port 8080

  • 1

    Search the model of your router "how to redirect ports with the router xpto02", the procedure is simple, in general there are two fields you put the source port and target 80 -> 8080.

  • This is a fixed IP or is the IP that your provider has allocated to you momentarily?

  • @Magichat hired IP Fixed

  • How is the file ports.conf?

  • Listen 80 Listen 8080 <Ifmodule ssl_module> Listen 443 </Ifmodule> <Ifmodule mod_gnutls. c> Listen 443 </Ifmodule>

Show 4 more comments

1 answer

2

Set up a Virualhost in your apache pointing to the port you want. Example:

<VirtualHost *:8080>
        ServerName servico.mydomain.com
        ProxyPreserveHost On
        ProxyPass / http://servico.mydomain.com:8080/
        ProxyPassReverse / http://servico.mydomain.com:8080/
</VirtualHost>

You can do the same if you want to use other ports, that is, multiple Virtualhost.

<VirtualHost *:9090>
        ServerName outroservico.mydomain.com
        ProxyPreserveHost On
        ProxyPass / http://outroservico.mydomain.com:9090/
        ProxyPassReverse / http://outroservico.mydomain.com:9090/
</VirtualHost>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.