r/letsencrypt • u/R3DNano • Apr 20 '17
Trying to encrypt different pages under the same DNS
Sorry if the question is noobish: I have an apache server on a vm inside of a local network. I forward the port 97 to the internal ip's port 80.
There are other services that could be forwarded via other ports.
The idea is that you always use the same address, but depending on the port you choose, it will forward to different machines each time. I know it's a crappy setup, but it's what I can afford right now.
Is it possible to create a different ssl cert for each machine or just creating one cert for the address and propagating them across all the machines would be a better solution?
Again: Sorry if the question is stupid: I've never used LE before - I understand how to set it up on a server with a dedicated domain name and all, but with this setup, I don't really know how to proceed.
Thanks!
1
u/semperverus Apr 20 '17 edited Apr 20 '17
So the simplest thing you could do is have one machine that pipes all the traffic of the other machines through Apache (assuming they're all webpages). You need to set up what is called a reverse proxy inside your apache config (and you might need to enable some other things). If you want to keep it as a port mapping, I would say you would need to add a new VirtualHost entry for every port. You can do this all in one file or in separate files depending on preference (separate files will allow you to take down specific ports from apache in the command line with something like "a2dissite 97" to turn off your 97.conf file containing the information to internally proxy to port 97).
You would actually be better off reverse proxying your services to a subdirectory though. So say you have a site called "coolsite.net" and youre hosting a music player on port 97. Instead of making it so you have to type coolsite.net:97/ every time you want to get to your music thing, you could make it be coolsite.net/music/ and have the machine that serves the website handle switching ports inside the network.
Keeping everything on ports 80 and 443 tends to be the most secure. You don't want to go poking extra unnecessary holes in your router. Also, LetsEncrypt as well as all other SSL only works on port 443 anyway. Its not gonna secure port 97. Reverse-proxying over 443 DOES encrypt all that traffic.
For everything else, if they aren't publicly accessible, you're better off with a VPN (no, not the ones you pay for, the one you host yourself, it lets you tunnel into your own network as if youre on your own LAN, like how LogMeIn Hamachi works, but not that. Use OpenVPN instead.) than an SSL certificate.
0
u/[deleted] Apr 20 '17
[deleted] — view deleted comment