We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37210
    • 131 Posts
    Mobile testing - Only have IP Address for the server

    Hi,

    Situation
    • We have set up a web server but only have an IP Address, we don't have a domain name yet
    • We've set up virtual sub-domains (dev and test contexts) in our MODx install and are currently accessing our contexts by editing our host file to point 'dev.ourwebsite.com' to our IP address

    Problem
    We now want to do some mobile testing but we can't view our dev site through an IP Address on our phone. We just get the cPanel 'Default Website Page'. Does anyone have experience with this?

    We've tried the following IP addresses, but obviously they haven't worked:

    • xxx.xx.xxx.xxx/dev
    • dev.xxx.xx.xxx.xxx


    We are using MODx 2.2.7
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Hm. I have several installations on my localhost, and 127.0.0.1/revo228/ works just fine. My router has my machine assigned to 10.0.0.2, so trying that on my phone at 10.0.0.2/revo228 also works. So I don't know what the problem might be.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 37210
        • 131 Posts
        Hi sottwell,

        Well maybe there isn't a quick solution to this after all.

        The problem is that our website isn't on our localhost (is that what you were explaining?). Our website is already hosted on a server with a web hosting company. And for the mean time, we don't have a domain name because our client already has their current website set up at www.ourclient.com.

        So we are working off of our web server by accessing the IP Address from dev.ourclient.com, only because we've edited the host file. Does that make sense?

        I've done further research and found this link, but it is way beyond my technical capabilities (since it asks to make edits to our router):
        http://serverpress.com/news/using-lan-sharing-for-mobile-device-testing/

        So I'm hoping for another quick and easy solution tongue

        Sar
          • 9207 ☆ A M B ☆
          • 2,475 Posts
          If you're relying on virtual hosts routing on your server to distinguish between your 2 subdomains then you are stuck: that mapping has to take place either via an "official" DNS entry with your registrar (i.e. edit one or more A records), or you have to do it "unofficially" by editing your hosts file. Otherwise your webserver won't know which document root to point you to. So it's instead serving up a default one.

          I'd recommend creating a couple DNS A Records for the purpose and get away from editing your local hosts file... it's confusing for other reasons, but in your case, you don't have an alternative that I can see.
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            If I understand correctly, you have your dev environment on a local server. I presume that you are developing with machines connected in one way or another to this server. The dev installation is not connected to the hosted production site in any way.

            So just use your local server's assigned IP address. I was just using 127.0.0.1 as an example; 10.0.0.2 is my dev machine's address as assigned by my WiFi router, so any other machine connected via the same router can access my local server with that IP address. No hosts files or DNS records needed.

            If you're trying to access it remotely (i. e. not through your local router), if your local server has its own "real" IP address it will still work. But if you are trying to hook your local server into your production site's IP address, that's another matter altogether. I have no idea how, or even if, that could work. I would imagine that hosting companies would frown on such activities.
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org
              • 37210
              • 131 Posts
              Thanks for your reply Everett. I am starting to realize that there most certainly is no alternative.

              Sotwell, we are actually trying to view our dev site that we've set up on a remote server. Unfortunately we don't have a domain name for it yet, just the IP. But I think we have to buy a domain name just to use for mobile development purposes.

              But anyway, I've had a quick play around with MODx Cloud for the first time and we are kicking ourselves for not using it earlier. We wouldn't have this mobile testing issue if we had developed it on the cloud!
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                Cloud is good wink
                  Studying MODX in the desert - http://sottwell.com
                  Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                  Join the Slack Community - http://modx.org
                  • 9207 ☆ A M B ☆
                  • 2,475 Posts
                  You could add some subdomains to an existing domain you have -- if you're running as somebusiness.com, you can create DNS A records for sub.somebusiness.com and point that to your server IP.
                    • 37210
                    • 131 Posts
                    Quote from: Everettg_99 at Jul 17, 2013, 11:02 AM
                    You could add some subdomains to an existing domain you have -- if you're running as somebusiness.com, you can create DNS A records for sub.somebusiness.com and point that to your server IP.

                    We definitely will do that. We've actually got a wildcard (*) A Record so that we can create as many subdomains as we want. It's very handy yeah? wink