Access Debian server by IP externally

1

I opened the 8080 port on my Apache 2 so that it can be accessed externally, so I can access it like this:

http://meu_ip:8080/nome_de_uma_pasta

Would it be possible to access the server only with My IP ? Without placing : 8080

so

http://meu_ip/nome_de_uma_pasta
    
asked by anonymous 20.11.2017 / 12:54

1 answer

2

Set a VirualHost on your apache by 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 may also want to use other ports, that is, several VirtualHost.

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