Back to Programming Languages forum
Ok, so I understood that web-related problems, which was suggested to me, require hosting of web-site, so I decided to try to host an web-site.
For this purpose, I downloaded Apache Web Server, installed and configured it, and set up a web-site on this server. The web-site is very simple, it consists of single page called index.html with the following code:
Hello, world!
(without any html tags, because I found out that browser will then automatically add html and body tags for me)
There is a trouble however. When I type http://localhost
in the address line of my browser, my web-site is showing, all right. But when I type http://[my-external-ip-address]
instead, where my-external-ip-address is an address shown by some online tools like ipconfig.me, my browser thinks for a while and then complains that the connection to remote web-site is timed out.
Any suggestions?
But when I type http://[my-external-ip-address]
This most probably won't work without special efforts. Your external IP address usually is the address of your router (or your house / unviversity network's router), rather than your machine's.
If you have IP mapped to your router, you can "open ports" in the router so it forwards requests to your machine.
But generally you don't host web-sites on your machine really. You either use "virtual server" (or not virtual but dedicated) - but both these options are not free.
Other approach is to use ready hosting, some of which are free. I described some in this list.
Particularly, CodeAbbey is hosted on some "shared hosting" which runs the same Apache HTTPD server for many users. Users just have their folders to deploy PHP or Python files, and database connection (along with some disk space for files).
So even if all my home machines are stolen or burnt, nothing happens to web-site.
Just as I thought, making a simple web-site is much harder from technical point of view, rather than programming point (of course, for complex sites the opposite is true, but I don't discuss complex sites for now).
I don't have router in possession, and this probably means my external ip-address is the ip-address of router of whole house.
Does that mean that I should contact company which performs administration of my house, or my internet-provider, and ask them the permission to open ports from house router to my machine? I don't know...
Anyway, thank you much for explanation!
Does that mean that I should contact company which performs administration of my house, or my internet-provider, and ask them the permission to open ports from house router to my machine? I don't know...
Yes, like this - but I think it is rather called "buying dedicated IP" from your internet provider :)
I really don't think you need it.
We run web-sites on our own computers only for debugging. Otherwise host them at github pages (static) or pythonanywhere.com (with Python). Try them and you'll have some web-site running by today's evening :)
Just as I thought, making a web-site is much harder from technical point of view, rather than programming point.
Not much harder, but some specific approaches may be difficult. Particularly - exposing your own machine to web. I believe there are also workarounds like https://www.noip.com/free but I definitely don't think you need them :)
Thank you, I will try GitHub Pages or PythonAnywhere then.