ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Accessing VirtualHost Locally on Ubuntu Web Server

    IT Discussion
    4
    18
    1.6k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • thanksajdotcomT
      thanksajdotcom
      last edited by

      Ok, so here is my dilemma. I started up a new website: www.literaryworksbyaj.com
      I started the site because I love writing things like poetry, etc. Anyways, I just registered the domain on NoIP, and added it to the list of domains my IP needs to refresh for. I have setup the virtual hosts in apache, and I have setup Wordpress. The problem is that the nameservers haven't populated globally yet for the new domain, and I have no idea how to locally access the site.

      The path is "/var/www/literaryworksbyaj.com". The IP of my server is 172.16.255.20. I tried going to the regular domain name, but it's not populated yet, and that usually takes 24 hours. I tried going to 172.16.255.20/literaryworksbyaj.com but that 404s out. If I go to 172.16.255.20 straight up, it goes to BuiltByArt.com, which I am hosting for @Minion-Queen . I can't figure out how to access the site locally. Any help is much appreciated!

      Thanks,
      A.J.

      1 Reply Last reply Reply Quote 0
      • scottalanmillerS
        scottalanmiller
        last edited by

        DNS should propagate in a few hours. If it is not working after 24 hours, something is seriously wrong. With CloudFlare we see global propagation in under an hour.

        1 Reply Last reply Reply Quote 0
        • scottalanmillerS
          scottalanmiller
          last edited by

          To access a site from any given machine, you just need to work around DNS like anytime that you work around DNS. That means making a local entry in your hosts file. This is for any OS. It is always called the hosts file. Once you have that, then it won't look to DNS and will just resolve the site locally and go straight to it.

          1 Reply Last reply Reply Quote 0
          • ?
            A Former User
            last edited by

            @ajstringham said:

            172.16.255.20

            You can always add an A record for www.site.com for 172.16.255.20 locally. You can even do this on DD-WRT.

            thanksajdotcomT scottalanmillerS 2 Replies Last reply Reply Quote 0
            • thanksajdotcomT
              thanksajdotcom @A Former User
              last edited by

              @thecreativeone91 said:

              @ajstringham said:

              172.16.255.20

              You can always add an A record for www.site.com for 172.16.255.20 locally. You can even do this on DD-WRT.

              Let me try that and see if it works.

              1 Reply Last reply Reply Quote 0
              • scottalanmillerS
                scottalanmiller @A Former User
                last edited by

                @thecreativeone91 said:

                @ajstringham said:

                172.16.255.20

                You can always add an A record for www.site.com for 172.16.255.20 locally. You can even do this on DD-WRT.

                That only works if the DD-WRT device is your DNS server.

                ? 1 Reply Last reply Reply Quote 0
                • ?
                  A Former User @scottalanmiller
                  last edited by

                  @scottalanmiller said:

                  @thecreativeone91 said:

                  @ajstringham said:

                  172.16.255.20

                  You can always add an A record for www.site.com for 172.16.255.20 locally. You can even do this on DD-WRT.

                  That only works if the DD-WRT device is your DNS server.

                  Well, yeah. I assumed that would be implied.

                  scottalanmillerS 1 Reply Last reply Reply Quote 0
                  • scottalanmillerS
                    scottalanmiller @A Former User
                    last edited by

                    @thecreativeone91 he was unaware of the hosts file, it is unlikely that he is running an internally DNS caching server.

                    ? 1 Reply Last reply Reply Quote 1
                    • thanksajdotcomT
                      thanksajdotcom
                      last edited by

                      The hosts file trick worked! They say it can take up to 24 hours. @scottalanmiller , you're right in saying it shouldn't take that long. However, until it propagates systemwide, the hosts file trick works. Thanks!

                      1 Reply Last reply Reply Quote 0
                      • scottalanmillerS
                        scottalanmiller
                        last edited by

                        How long has it been at this point?

                        thanksajdotcomT 1 Reply Last reply Reply Quote 0
                        • ?
                          A Former User @scottalanmiller
                          last edited by

                          @scottalanmiller said:

                          @thecreativeone91 he was unaware of the hosts file, it is unlikely that he is running an internally DNS caching server.

                          @ajstringham You didn't know about the hosts file. haha.

                          thanksajdotcomT 1 Reply Last reply Reply Quote 0
                          • thanksajdotcomT
                            thanksajdotcom @A Former User
                            last edited by

                            @thecreativeone91 said:

                            @scottalanmiller said:

                            @thecreativeone91 he was unaware of the hosts file, it is unlikely that he is running an internally DNS caching server.

                            @ajstringham You didn't know about the hosts file. haha.

                            I know about the hosts file, but it never occurred to me to use it in that way. Had I thought about it long enough, it probably would have. But off-hand, I didn't think of it that way.

                            1 Reply Last reply Reply Quote 0
                            • thanksajdotcomT
                              thanksajdotcom @scottalanmiller
                              last edited by

                              @scottalanmiller said:

                              How long has it been at this point?

                              Maybe a little over an hour.

                              1 Reply Last reply Reply Quote 0
                              • scottalanmillerS
                                scottalanmiller
                                last edited by

                                That's not that long then. Understandable that it has not flowed everywhere yet.

                                thanksajdotcomT 1 Reply Last reply Reply Quote 0
                                • thanksajdotcomT
                                  thanksajdotcom @scottalanmiller
                                  last edited by

                                  @scottalanmiller said:

                                  That's not that long then. Understandable that it has not flowed everywhere yet.

                                  Exactly. I'm not upset that it hasn't. I was just looking for a way to edit it locally while I waited.

                                  JaredBuschJ 1 Reply Last reply Reply Quote 0
                                  • scottalanmillerS
                                    scottalanmiller
                                    last edited by

                                    I find that if I set my DNS as the first task that I do, normally it is working by the time that I need it.

                                    thanksajdotcomT 1 Reply Last reply Reply Quote 2
                                    • JaredBuschJ
                                      JaredBusch @thanksajdotcom
                                      last edited by

                                      @ajstringham said:

                                      @scottalanmiller said:

                                      That's not that long then. Understandable that it has not flowed everywhere yet.

                                      Exactly. I'm not upset that it hasn't. I was just looking for a way to edit it locally while I waited.

                                      Also, if you are using Apache, the first thing listed in your vhost section will be will be the default website if you go to it by IP. At least that is what my CentOS 7 webserver is doing. So I intentionally arranged my vhost file for one specific site to show up if someone uses the IP.

                                      1 Reply Last reply Reply Quote 0
                                      • thanksajdotcomT
                                        thanksajdotcom @scottalanmiller
                                        last edited by

                                        @scottalanmiller said:

                                        I find that if I set my DNS as the first task that I do, normally it is working by the time that I need it.

                                        The DNS nameservers were already set. I'm hosting the server on my own hardware. It's waiting for that nameserver to propagate the info out to the world. Probably another couple hours and we'll be good. I just wanted the initial wordpress setup stuff done before the site hit the www.

                                        1 Reply Last reply Reply Quote 0
                                        • 1 / 1
                                        • First post
                                          Last post