Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    Join Date
    Apr 2007
    Location
    Los Angeles, CA
    Posts
    45
    Plugin Contributions
    0

    Default REMOTE_ADDR displays only 0.0.0.0 -- mod_proxy special config on Windows

    I've turned off showing IP address at the footer for some time and had it turned on couple days ago to find out it only displays 0.0.0.0. So I've turned it off until problem gets resolved.

    I also get 0.0.0.0 on who's online under Admin/Tools.

    What would cause $ip = $_SERVER['REMOTE_ADDR'] to get only 0.0.0.0?

    If you must ask what contributions I've installed, there are about 50 of them (pretty much everything from the download section). They all work fine and most of them use overrides and I don't remember touching display ip section. (I can almost guarantee particular code hasn't been touched).

    Again, what would have caused $ip = $_SERVER['REMOTE_ADDR'] not to obtatin proper client IP??

  2. #2
    Join Date
    Apr 2007
    Location
    Los Angeles, CA
    Posts
    45
    Plugin Contributions
    0

    Default Re: REMOTE_ADDR displays only 0.0.0.0

    Quote Originally Posted by SteveKim View Post
    I've turned off showing IP address at the footer for some time and had it turned on couple days ago to find out it only displays 0.0.0.0. So I've turned it off until problem gets resolved.

    I also get 0.0.0.0 on who's online under Admin/Tools.

    What would cause $ip = $_SERVER['REMOTE_ADDR'] to get only 0.0.0.0?

    If you must ask what contributions I've installed, there are about 50 of them (pretty much everything from the download section). They all work fine and most of them use overrides and I don't remember touching display ip section. (I can almost guarantee particular code hasn't been touched).

    Again, what would have caused $ip = $_SERVER['REMOTE_ADDR'] not to obtatin proper client IP??
    I just realized it is to do with mod_proxy of Apache.
    Any workarounds in using mod_proxy with Remote_addr?

  3. #3
    Join Date
    Jan 2004
    Posts
    66,419
    Blog Entries
    7
    Plugin Contributions
    81

    Default Re: REMOTE_ADDR displays only 0.0.0.0

    Try using zen_get_ip_address() instead of $_SERVER['REMOTE_ADDR']
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  4. #4
    Join Date
    Apr 2007
    Location
    Los Angeles, CA
    Posts
    45
    Plugin Contributions
    0

    Default Re: REMOTE_ADDR displays only 0.0.0.0

    Quote Originally Posted by DrByte View Post
    Try using zen_get_ip_address() instead of $_SERVER['REMOTE_ADDR']
    Dr Byte,

    I've added couple things under tpl_footer.php just to see what values these variables return as zen_get_ip_address() also returned only 0.0.0.0 as below:

    Code:
    <div id="siteinfoIP"><?php echo TEXT_YOUR_IP_ADDRESS . '  ' . 'server forwarded: ' .  
    $_SERVER['HTTP_X_FORWARDED_FOR'] . ' server client ip: '. $_SERVER['HTTP_CLIENT_IP'] . 'get 
    forwarded: ' . getenv('HTTP_X_FORWARDED_FOR') . 'get client ip: ' . getenv('HTTP_CLIENT_IP') . 
    'get remote addr: ' . getenv('REMOTE_ADDR') . 'zen ip func: ' . zen_get_ip_address(); ?></div>
    and it returns below:

    Your IP Address is: server forwarded: server client ip: get forwarded: get client ip: get remote addr: 0.0.0.0zen ip func: 0.0.0.0

    Any other suggestions?

  5. #5
    Join Date
    Jan 2004
    Posts
    66,419
    Blog Entries
    7
    Plugin Contributions
    81

    Default Re: REMOTE_ADDR displays only 0.0.0.0

    Quote Originally Posted by SteveKim View Post
    I just realized it is to do with mod_proxy of Apache.
    Any workarounds in using mod_proxy with Remote_addr?
    Quote Originally Posted by SteveKim View Post
    Any other suggestions?
    Other than turning it off? No.
    If the proxy isn't passing the information through, then there's no way of knowing.
    Why do you need the mod_proxy installed anyway?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #6
    Join Date
    Apr 2007
    Location
    Los Angeles, CA
    Posts
    45
    Plugin Contributions
    0

    Default Re: REMOTE_ADDR displays only 0.0.0.0

    Quote Originally Posted by DrByte View Post
    Other than turning it off? No.
    If the proxy isn't passing the information through, then there's no way of knowing.
    Why do you need the mod_proxy installed anyway?
    Well, I'm sure you'd understand that all business necessities are different.

    Mine here has couple of almost inavtive 'old' asp sites (not aspx) that is maintained by some other person whose main job is not to maintain asp sites and those sites are not justifiable in spending extra dollar to convert to anything else like php.

    In other words, asp sites require IIS, IIS and Apache cannot be hosted at the same server, .aspx mod in Apache is available but not .asp hence Apache is proxying IIS sites. So we need it.

    Then here is another question that's not quite appropriate in this Zen Cart forum. Will X-Forwarded-For require another Apache module installed? Could this requirement being not in place probably cause X-Forwarded-For variable not available?

    Thanks,

    Steve Kim.

  7. #7
    Join Date
    May 2007
    Location
    SW Florida
    Posts
    1,051
    Plugin Contributions
    2

    Have a Drink Re: REMOTE_ADDR displays only 0.0.0.0

    Quote Originally Posted by DrByte View Post
    Try using zen_get_ip_address() instead of $_SERVER['REMOTE_ADDR']
    I have the same problem. Tried this and no go.
    WinXP wamp 5, don't know anything about mod_proxy, looked at the Apache server settings and proxy_module nor any of the other proxy options are turned on.

    JOhn ><>
    Newest Site: ChargerPros - Stuff4Toys

  8. #8
    Join Date
    Jan 2004
    Posts
    66,419
    Blog Entries
    7
    Plugin Contributions
    81

    Default Re: REMOTE_ADDR displays only 0.0.0.0

    Quote Originally Posted by SteveKim View Post
    Well, I'm sure you'd understand that all business necessities are different.
    Exactly. Hence the question.
    Quote Originally Posted by SteveKim View Post
    Mine here has couple of almost inavtive 'old' asp sites (not aspx) that is maintained by some other person whose main job is not to maintain asp sites and those sites are not justifiable in spending extra dollar to convert to anything else like php.

    In other words, asp sites require IIS, IIS and Apache cannot be hosted at the same server, .aspx mod in Apache is available but not .asp hence Apache is proxying IIS sites. So we need it.

    Quote Originally Posted by SteveKim View Post
    Then here is another question that's not quite appropriate in this Zen Cart forum. Will X-Forwarded-For require another Apache module installed? Could this requirement being not in place probably cause X-Forwarded-For variable not available?
    I'm not sure -- I've not used the mod_proxy addon in order to know.

    FWIW, Zen Cart checks all those variations in its get_ip_address function
    Code:
      function zen_get_ip_address() {
        if (isset($_SERVER)) {
          if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
            $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
          } elseif (isset($_SERVER['HTTP_CLIENT_IP'])) {
            $ip = $_SERVER['HTTP_CLIENT_IP'];
          } else {
            $ip = $_SERVER['REMOTE_ADDR'];
          }
        } else {
          if (getenv('HTTP_X_FORWARDED_FOR')) {
            $ip = getenv('HTTP_X_FORWARDED_FOR');
          } elseif (getenv('HTTP_CLIENT_IP')) {
            $ip = getenv('HTTP_CLIENT_IP');
          } else {
            $ip = getenv('REMOTE_ADDR');
          }
        }
    
        return $ip;
      }
    You may have to take your question to a webhosting discussion forum like webhostingtalk.com where you can "talk shop" with folks running servers more actively.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  9. #9
    Join Date
    Apr 2007
    Location
    Los Angeles, CA
    Posts
    45
    Plugin Contributions
    0

    Default Re: REMOTE_ADDR displays only 0.0.0.0

    Quote Originally Posted by DrByte View Post
    You may have to take your question to a webhosting discussion forum like webhostingtalk.com where you can "talk shop" with folks running servers more actively.
    Thank you, Dr. Byte. We all must do.

    I'll post once it's resolved.

    Just another note: the zen cart sites are not proxied and this is happening. The environment is mod_proxy loaded here.

  10. #10
    Join Date
    Apr 2007
    Location
    Los Angeles, CA
    Posts
    45
    Plugin Contributions
    0

    Default Re: REMOTE_ADDR displays only 0.0.0.0

    I've got it resolved by searching through apache lounge at http://www.apachelounge.com/forum/viewtopic.php?p=7476

    It probably applies only to my environment that is Win2K server with mod_proxy (proxy_html) though.

    The resolution:

    Simply add following to anywhere in httpd.conf, of which in my case, at the end of the file:

    Win32DisableAcceptEx

    More about it on http://httpd.apache.org/docs/2.0/mod/mpm_winnt.html
    Hope this helps others whom having the problem!

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v139h zen_counter_history displays today only
    By jeking in forum General Questions
    Replies: 2
    Last Post: 12 Dec 2014, 03:18 AM
  2. Advice on Shipping Config for UK Royal Mail/Special Delivery
    By DarrenGriffin in forum Addon Shipping Modules
    Replies: 3
    Last Post: 2 Apr 2010, 09:32 AM
  3. Replies: 0
    Last Post: 4 Oct 2007, 07:57 PM
  4. error installing as a db upgrade and windows config questions
    By jdl in forum Installing on a Windows Server
    Replies: 3
    Last Post: 15 May 2007, 04:44 PM
  5. special shipping config, is this possible
    By danglyfury in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 21 Oct 2006, 03:45 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR