Post by PhantomMenace » Thu Nov 15, 2018 8:28 am

It says my current ip is 162.x.x.x.x while i have a completely different static wan ip,
When i go to API settings,

Also does it show the servers ip adres or my own wan ip?

Cause when i make an php file with

Code: Select all

<? echo $_SERVER["REMOTE_ADDR"]; 
and acces the file and press f5 it keeps changing to,,

New member

Posts

Joined
Wed Dec 30, 2015 6:03 am

Post by ocmta » Thu Nov 15, 2018 9:27 am

It shows $_SERVER['REMOTE_ADDR'], which is supposed to be your IP, but if your site uses something like Cloudflare, it shows Cloudflare's IP. For example, if it's Cloudflare you need to add this line in system/startup.php at the top right below <?php :

Code: Select all

if(isset($_SERVER['HTTP_CF_CONNECTING_IP']) && ip2long($_SERVER['HTTP_CF_CONNECTING_IP'])) $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP'];

Extensions for affiliates (openCart 1, 2, 3):
Advanced Multi Level Affiliate System
Customer and Affiliate Accounts Combined into one Account
Affiliate Tracking with Coupons
Discount for Referred Customers - Order Total
Type Tracking Code
Mass Pay
Affiliate Transactions for openCart 3
Affiliate Pack X - all modules with 40% discount


Active Member

Posts

Joined
Mon Mar 12, 2012 11:21 am


Post by PhantomMenace » Thu Nov 15, 2018 10:05 am

ocmta wrote:
Thu Nov 15, 2018 9:27 am
It shows $_SERVER['REMOTE_ADDR'], which is supposed to be your IP, but if your site uses something like Cloudflare, it shows Cloudflare's IP. For example, if it's Cloudflare you need to add this line in system/startup.php at the top right below <?php :

Code: Select all

if(isset($_SERVER['HTTP_CF_CONNECTING_IP']) && ip2long($_SERVER['HTTP_CF_CONNECTING_IP'])) $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP'];
That fixed the ip in the admin API settings,

Any idea how i can fix it to make an htacces file?

Code: Select all

order deny,allow
deny from all
allow from (my ip)
is not working probaly cause of cloudflare then i assume

cause the php file i made to show ip still shows random IPS

New member

Posts

Joined
Wed Dec 30, 2015 6:03 am

Post by ocmta » Thu Nov 15, 2018 4:23 pm

As far as i know, the only way is to install mod_cloudflare. But i'm not sure, i'm not an expert in all things Cloudflare. You can research (google etc.) that yourself.

Extensions for affiliates (openCart 1, 2, 3):
Advanced Multi Level Affiliate System
Customer and Affiliate Accounts Combined into one Account
Affiliate Tracking with Coupons
Discount for Referred Customers - Order Total
Type Tracking Code
Mass Pay
Affiliate Transactions for openCart 3
Affiliate Pack X - all modules with 40% discount


Active Member

Posts

Joined
Mon Mar 12, 2012 11:21 am


Post by PhantomMenace » Thu Nov 15, 2018 7:55 pm

ocmta wrote:
Thu Nov 15, 2018 4:23 pm
As far as i know, the only way is to install mod_cloudflare. But i'm not sure, i'm not an expert in all things Cloudflare. You can research (google etc.) that yourself.

thank you for your help ill try with mod_cloudlare

New member

Posts

Joined
Wed Dec 30, 2015 6:03 am

Post by paulfeakins » Thu Nov 15, 2018 8:07 pm

PhantomMenace wrote:
Thu Nov 15, 2018 10:05 am
is not working probaly cause of cloudflare then i assume
Set your hosts file on your computer to direct you straight to the server IP rather than CloudFlare.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by PhantomMenace » Thu Nov 15, 2018 9:01 pm

paulfeakins wrote:
Thu Nov 15, 2018 8:07 pm
PhantomMenace wrote:
Thu Nov 15, 2018 10:05 am
is not working probaly cause of cloudflare then i assume
Set your hosts file on your computer to direct you straight to the server IP rather than CloudFlare.
How would do i do that?

Code: Select all

# localhost name resolution is handled within DNS itself.
#	127.0.0.1       localhost
#	::1             localhost
*mywanip*    *serverip*
in the host file?

New member

Posts

Joined
Wed Dec 30, 2015 6:03 am

Post by ocmta » Thu Nov 15, 2018 9:12 pm

No, in hosts file it should be:

Code: Select all

serverip    your_site_domain_name
Then put your real IP in .htaccess and it should work, but only for your own IP, any other IP you add as "allow from" will not work, unless they access the site directly.

Extensions for affiliates (openCart 1, 2, 3):
Advanced Multi Level Affiliate System
Customer and Affiliate Accounts Combined into one Account
Affiliate Tracking with Coupons
Discount for Referred Customers - Order Total
Type Tracking Code
Mass Pay
Affiliate Transactions for openCart 3
Affiliate Pack X - all modules with 40% discount


Active Member

Posts

Joined
Mon Mar 12, 2012 11:21 am


Post by PhantomMenace » Thu Nov 15, 2018 9:39 pm

ocmta wrote:
Thu Nov 15, 2018 9:12 pm
No, in hosts file it should be:

Code: Select all

serverip    your_site_domain_name
Then put your real IP in .htaccess and it should work, but only for your own IP, any other IP you add as "allow from" will not work, unless they access the site directly.
i changed te hosting file accordingly and flushed my dns
but it is still showing random ips when conecting to ip.php
and still cant acces the page

New member

Posts

Joined
Wed Dec 30, 2015 6:03 am

Post by PhantomMenace » Sat Nov 17, 2018 2:49 am

Anyone any suggestion?

Using mod_cloudflare aint gonna work since im using a shared hosting,

New member

Posts

Joined
Wed Dec 30, 2015 6:03 am

Post by PhantomMenace » Thu Nov 22, 2018 6:21 pm

it shows my real ip when using

Code: Select all

<? echo  $ip=$_SERVER["HTTP_CF_CONNECTING_IP"];
if (!isset($ip)) {
  $ip = $_SERVER['REMOTE_ADDR'];
}
in a custome page,

is there a way to use this in my htaccess

New member

Posts

Joined
Wed Dec 30, 2015 6:03 am

Post by nightwing » Sun Apr 05, 2020 4:30 am

Did this cause any font size changes in Admin panel Extension > Extensions? Version 3.0.3.2
ocmta wrote:
Thu Nov 15, 2018 9:27 am
It shows $_SERVER['REMOTE_ADDR'], which is supposed to be your IP, but if your site uses something like Cloudflare, it shows Cloudflare's IP. For example, if it's Cloudflare you need to add this line in system/startup.php at the top right below <?php :

Code: Select all

if(isset($_SERVER['HTTP_CF_CONNECTING_IP']) && ip2long($_SERVER['HTTP_CF_CONNECTING_IP'])) $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP'];

Regards,
Nightwing
Access to my Free Extensions: https://www.opencart.com/index.php?rout ... =nightwing


Active Member

Posts

Joined
Tue Nov 05, 2019 11:08 pm


Post by nightwing » Sun Apr 05, 2020 5:27 am

You can add to

Code: Select all

System/Startup.php
Question: I am seeing a banner in Extension>Extensions seeing:
DDoS protection by Cloudflare
Ray ID: ************
The font size increase tremendously and the extension page refresh very often. I am not sure how this got there as I did not install any code for Cloudflare except the above that displays the Origin IP Address of each visitor, but even when I remove this, the banner is still there.
I opened a ticket with Cloudflare, however, does anyone have any ideas as to what's causing this? Could this be an iframe while using their CDN?
PhantomMenace wrote:
Thu Nov 22, 2018 6:21 pm
it shows my real ip when using

Code: Select all

<? echo  $ip=$_SERVER["HTTP_CF_CONNECTING_IP"];
if (!isset($ip)) {
  $ip = $_SERVER['REMOTE_ADDR'];
}
in a custome page,

is there a way to use this in my htaccess

Regards,
Nightwing
Access to my Free Extensions: https://www.opencart.com/index.php?rout ... =nightwing


Active Member

Posts

Joined
Tue Nov 05, 2019 11:08 pm


Post by straightlight » Sun Apr 05, 2020 5:34 am

seanstorm100 wrote:
Sun Apr 05, 2020 5:27 am
You can add to

Code: Select all

System/Startup.php
Question: I am seeing a banner in Extension>Extensions seeing:
DDoS protection by Cloudflare
Ray ID: ************
The font size increase tremendously and the extension page refresh very often. I am not sure how this got there as I did not install any code for Cloudflare except the above that displays the Origin IP Address of each visitor, but even when I remove this, the banner is still there.
I opened a ticket with Cloudflare, however, does anyone have any ideas as to what's causing this? Could this be an iframe while using their CDN?
PhantomMenace wrote:
Thu Nov 22, 2018 6:21 pm
it shows my real ip when using

Code: Select all

<? echo  $ip=$_SERVER["HTTP_CF_CONNECTING_IP"];
if (!isset($ip)) {
  $ip = $_SERVER['REMOTE_ADDR'];
}
in a custome page,

is there a way to use this in my htaccess
See this solution: viewtopic.php?f=202&t=216941&p=782231#p782231

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by nightwing » Sun Apr 05, 2020 9:27 pm

Thank you straightlight... You are very impressive!!! This definitely worked immediately!
straightlight wrote:
Sun Apr 05, 2020 5:34 am
seanstorm100 wrote:
Sun Apr 05, 2020 5:27 am
You can add to

Code: Select all

System/Startup.php
Question: I am seeing a banner in Extension>Extensions seeing:
DDoS protection by Cloudflare
Ray ID: ************
The font size increase tremendously and the extension page refresh very often. I am not sure how this got there as I did not install any code for Cloudflare except the above that displays the Origin IP Address of each visitor, but even when I remove this, the banner is still there.
I opened a ticket with Cloudflare, however, does anyone have any ideas as to what's causing this? Could this be an iframe while using their CDN?
PhantomMenace wrote:
Thu Nov 22, 2018 6:21 pm
it shows my real ip when using

Code: Select all

<? echo  $ip=$_SERVER["HTTP_CF_CONNECTING_IP"];
if (!isset($ip)) {
  $ip = $_SERVER['REMOTE_ADDR'];
}
in a custome page,

is there a way to use this in my htaccess
See this solution: viewtopic.php?f=202&t=216941&p=782231#p782231

Regards,
Nightwing
Access to my Free Extensions: https://www.opencart.com/index.php?rout ... =nightwing


Active Member

Posts

Joined
Tue Nov 05, 2019 11:08 pm

Who is online

Users browsing this forum: No registered users and 89 guests