WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Hosting WP on Ubuntu with IP Redirect URL (9 posts)

  1. nightrder1195
    Member
    Posted 2 years ago #

    I'm hosting WP 3.3.1 on Ubuntu with Apache2, php5, and MySql server. I'm using Webmin to maintain my MySQL Database Server. I have created a WP database and given it a user and password with the proper permissions. I have the server set with a static IP address and all the proper ports forwarded. This is not where my issue lies, but I feel that it's necessary to stress that I have it set up properly.

    My issue is with my domain/IP Redirect. I purchased a domain (team3465.org) and set it to redirect with masking to the external IP address of the network of the server.

    This works fine until I try to log in. When I go to the site and click the log in link, nothing happens. When I right-click and "Copy Link Location", however, it copies the IP address and I can paste it into a browser and it will let me in the backend. Navigation works fine, it's just trying to access the backend that is the issue.

    I'm willing to do whatever needs to be done to get this to function, I don't want my end users to have to get an IP address to get into the backend. If I need to set some settings with my domain registrar, I can, if it's something in WordPress, I can fix that as well.

    I tried changing the WordPress Address (URL) from the IP to the domain, and I tried changing the Site Address (URL) from the IP address to the domain, and when I did that, it broke the site completely. I couldn't access anything. I had to delete the database and start over. Not that it was a big deal because I haven't been able to add any content because I can't log in to the backend.

    Thanks for your time.

    EDIT: I wasn't sure if this should go in "Installation" or in "How-To or Troubleshooting", so if it is in the wrong place, let me know and I'll gladly move it.

  2. Assuming you're talking about a home Internet connection, why not just forward 80 and 443 (if you use SSL) to the real server and use Dyn.com or similar?

    You can create an alias (CNAME) in team3465.org that points to the dynamic DNS name. In your WordPress set it up with the name you want to use in the team3465.org domain.

  3. nightrder1195
    Member
    Posted 2 years ago #

    I did forward port 80 and 443 to the server that is hosting WP. What do you mean "In your WordPress set it up with the name you want to use in the team3465.org domain."? I'm not sure I understand this.

    I don't see the point of using dyn.com or no-ip.com or any of those similar sites unless I'm missing something.

    Thanks.

  4. I was working on the assumption that you do not have a static IP on the Internet. If you do have a fixed static IP and the ports are forwarded, then all you need to do is create an A record (address) DNS entry that points to your external address.

    If you wanted to use blog.team3465.org (just as an example), then that DNS address entry would be for your Internet address.

    If you don't have a static IP, then you use a dyndns client to point to an alias.

    As an example, let's say your WordPress installation DNS name was blog.team3465.org (using the domain you purchased).

    On your server you install a dyndns client and create the dynamic DNS name blogteam3465org.gotdns.com (for example). That will be set to the external IP address that you have for the Internet.

    In the domain team3465.org you create an alias like so

    blog.team3465.org. IN CNAME blogteam3465org.gotdns.com.

    That creates an alias so that when someone types in blog.team3465.org they connect to your server. This way if you are using a home ISP and your IP address is not fixed people will still be able to reach your server by the DNS name.

  5. nightrder1195
    Member
    Posted 2 years ago #

    My apologies, I do have a static IP address, so that isn't the issue in this case. I should've mentioned that in the OP.

    I'll try just creating an A record , wait for everything to propagate and report back.

    Would you mind explaining the difference between an A record and a CNAME record? Because it looks like the difference is that one is for IP addresses only, and one is for URLs only.

    Thanks for your help.

  6. Would you mind explaining the difference between an A record and a CNAME record?

    This comes up a lot in the multisite section. ;)

    Okay, all DNS names ultimately (and recursively) return an A record for the IP address. That's a given or sites don't resolve.

    And as you know already, for one WordPress site using a CNAME to point to an A record (which is all a CNAME can point to) is a little overkill. Especially if you have a static IP address.

    But if you plan to host many sites then for reasons of organization, ease of maintenance, managing IPs, etc. it's easier to use CNAMES. Here's an example of why that is.

    You set your A record for your server like so.

    serverABC.domain.com.  IN A 1.2.3.4

    But now you want to host multiple web sites on that serverABC with the same IP. On Apache that's a Virtual Host option and lots of sites do that.

    You could create addition A records for each site pointing to the same IP address.

    site1.domain.com.  IN A 1.2.3.4
    site2.domain.com.  IN A 1.2.3.4
    site3.domain.com.  IN A 1.2.3.4
    site4.domain.com.  IN A 1.2.3.4
    .
    .
    siteN.domain.com.  IN A 1.2.3.4

    And that's perfectly valid and legitimate. Your users type in siteX.domain.com and they get sent to the server. Your web server handles the rest.

    Now add different entries in multiple DNS zones (domains), also pointing to that IP address as bunch of A records.

    If you need to change the IP address of serverABC (say for a datacenter migration), then you need to update all the references to that old serverABC IP address.

    In a single zone that's not too bad. In many zones, it's really easy to miss something.

    So you plan ahead and make all those siteX DNS entries into CNAME (canonical name record or alias) records like so:

    site1.domain.com.  IN CNAME serverABC.domain.com.
    site2.domain.com.  IN CNAME serverABC.domain.com.
    site3.domain.com.  IN CNAME serverABC.domain.com.
    site4.domain.com.  IN CNAME serverABC.domain.com.
    .
    .
    siteN.domain.com.  IN CNAME serverABC.domain.com.

    And you do that in all your other DNS zones too. Get crazy with it, CNAMEs everywhere.

    Now when you want to change the IP address from 1.2.3.4 to 5.6.7.8 it's easy.

    You don't need to touch all those existing records. Just modify the one A record for serverABC.

    serverABC.domain.com.  IN A 5.6.7.8

    And just like that, you've also updated all those other records in one fell swoop.

    Later on if you want to separate some of the sites to a different server like serverDEF just create a new A record for serverDEF.domain.com.

    serverDEF.domain.com.  IN A 9.10.11.12

    And update the sites you want to move.

    site6.domain.com.  IN CNAME serverDEF.domain.com.
    site9.domain.com.  IN CNAME serverDEF.domain.com.

    And that's almost certainly more than you've asked for and probably doesn't quite belong in a WordPress support forum. ;)

  7. nightrder1195
    Member
    Posted 2 years ago #

    That's okay. (: The analogy I'm going to use probably doesn't belong here either.

    If I'm understanding what you're saying correctly, an A record is like a variable.

    x=10

    And a CNAME record is something that you assign the variable to.

    y=x
    z=x

    And the reason for using them is so you can change the value of y and z easily by changing one x value instead of all the y and z values individually.

    Is that anywhere remotely close?

    All that explanation aside, creating an A record to point to my IP didn't quite fix the problem. I still have the issue of my IP showing in the URL bar when anyone tries to use the backend. If you want to see what I'm saying, you can visit here. Which is the front end, and masked by my domain name. But when you click the Login link, my IP is displaed instead of my domain name. This is what I want to fix.

    Thank you so much for taking your time to help me with this and explain those records.

  8. If I'm understanding what you're saying correctly, an A record is like a variable.

    That's not a bad analogy and that does work explanation-wise.

    But when you click the Login link, my IP is displaed instead of my domain name. This is what I want to fix.

    Yep, we sure went on a tangent alright. See what happens when I get the opportunity to lecture? :D

    The port forwarding is working so try this: if you can log into your WordPress installation visit this page:

    http://your-url-here/wp-admin/options-general.php

    See the two fields called WordPress Address (URL) and Site Address (URL)? Set those to the DNS URL you've picked.

    So if you picked blog.team3465.org and you are not using any directory put in http://blog.team3465.org and save that.

    That's probably not the DNS name, but you get the idea.

    Once that's done that should send you back to your site via the DNS name now.

  9. nightrder1195
    Member
    Posted 2 years ago #

    Okay. When I did that before, it broke everything, but that was also when I just had my domain being forwarded with no A record. I shall try it now.

    ...

    You, sir, are brilliant. It worked. My issue must have been the forwarding with no A record.

    Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic