Sponsor:

Server and Web Integrator
Link:
Kloxo-MR logo
6.5.0 or 7.0.0
Click for "How to install"
Donation/Sponsorship:
Kloxo-MR is open-source.
Donate and or Sponsorship always welcome.
Click to:
Click Here
Please login or register. 2024-03-28, 21:58:12

Author Topic: Lockal IP detected on WHMCS License Information  (Read 10706 times)

0 Members and 2 Guests are viewing this topic.

Offline WISTFUL

  • Senior Member
  • *
  • Posts: 247
  • Karma: +0/-0
    • View Profile
Re: Lockal IP detected on WHMCS License Information
« Reply #15 on: 2013-02-21, 16:54:22 »
I replace all 127.0.0.1 with my server IP in custom.proxy.conf

Now issue solved.
But:
Code: [Select]
_ENV["REMOTE_ADDR"] = server IP
_SERVER["REMOTE_ADDR"] = server IP
Is it OK?
« Last Edit: 1970-01-01, 01:00:00 by Guest »
.

Offline WISTFUL

  • Senior Member
  • *
  • Posts: 247
  • Karma: +0/-0
    • View Profile
Re: Lockal IP detected on WHMCS License Information
« Reply #16 on: 2013-02-22, 09:47:46 »
Do you find any other solution that auto detects server IP as "SERVER_ADDR" (without manual editing proxy.conf) and also detect correct local IP as "REMOTE_ADDR"?

I have problem with your current solution.
In default proxy.conf file, below code returns domain.ltd when referred from http://www.domain.ltd and is correct. but after customizing proxy.conf, return www.domain.ltd and is not correct.
Code: [Select]
parse_url( $_SERVER['HTTP_REFERER'], PHP_URL_HOST )
« Last Edit: 1970-01-01, 01:00:00 by Guest »
.

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Lockal IP detected on WHMCS License Information
« Reply #17 on: 2013-02-22, 11:27:59 »
« Last Edit: 1970-01-01, 01:00:00 by Guest »
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline WISTFUL

  • Senior Member
  • *
  • Posts: 247
  • Karma: +0/-0
    • View Profile
Re: Lockal IP detected on WHMCS License Information
« Reply #18 on: 2013-02-22, 11:47:00 »
Thanks mustafa,

But my cade is okay. because when I test it on other servers or using default proxy.conf It works well!
Please find a solution for main problem.

In addition, This solution does not return correct local IP as _ENV["REMOTE_ADDR"] and _SERVER["REMOTE_ADDR"] so can not be a permanent solution ...
(also may create other problems that are not yet known)
« Last Edit: 1970-01-01, 01:00:00 by Guest »
.

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Lockal IP detected on WHMCS License Information
« Reply #19 on: 2013-02-22, 11:52:25 »
Quote from: "WISTFUL"
Thanks mustafa,

But my cade is okay. because when I test it on other servers or using default proxy.conf It works well!
Please find a solution for main problem.

In addition, This solution does not return correct local IP as _ENV["REMOTE_ADDR"] and _SERVER["REMOTE_ADDR"] so can not be a permanent solution ...
(also may create other problems that are not yet known)
I will not correct this issue because it's related how to proxy work.

And it's not related to your main issue (WHMCS license).

Just modified your custom.proxy.conf and your php code where if found 'www.' then remove 'www.'.
« Last Edit: 1970-01-01, 01:00:00 by Guest »
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline WISTFUL

  • Senior Member
  • *
  • Posts: 247
  • Karma: +0/-0
    • View Profile
Re: Lockal IP detected on WHMCS License Information
« Reply #20 on: 2013-02-22, 12:17:34 »
In your opinion, is this normal that $_SERVER['SERVER_ADDR'] does not return IP address of the server in PHP?!

http://php.net/manual/en/reserved.variables.server.php
Quote
'SERVER_ADDR'
   The IP address of the server under which the current script is executing.
« Last Edit: 1970-01-01, 01:00:00 by Guest »
.

Offline WISTFUL

  • Senior Member
  • *
  • Posts: 247
  • Karma: +0/-0
    • View Profile
« Last Edit: 1970-01-01, 01:00:00 by Guest »
.

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Lockal IP detected on WHMCS License Information
« Reply #22 on: 2013-02-22, 13:46:08 »
I know your reference. Again, I don't have a plan for changing '127.0.0.1:30080' to 'real_ip:30080' as standard config for Kloxo-MR.

The reason:
1. You can access your domain with 'http://yourdomain.com/' (that mean 'http://yourdomain.com:80/') or 'http://yourdomain.com:30080/'.

Why?. Because you can see '<VirtualHost *:30080>' in domain config for apache (it's mean apache listen all ip with port 30080).

If someone know, he can DDOS this 'http://yourdomain.com:30080/'. Httpd not have mechanism for prevent DDOS. It's different with Nginx.

For better prevent, modified '<VirtualHost *:30080>' to '<VirtualHost 127.0.0.1:30080>'.

2. Using '127.0.0.1' for communicate between nginx/lighttpd to httpd is 'standard'.

3. Identified ip via $_server or other function of php directry is bad code. Better with 'small' trick for more accurate. But, it's WHMCS problem and not Kloxo-MR itself.

Simple rule, WHMCS must adjust their code for nginx/lighttpd-proxy and not otherwise.
« Last Edit: 1970-01-01, 01:00:00 by Guest »
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline WISTFUL

  • Senior Member
  • *
  • Posts: 247
  • Karma: +0/-0
    • View Profile
Re: Lockal IP detected on WHMCS License Information
« Reply #23 on: 2013-02-22, 15:50:50 »
Perfect answer, thank you very much!

Is there any way that we can set $_SERVER['SERVER_ADDR'] variable globaly? (e.g by .htaccess or php.ini)
« Last Edit: 1970-01-01, 01:00:00 by Guest »
.

 


Top 10 Social Networking:    Facebook    Twitter    LinkedIn    Pinterest    Google Plus    Tumblr    Instagram    VK    Flickr    Vine

Page created in 0.072 seconds with 21 queries.

web stats analysis