I'm running linux on a virtual machine and I'd like to host a website on it. However when i start the apache2 service, I can only access it from inside my own network. How do other people access my website?
You will need to configure a port-forward on your router to access an internal service from outside your network. Depending on the make & model of your router/modem the method to configure this will be different, but this is supported on most routers. For example, you have Linux with Apache running on ip-address 192.168.1.100 and your router is on 192.168.1.1. You will then need to log into your router and create port-forwards for TCP
ports 80
(HTTP) and/or for TCP
port 443
(HTTPS) which will forward traffic to the same ports on 192.168.1.100. With your external address you should now be able to view the website from the Internet.
PS. Be aware that allowing access to your internal systems over the Internet exposes them to (24x7) automated attacks almost immediately. You will therefore have to secure the systems very well and keep everything up-to-date.