Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Dell PowerEdge Servers
  #1  
Old April 6th, 2000, 06:40 PM
devCisk devCisk is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2000
Posts: 29 devCisk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
i just installed apache 1.3.9 with php4 and was wondering how i can make it so that header function works... Well like the following gives me a server misconfiguration error:

header('WWW-Authenticate: Basic realm="Top 10 Login"');
header('HTTP/1.0 401 Unauthorized');
printf('Authorization required...');

can anyone PLEASE tell me where i can enable or tweak apahce so that the previous code would work..

also.. how i can setup custom error pages like 500 and stuff

thanks in advance!
Cisk
devcisk@ev1.net

------------------

Reply With Quote
  #2  
Old April 20th, 2000, 04:19 PM
leX leX is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2000
Posts: 3 leX User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
ahh, could somebody answer this question please. I have the same problem URL :

I'm getting 500 errors (Internal Server Errors), when i'm working with headers.

i suppose it's something in the apache conf file, that has to be turned off/on, but i'm not sure what.

Reply With Quote
  #3  
Old April 20th, 2000, 04:39 PM
freebsd
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Assuming your server allows you to override "FileInfo" (you probably can if you are allowed to use .htaccess), you can then put this line in your .htaccess file:
ErrorDocument 500 /500.html

Place this 500.html and .htaccess files in your root directory in this case.

Go to http://www.apache.org/docs/mod/core.html#errordocument to find out more..

Reply With Quote
  #4  
Old April 20th, 2000, 05:49 PM
leX leX is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2000
Posts: 3 leX User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
what i mean is when i, for example, use this script (copied from php.net) on my localhost

<?
if (!isset($PHP_AUTH_USER)) {

// If empty, send header causing dialog box to appear
header('WWW-Authenticate: Basic realm="My Private Stuff"');
header('HTTP/1.0 401 "Unauthorized"');

echo 'Authorization Required.';
exit;
}

// If not empty, display values for variables

else {

echo "
<P>You have entered this username: $PHP_AUTH_USER<br>
You have entered this password: $PHP_AUTH_PW<br>
The authorization type is: $PHP_AUTH_TYPE</p>
";

}

?>


i get an 500 error.
in my error.log i then find the following line:


[Thu Apr 20 22:34:02 2000] [error] [client 127.0.0.1] malformed header from script. Bad header=HTTP/1.0 401 "Unauthorized": c:/php/php.exe


What's going on here?


Reply With Quote
  #5  
Old November 10th, 2000, 09:30 AM
darkray77 darkray77 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2000
Posts: 1 darkray77 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Cisk,
Just wondering what platform you had installed apache and PHP under, becuase I had a similar problem. The header function dosen't seem to work the way that you have it written out under the windows environment, but I've found a statement that seems to work instead ...


Header ( "WWW-authenticate: basic realm=Restricted Area");

Header ( "Status: 401 Unauthorized");

echo "<meta http-equiv="refresh"
content="0;url=index.php">";

exit;


I really don't know about setting up custom error pages though ...

darkray77
voltron@notes.udayton.edu


<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by devCisk:
i just installed apache 1.3.9 with php4 and was wondering how i can make it so that header function works... Well like the following gives me a server misconfiguration error:

header('WWW-Authenticate: Basic realm="Top 10 Login"');
header('HTTP/1.0 401 Unauthorized');
printf('Authorization required...');

can anyone PLEASE URL tell me where i can enable or tweak apahce so that the previous code would work..

also.. how i can setup custom error pages like 500 and stuff

thanks in advance!
Cisk
devcisk@ev1.net

[/quote]


Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > Headers


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

IBM Developerworks




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway