I'm having trouble to keep up with your comments scattered all around my posts. Let's continue the whole discussion here. If you are trying to setup a server to your home connection, your provider might have the port 80 blocked.
If you are trying to access port 80 from within your network using your public IP (= your domain), it may not work, as some routers do not do this. Try to access your server via the domain from a different network (for example, the WiFi of a neighboor, or mobile data)
Edit: and ifyou have a dynamic IP, and a subdomain that is getting updated, then you should setup a CName from your domain to the DNS subdomain that gets updated with your dynamic IP
Alright, sounds good. I'll respond to your other comment here too.
Yes, my ISP, I believe, blocks port 80. Every online check failed to connect with port 80 even though I manually set port 80 on my router settings to accept incoming traffic and port forwarded it. However, the online checks seem to indicate that they do not block port 443.
Ahhhh, maybe that's it. I'll try accessing the website on my other computer with the VPN running.
I'm not exactly sure what I'd stick in the CName or if this would even work, since doesn't the CName point to the A Record? I believe I do have a dynamic IP, but what I've done is set up a Dynamic DNS host via NOIP.com so that the domain falez.ddns.net will always be mapped to my router's public IP address, no matter what that address becomes. However, with Godaddy I cannot use falez.ddns.net as the A Record; I have to use an actual IP address, which means once my router's public IP is updated, I'll have to manually adjust the A Record. I don't imagine my router's public IP is updated often, but I'm not sure. I have the same public IP today that was assigned yesterday, so...
It didn't work with a VPN and what not because I'm assuming the request gets redirected to the server before ever leaving my LAN?
I just tried accessing it from another network and it works. Whoop whoop!! Fucking stoked. First ever server that I've set up. Thanks a million billion, amigo.
Do you have any tutorials on setting up your own DNS and name servers?? Or do you know of any up-to-date, decent tutorials about that on the web?
I see you had success, so I'll just leave these replies in case anyone with the same problems as you enters my post!
If your ISP blocks port 80, you won't be able to host a webserver. You may be able to host a secure webserver (https) if they don't block port 443.
You have to create a CName record instead of an A record for your
www.domainnamehere.com
, that points tofalez.ddns.net
. The problem is that you won't be able to use non-www domain (domainnamehere.com
won't work). If you don't the next time you change IP, your site won't be available.Also, some providers may take up to 48 hours to update DNS records
If you connect to a VPN, you may encounter problems. Connect to a different network altogether (saw you did that), and clear your dns cache!
You won't be able to setup a DNS server on your network, as most, if not all, ISPs block incoming connections to port 53 that is being used for DNS lookups.
It's in my plans to write a tutorial to setup your own DNS server, I'm just looking for a nice interface to include for not so tech-savvy people.
Doesn't the CName point or resolve to the A Record? The A Records on Godaddy can only be actual IP addresses. You cannot use domains like falez.ddns.net as the A Record and therefore I'm not sure how I would point CNames to that domain?
The last question I have is: If one's ISP blocks ports 80, 443, and or even 53, can't one simply use different ports to host a server or DNS server?
The CName is a totally different record to the A record.
In a very simplified explanation, when you create a CName for
asd.domain.com
and point it toasd.domain2.com
which in turn is an A record for127.0.0.1
, you are basically telling theasd.domain.com
to resolve to127.0.0.1
. If at any point you change the A record ofasd.domain2.com
to192.168.0.1
, thenasd.domain.com
will also resolve to this IP.So in your case, with a dynamic IP, this is the way to use your domain with your home connection.
To my knowledge, services like DNS, can't be used on different ports.
However, Web servers, FTP servers, SSH, and various other protocols, can be used at any port you want.
Yes, I understand it's different from the A record. It stands for Canonical name, right?
Your example is confusing.
I guess what I could do is get rid of the A Record altogether, and then just use a CName (to point to the dynamic DNS domain that I obtained via noip.com which will always be mapped to my IP address). Is that possible??
If I got rid of the A Record, would that conflict with my SSL certificate (since the SSL certificate is probably mapped to my IP)??
Likewise, I was told that one reason why I might not be able to access my server online from my own network might have something to do with NAT. What do you know about this?
P.S. You should make a tutorial on setting up file structures so that databases are accessible to websites that will be hosted. This is what I'm going to have to figure out how to do right now. I chose to install MySQL instead of MariaDB, so hopefully everything still works fine with the server as is. I don't see why it wouldn't.
This is how it works... CName is a record that resolves to a hostname instead of an IP. That hostname could have any type of record, in your example it is an A record. So, your domain is resolving to your noip.com subdomain, which in turn resolves to your IP. And yes, it stands for Canonical NAME.
If you have a cname record, and an A record for (example) this.domain.tld, then you are probably going to have problems at some point. It is not recommended to mix such records.
If you are behind NAT you'll have to configure port forwarding, like I told you on another comment. If your provider blocks port 80, you won't be able to use it unless they unblock it for you.
Also, what do you mean by "setting up file structures so that databases are accessible to websites that will be hosted"? Your database will be created via the mysql tool on console, or PHPMyAdmin. You won't be creating files. It doesn't work that way.
You have a lot of reading to do before you try hosting websites. It is not a project that should be taken lightly. It's not "I configured it once, and they work, so it's ok". Hosting websites require a lot more than configuration. If you are hosting websites at home, that are not for you to learn how to do things, you have to ensure that you have backup power in case there is a power outage (UPS & Power Generators are the most common ones), you need to have enough bandwidth to host a large user base, you need cooling or your equipment will get fried when your sites get popular... It will be cheaper and better for you to rent a server on a datacenter.
List of DNS Record Types
NAT - Network Address Translation
How MySQL Databases Work?
So it is recommended to use a CName without using an A record? For example, if I were to use the following setup for the domain spaiglas.com...
A Record : IP address (of my server)
CName : mine.ddns.net
In that case it would be best to not use an A record at all? I've been told you can't use CNames without an A record, that you need an A record, so I'm kind of confused. I tried deleting the A record for my domain and it was inaccessible. It would throw errors saying the server was not found, even though a CName existed :/
Yes, I've already set up port forwarding. The fact that I can't access my own server locally via the WAN IP address, from what I've read, can be addressed with something like NAT loopback/hairpinning/reflection?
Apparently I can access the server via https://its.internal.ip.address:443, but the browser seems to ignore the SSL certificate, which isn't a huge deal at the end of the day, unless it's also doing this for external requests too.
What I meant by that comment is of course the file structure on the server must be structured in such a way that a PHP file which references a database will need to be able to locate said database. In other words, can a given database be accessed from any subfolder of the apache2 default folder?
Yes, I know. My site will never be that popular, however. No more than 10 people will ever have access to my website and it is very likely there will never be more than 3 people concurrently using it. I have more than enough bandwidth for to handle this. I've got after market cooling for my CPU, which should be sufficient; I know you're talking about cooling the entire environment, so that all hardware components stay cool, but this won't be necessary. This route will in fact save me quite a bit of money without cutting into my revenue as much.
Thanks again for taking the time to answer my questions. And thanks for the DNS Record Types link. <3
If you're not going to answer any more of my questions. At least answer this one: How can I force all HTTP requests to use HTTPS?
I've just started reading about mod_rewrite, but find it confusing as fuck. Not sure where the file is located which I'm supposed to edit.