Welcome to HostingForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Strange 403 error - no problem with localhost

 
   Web Hosting Problem Solving Community! (Home) -> Apache RSS
Next:  IIS usage rights / IIS Licence ?  
Author Message
Cut

External


Since: Apr 24, 2007
Posts: 1



(Msg. 1) Posted: Tue Apr 24, 2007 1:12 pm
Post subject: Strange 403 error - no problem with localhost
Archived from groups: alt>apache>configuration (more info?)

I've searched the forums on this and can't seem to find out what's
going on.

I'm running Apache 2.2 with PHP 5 on Windows. I have a file,
index.php (below) that does load: the form with the name, password,
and submit all load on the screen. However, when I click submit, I'm
getting "You are not authorized to access this resource" regardless of
correct name/password.

Interestingly enough, when I access this page from /localhost, the
submit button works and the private data is displayed. However, when
I try to access this page from the public IP address, I'm getting a
403 error after I click submit. I've checked my httpd.conf file, but
nothing seems to be amiss. This same program works just fine on my
other computer.

Here is the file:

<?php
//create short names for variables
$name= $_POST['name'];
$password = $_POST['password'];

if(empty($name)||empty($password))
{
?>

<h1>Please Log In</h1>
<form method ="post" action="<?php $_SERVER['PHP_SELF'] ?>">
<table border = "1"
<tr>
<th>Username</th>
<td><input type="text" name="name"> </td>
</tr>
<tr>
<th>Password</th>
<td><input type="password" name="password"> </td>
</tr>
<tr>
<td colspan="2" align="center">
<input type = "submit" value = "Log In">
</td>
</tr>
</table>
</form>

<?php
}
else if($name=='foo' && $password=='bar')
{
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
//some other junk

<?php
}
?>

 >> Stay informed about: Strange 403 error - no problem with localhost 
Back to top
Login to vote
purlgurl

External


Since: Oct 24, 2003
Posts: 127



(Msg. 2) Posted: Tue Apr 24, 2007 4:16 pm
Post subject: Re: Strange 403 error - no problem with localhost [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Cut wrote:

> I've searched the forums on this and can't seem to find out what's
> going on.

> I'm running Apache 2.2 with PHP 5 on Windows. I have a file,
> index.php (below) that does load: the form with the name, password,
> and submit all load on the screen. However, when I click submit, I'm
> getting "You are not authorized to access this resource" regardless of
> correct name/password.

> Interestingly enough, when I access this page from /localhost, the
> submit button works and the private data is displayed. However, when
> I try to access this page from the public IP address, I'm getting a
> 403 error after I click submit. I've checked my httpd.conf file, but
> nothing seems to be amiss. This same program works just fine on my
> other computer.

> $name= $_POST['name'];

This can be a number of issues. My suggestion is you address
one issue at a time, then test each issue; be patient.

There are many tutorials available on the web which instruct
how to address each of these issues.

Your Windows firewall configuration could be an issue if
running an NT5 type; xp home pro media. Apache needs to be
added to your "exceptions" in your firewall to allow services
for your local network and the internet.

Apache must be running as a background service.

Check your directory permissions for the directory where you
are writing a file. You need to turn on "file sharing" for
this directory and enable "allow changing files" to write.
Usually turning on file sharing and changing files for a
parent directory containing your child directory will do.
However, this grants permission to write for all child
directories; you might not want to open up all directories.

For some very rare circumstances, you need to enable your
executable file for "run as" then select an administrator
account and enter a password. Doubtful this is a problem
but keep this in mind. A restricted local user cannot
grant permission for internet file sharing. My presumption
is your Apache is under an Administrator or All Users.
Again, doubtful this is an issue.

Check your Apache httpd.conf file to be sure a POST method
is allowed for your directory.

Your directory will need to be in Apache root, this is, under
htdocs OR aliased in your httpd.conf file with appropriate
directives enabled.

Google searching will help you with each issue.

Purl Gurl

 >> Stay informed about: Strange 403 error - no problem with localhost 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Strange problem - Hi, I have installed Apache server 1.3 on my windows box. I own a domain, for the sake of the argument lets call it mydomain.com. When I type www.mydomain.com in IE or any other browser, I get the site served correctly but the address in the top bar..

Strange Apache Problem - I have been running the following configuration for over a year with no problems. All of a sudden Apache hangs and does not respond to the client browsers. If I restart the http daemon, it works fin for about 3-5 minutes. Linux 2.2 Apache 1.3.27 PH...

strange URL-related problem. - This is a bit of a weird problem and one which I have not had before. My website (www.colinryan.net) appears to work for anyone when I give them that exact link. However for ME to access it from any of my computers, I must use http://colinryan.net..

Strange mod_proxy problem - Hi, we have an apache 1.3 running with mod_proxy as central logging server and load balancer. This worked well for years with load balancing to Windows 2000 / IIS 5 webservers. Now a new application has come and the backend webservers have been upgraded....

Strange hosting problem. - Hi. Bit of background... I host my own mailserver, and have the correct 'A' and MX records created, pointing to my IP Address and emails work fine.. I have just arranged to have my domain name hosted at a new ISP, I'm going to continue doing the DNS...
   Web Hosting Problem Solving Community! (Home) -> Apache All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]