Jump to content

WWW_9hub_Net

Members
  • Posts

    29
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

WWW_9hub_Net's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Following settings are working partially for me ErrorDocument 403 /403.php RewriteEngine On RewriteCond %{REMOTE_ADDR} !^10\.212\.5\.57 RewriteCond %{REMOTE_ADDR} !^10\.168\.2\.174 RewriteCond %{REMOTE_ADDR} !^10\.168\.2\.177 RewriteRule .* - [F] The 10\.168\.2\.177 and 10\.168\.2\.174 are the two servers. And these IP keep changing. I don't have any problem with the client machines. Any idea how to handle this ? I still can't figure out why only the servers are not showing correct Remote_addr when for the clients its correct.
  2. When the requests are made from client machines the Remote_addr is showing their origial IP address. ex: 10.212.4.57 ex: 10.212.5.63 These are ip addresses based on which I wanna allow/deny access. However when I made requests from two servers (ip addresses 10.212.4.53 and 10.212.5.55) to one server 10.212.4.53 the remote_addr is showing proxy Ip address which are REMOTE_ADDR 10.168.2.174 REMOTE_ADDR 10.168.2.177 why remote_addr is not showing their original ips when requests are made from them? Both of them are servers they wampserver installed and few applications. This is the common thing I can think of . I came up with this , i didn't get a chance to test. what do you think ? RewriteEngine On RewriteCond %{REMOTE_ADDR} !^10\.212\.4\. [OR] RewriteCond %{REMOTE_ADDR} !^10\.212\.5\. RewriteRule .* - [F] order allow,deny allow from 10.212.4. allow from 10.212.5. deny from all
  3. Firstly I wanna apologize for not providing necessary info. I'm a total newbie to these things. You are right seems X_FORWARDED_FOR is not available. How about using REMOTE_ADDR ? But the Remote_Addr below shown is for my server and its actually showing the proxy returned Ip address. However when I test from different machine the Remote_Addr is showing correct IP. Please find my HTTP Headers Information below. I have made the request from my server (10.212.4.53) HTTP Request GET /Hello/ HTTP/1.1 Connection keep-alive Accept image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, */* Accept-Language en-us User-Agent Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727) Accept-Encoding gzip, deflate Cookie Host 10.212.4.53:8080 X-IMForwards 20 Via 1.1 abproxy01.cde.com.fg:8080 (IronPort-WSA/6.3.3-015) HTTP Response Headers X-Powered-By PHP/5.3.3 I have also added some more info which may be relevant HTTP_CONNECTION keep-alive HTTP_ACCEPT image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, */* HTTP_ACCEPT_LANGUAGE en-us HTTP_USER_AGENT Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727) HTTP_ACCEPT_ENCODING gzip, deflate HTTP_COOKIE HTTP_HOST 10.212.4.53:8080 HTTP_X_IMFORWARDS 20 HTTP_VIA 1.1 abproxy01.cde.com.fg:8080 (IronPort-WSA/6.3.3-015) SERVER_SIGNATURE no value SERVER_SOFTWARE Apache/2.2.17 (Win32) PHP/5.3.3 SERVER_NAME 10.212.4.53 SERVER_ADDR 10.212.4.53 SERVER_PORT 8080 REMOTE_ADDR 10.168.2.174 The Ipadress I mentioned are the client ip address the ip address sent by proxy server are different and in the range 10.168.2.174
  4. Thanks for your reply. May I know how can I check http headers set by our proxy ? I would like to just allow access only from ip address in the range 10.212.4.1 to 10.212.4.60 and 10.212.5.1 to 10.212.5.60 There is no particular reason. It was users request.
  5. I have been searching regarding this and found using "x-forwarded-for" may work. So I came up with this RewriteEngine On RewriteCond %{HTTP:X-Forwarded-For} ^10\.212\.4\.$ [OR] RewriteCond %{HTTP:X-Forwarded-For} ^10\.212\.5\.$ RewriteRule .* - [F] order allow,deny allow from 10.212.4. allow from 10.212.5 deny from all However I get 403 error even accessing from allowed ips
  6. It doesn't work as I said the client's real local ip address is not captured because of proxy settings.
  7. Hi, I have 3 applications running on wampserver hosted on our intranet. I would like to block the access of applications for a certain ip range. So I edited .htaccess files for each application as below. But the application is not blocked. order deny,allow allow from 10.212.4. deny from all After checking the logs I found that the ip address the client returning was different. Since all our machines use proxy settings by default. Anyone could help me how to over come this ?
  8. Hi, I have used the following script to consume REST webservices provided by Commission Junction. I'm able to get the response but the response is not in xml format. <?php$targeturl="https://support-services.api.cj.com/v2/countries";$CJ_DevKey= "xxxxxxxxx";// return xml feed from CJ$ch = curl_init($targeturl);curl_setopt($ch, CURLOPT_POST, FAlSE);curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: '.$CJ_DevKey));curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);$response = curl_exec($ch);curl_close($ch);echo $response; // will print in browser all country codes in an xml format/*ADD YOUR OWN CODE HERE TO DO WHAT YOU WANT WITH THE RESPONSE. MAYBE SAVE RESULTS TO A FILE OR THE PARSE THE RESULTS INTO A DATABASE?*/?> I'm just confused. Isn't that the response when using REST webservices is always in xml format. Please correct me if I'm wrong. Would someone please have a look at this script and suggest me what I need to do in order to get the response in xml ? I want to save the response in xml file and then process it later. please see my current sample output here. www(dot)uedeals(dot)com/cj/cj3.php
  9. Yes I saved the code in php file and tried in browser. Is there anyway I can see the response in xml in browser ?
  10. Hello, I'm trying to get webservice response in xml format. I'm getting the response but it's not in xml. It's just text. Can someone please look at the code ? <?php $targeturl="https://api.com"; $DevKey= "xxxxx"; // return xml feed $ch = curl_init($targeturl); curl_setopt($ch, CURLOPT_POST, FAlSE); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: '.$DevKey)); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); $response = curl_exec($ch); $xml = new SimpleXMLElement($response); curl_close($ch); echo $response; // will print in browser all country codes in an xml format /* ADD YOUR OWN CODE HERE TO DO WHAT YOU WANT WITH THE RESPONSE. MAYBE SAVE RESULTS TO A FILE OR THE PARSE THE RESULTS INTO A DATABASE? */ ?>
  11. I'm currently running 5 small applications under one wampserver. I'm quite confused with performance. Please suggest me which environment among these two are better. I know there are better choices, unfortunately my resources are limited. Environment 1: OS : Windows Server 2003 R2 Stnd Ed SP2 Computer : Intel core 2 CPU 6300 @ 1.86 GHZ , 2.48 GB Ram Environment 2: OS: Windows XP Pro 2002 SP2 Computer : Intel Xeon CPU E5405 @ 2.00GHZ 2.00GHZ , 3gb Ram The five applications include joomla and livezilla. All of them are accessible via intranet only. Maximum no.of users 50. Max no of users at an instance 20.
  12. I have this fatal error. Please help me know what is wrong. Fatal error: Call to a member function result() on a non-object in C:\wamp\www\consumables\application\hooks\load_config.php on line 6 function load_config() { $CI =& get_instance(); foreach($CI->Appconfig->get_all()->result() as $app_config) { $CI->config->set_item($app_config->key,$app_config->value); } }
  13. PFMaBiSmAd, Thank you so much. The problem is fixed. I really appreciate for identifying the issue right at first sight. You are my hero
  14. I'm defining get_ipaddress in the functions.php and connecting_ip in header.php. You mean I have to define 'VALID_IP_ADDRESS_REGEX' ? Yeah I did forget to define it in functions.php // Input validating regular expressions define('VALID_IP_ADDRESS_REGEX', '^((?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:[.](?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3})|(\s*((([0-9A-Fa-f]{1,4}{7} (([0-9A-Fa-f]{1,4})|)|(([0-9A-Fa-f]{1,4}{6} (:|((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d| [01]?\d{1,2})){3})|(:[0-9A-Fa-f]{1,4})))| (([0-9A-Fa-f]{1,4}{5}(((25[0-5]|2[0-4]\d|[01]?\d{1,2}) (\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)| ((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}{4} (:[0-9A-Fa-f]{1,4}){0,1}(((25[0-5]|2[0-4]\d|[01]?\d{1,2}) (\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)| ((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}{3} (:[0-9A-Fa-f]{1,4}){0,2}(((25[0-5]|2[0-4]\d|[01]?\d{1,2}) (\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))| (([0-9A-Fa-f]{1,4}{2}(:[0-9A-Fa-f]{1,4}){0,3}(((25[0-5]|2[0-4]\d| [01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)| ((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}(:[0-9A-Fa-f]{1,4}){0,4} (((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)| ((:[0-9A-Fa-f]{1,4}){1,2})))|(:[0-9A-Fa-f]{1,4}){0,5}(((25[0-5]|2[0-4]\d| [01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)| ((:[0-9A-Fa-f]{1,4}){1,2})))|(((25[0-5]|2[0-4]\d|[01]?\d{1,2}) (\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})))(%.+)?\s*)$');
  15. I'm trying to get through our company proxy
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.