LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-26-2005, 06:37 PM   #1
spandau
LQ Newbie
 
Registered: Jul 2004
Location: Philippines
Distribution: NA
Posts: 16

Rep: Reputation: 0
apache related problem (HTTP Error 403 - Forbidden )


guys i have a major problem my apache server cannot access a certain

website it tells me and my apache server : fatal error: ACCESS FORBIDDEN

if u guys have some cool ideas how can i go through with this IP BANNING

of my apache it will be greatly appreciated.

thanks in advance.
 
Old 07-26-2005, 07:59 PM   #2
mpeg4codec
Member
 
Registered: Jul 2005
Distribution: Debian, Gentoo, self-built [not LFS]
Posts: 109

Rep: Reputation: 15
Make sure the directory or file you're trying to access is world readable. For instance, if your web server's root directory is /var/www, run this command:

chmod 755 /var/www

If that doesn't work, try to access the page or file again and copy the error from Apache's error.log into the forum. You can probably find that file somewhere in /var/log, or possibly /var/log/httpd.
 
Old 07-26-2005, 08:35 PM   #3
spandau
LQ Newbie
 
Registered: Jul 2004
Location: Philippines
Distribution: NA
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by mpeg4codec
Make sure the directory or file you're trying to access is world readable. For instance, if your web server's root directory is /var/www, run this command:

chmod 755 /var/www

If that doesn't work, try to access the page or file again and copy the error from Apache's error.log into the forum. You can probably find that file somewhere in /var/log, or possibly /var/log/httpd.

hi man, i just looked over /var/log/httpd, but i didnt found the error that my apache server made...

i really have to access that specific site using my apache server for my phpscript to work...

its just that the current ipaddress my server is using is totally blocked out / banned out.......
 
Old 07-26-2005, 10:13 PM   #4
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
If you are using a PHP script to access a page on another server, and THAT server is returning HTTP 403, then you're banned, whether or not you like it. Only the administrator of that site can change that. That's why we call it access control.
 
Old 07-26-2005, 10:17 PM   #5
spandau
LQ Newbie
 
Registered: Jul 2004
Location: Philippines
Distribution: NA
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by Matir
If you are using a PHP script to access a page on another server, and THAT server is returning HTTP 403, then you're banned, whether or not you like it. Only the administrator of that site can change that. That's why we call it access control.

can apache server use public proxy server ip addresses instead of the banned ip address?
 
Old 07-26-2005, 10:30 PM   #6
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
This has nothing to do with your apache server. It has everything to do with your script. What is your PHP script attempting to do?
 
Old 07-26-2005, 11:02 PM   #7
spandau
LQ Newbie
 
Registered: Jul 2004
Location: Philippines
Distribution: NA
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by Matir
This has nothing to do with your apache server. It has everything to do with your script. What is your PHP script attempting to do?
hi thanks for your time... here is a piece of my script...




$mainUrl ="http://domainname/webpage.htm";
$mainHtml = '';
$mainHtml = file_get_contents($mainUrl);


i tried using a proxy ip address on my browser and i can get through inside the website, but when i tried running this script

its still not working.
 
Old 07-26-2005, 11:33 PM   #8
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
You'd need to code a proxy wrapper into your application. There are a few examples on the php website, just search for 'proxy'.
 
Old 07-26-2005, 11:39 PM   #9
spandau
LQ Newbie
 
Registered: Jul 2004
Location: Philippines
Distribution: NA
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by Matir
You'd need to code a proxy wrapper into your application. There are a few examples on the php website, just search for 'proxy'.
thanks matir....

can i ask what php site exactly is it?

can u give the url

thanks a lot!
 
Old 07-26-2005, 11:57 PM   #10
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
http://www.php.net
 
Old 07-27-2005, 12:01 AM   #11
spandau
LQ Newbie
 
Registered: Jul 2004
Location: Philippines
Distribution: NA
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by Matir
You'd need to code a proxy wrapper into your application. There are a few examples on the php website, just search for 'proxy'.


another followup question matir...

what exactly do you mean by a 'proxy wrapper' is it a php function wherein i can include and attach to my script in order to

use a certain proxy ip address, and run just like how successful my browser is using that proxy ip address.


thanks.
 
Old 07-27-2005, 12:10 AM   #12
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Basically, you need to open a channel to the proxy server, and connect through that channel to complete your request.

This is more than just a couple of lines of code to accomplish, and requires a fairly decent working understanding of proxy servers.

If you happen to be using PHP 5.0 or later, you can use the PEAR::Cache module to accomplish your goal, as described here:
http://bugs.php.net/bug.php?id=6701
 
Old 07-27-2005, 12:18 AM   #13
spandau
LQ Newbie
 
Registered: Jul 2004
Location: Philippines
Distribution: NA
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by Matir
Basically, you need to open a channel to the proxy server, and connect through that channel to complete your request.

This is more than just a couple of lines of code to accomplish, and requires a fairly decent working understanding of proxy servers.

If you happen to be using PHP 5.0 or later, you can use the PEAR::Cache module to accomplish your goal, as described here:
http://bugs.php.net/bug.php?id=6701

thanks... i saw an example that uses the same function file_get_contents()

the example:

<?php
$context = stream_context_create(
array('http'=>
array('proxy'=>'tcp://proxy.example.com:5100')
));

$contents = file_get_contents('http://www.somesite.com/pat/to/file',
false, $context);


?>



array('proxy'=>'tcp://proxy.example.com:5100') is where i will input my public proxy ip address say...


array('proxy'=>'tcp://203.215.76.36:3128')


wherein (203.215.76.36 is a public proxy ip and 3128 is the port for it.)


am i on the right track on this one?

thanks again
 
Old 07-27-2005, 12:25 AM   #14
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
You seem to be.
 
Old 07-27-2005, 12:39 AM   #15
spandau
LQ Newbie
 
Registered: Jul 2004
Location: Philippines
Distribution: NA
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by Matir
You seem to be.

sorry if im taking much of your time matir.... but i just implemented the piece of code... and i had an error but its a different one

its not access forbidden error..

the new error is : failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request


my code is somewhat like this:


$context = stream_context_create(
array('http'=>
//array('proxy'=>'tcp://proxy.example.com:5100')
array('proxy'=>'tcp://203.215.76.36:3128')
));

$contents = file_get_contents("http://domain.com/webpage.htm", true ,$context);


i hope you can help me figure out where does the problem arises.

thank you so much....
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
HTTP 403 (Forbidden) error lothario Fedora 6 02-08-2005 04:43 AM
Error 403 Forbidden access in Apache anoop_cn Linux - Software 1 09-21-2004 09:32 AM
apache error, 403 forbidden afrodocter Linux - Software 6 08-09-2004 08:35 PM
I Fixed Apache 403 Forbidden Problem, but how? shosterman Linux - Newbie 2 01-26-2004 10:33 AM
apache 403 error forbidden? bulliver Linux - General 4 01-31-2003 07:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration