I created a VM on Azure running Ubuntu 14.04 and installed a LAMP stack. In Azure you have an so called enpoint configuration manager, which basically let you redirect incoming requests from one port to another on the hosted machine. So I deployed my first website on port 81 and made a redirect from 443 to 81 to make it work with the SSL certificate. Now I configured my second website on port 82 which works fine using http, but how can I now bind my SSL to it? Since I have an elastic IP I have to bind my DNS records to the CNAME of the machine which is called for example "mymachine.cloudapp.net:port". I am not so experienced in DNS / SSL / etc. So I think there must be a way which I don't know yet. So far my only idea is to create one machine per website, which for sure is not the best solution. Using google I found plenty of workarounds for IIS but nothing for Apache 2.4...
First things first, SSL is just a protocol and you can use any port that you want. So answering your question:
How can you bind ssl to it?
Well you pretty much need to buy an ssl and set it up for that site with that port (so basically you would have an SSL for each url and port combination you want (obviously there are SSL certificates that you can use for multiple sites with the same base URL). So you will just have to edit Apache .conf files to redirect that each app (DocumentRoot) to a different port.
Now, my recommendation would be to use always standard ports:80 and 443 (for many reasons like: mental health, standards, etc.). What we actually do in the real world is that we have one server that hosts multiple VirtualHosts with one or more ServerNames, you can either buy them or just have a base url and then add a suffix or prefix to that domain.
For instance, I would have my base domain with something like this:
or if you go and buy domain names you could have something like this:
So, basically I would get three SSL certificates, one for each app and you would have to configure Apache to respond to that domain name and go to the app that you need to serve, that would pretty much solve your problem.
You can read more about it how to configure it here.
Try it out for yourself and let us know if you run into any more problems. I would also suggest reading more about Apache Virtual Hosts.