We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24336
    • 16 Posts
    [MODERATOR’S NOTE: Subject edited for clarity]

    I have a OpenSUSE LAMP server setup locally with MODx and Zen Cart on it. It’s only for testing purposes so I can become familiar with things. It all works great internally, but I want a friend/co-worker to be able to check out what I’m doing from another location. I think I know the problem, but I can’t seem to figure out where/how to fix it.

    MY PROBLEM:
    My directory tree is ../srv/www/htdocs/*modx files and Zen folders are here
    From outside the office I can type MY.WAN.IP and get to modx no problem. Then I can type MY.WAN.IP/store and get to my zen store no problem. then if i try MY.WAN.IP/store/admin it tries to redirect to a LAN IP, rendering an error.

    I saw in my server configuration page that my Apache HTTP_HOST and my PHP Variables, _SERVER["SERVER_NAME"] and _SERVER["SERVER_ADDR"], are all set to my LAN IP. I’m guessing this is at least part of my problem, but I know how to fix it. I’m not the greatest at setting this all up which is why I’m doing it, to get familiar. If you can advise me I would appreciate it. Thanks.

    Oh, and I wasn’t really sure what to search for to find my answer, but I did find this (may not have anything to do with my problem)
    http://modxcms.com/forums/index.php?topic=17923.0;wap2

    HAPPY TURKEY DAY smiley
    • This has nothing to do with MODx really, and everything to do with how you have Apache configured.

      Basically, if you access the site from both IP’s and have pages cached, this explains why it tries to switch back, as any cached links or base href tag? would be from whichever address was visited first. It’s just not good to have a web server configured like that in the wild; use named-based virtual hosts or the HTTP_HOST will be whatever the user supplied in the request HOST variable. This is also a potential security attack vector for cross-site scripting attacks (see http://shiflett.org/blog/2006/mar/server-name-versus-http-host for some explanation and discussion).

      Other than that, I recommend reading up on Apache configuration, starting with http://httpd.apache.org/docs/1.3/mod/core.html#servername

      Cheers
        • 24336
        • 16 Posts
        Thanks for the help. i don’t think it has to do with cached pages cause i sent a link of the WAN IP to my friend but it still tried to take him to the LAN IP. I’m sure the resources and information will help me get a better understanding about how to set it up correctly. Thanks.