Re: [us...@httpd] Forcing custom 404 error page instead of autoindex

2010-11-05 Thread Dennis Jacobfeuerborn

On 11/05/2010 05:08 AM, Eric Covener wrote:

On Thu, Nov 4, 2010 at 10:45 PM, Dennis Jacobfeuerborn
denni...@conversis.de  wrote:

ErrorDocument 404 /_disabled/index.html
RewriteEngine on
RewriteRule !/_disabled/ /_force_404_

The idea was to use the rewrite rule to rewrite any access to a non-existing
page and then have the ErrorDocument directive catch that but instead of a
custom error page I only get the default message The requested URL
/_force_404_ was not found on this server.



That's backwards.  You can use R=404 in the flags of a rewriterule.


That works indeed, thanks. I could have sworn I tried this before and it 
failed but that was probably for some other reason since I was juggling 
around a bit with different configuration options. Anyway this works as 
intended:


ErrorDocument 404 /_disabled/index.html
RewriteEngine on
RewriteRule .* - [R=404,L]

Regards,
  Dennis


Regards,
  Dennis

On 11/05/2010 03:31 AM, Igor Cicimov wrote:


Post the rewrite rule here.

Igor


On Nov 5, 2010 1:11 PM, Dennis Jacobfeuerborndenni...@conversis.de
mailto:denni...@conversis.de  wrote:

Hi,
I'm trying to find a way to always generate a 404 error using htaccess
when a directory is accessed and with mod_autoindex enabled.
That is when I access http://server/directory/ I want to get a 404 error
instead of an auto generated index.

I tried doing this with a RewriteRule but the autogenerated index gets
displayed anyway and disabling the Index with Options -Indexes only
gives me a 403 instead of a 404.

Is there a way to do this?

Regards,
  Dennis

-
The official User-To-User support forum of the Apache HTTP Server
Project.
SeeURL:http://httpd.apache.org/userslist.html  for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
mailto:users-unsubscr...@httpd.apache.org
   from the digest: users-digest-unsubscr...@httpd.apache.org
mailto:users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org
mailto:users-h...@httpd.apache.org




-
The official User-To-User support forum of the Apache HTTP Server Project.
SeeURL:http://httpd.apache.org/userslist.html  for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
 from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org









-
The official User-To-User support forum of the Apache HTTP Server Project.
See URL:http://httpd.apache.org/userslist.html for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
 from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



[us...@httpd] Buffering I/O for (Fast)CGI

2010-11-05 Thread YorHel
Hello,

I am considering migrating my sites from Lighttpd to Apache. And while
migrating the configuration went fine on my test server (using
mod_fcgid), there's one problem I have been unable to solve.

Lighttpd buffers the entire HTTP request in memory before passing it
to the content generator (which runs as plain CGI or FastCGI), and
buffers the entire HTTP response in case the client connection is not
fast enough. My FastCGI applications are written to process requests
as fast as possible (usually within 100ms, pages that take longer than
500ms are very rare) and with my lighttpd setup one or two processes
are enough to handle all requests while keeping the site responsive.
As each process takes almost 20MB of RAM, you can imagine that I'd
like to keep the number of processes that run simultaneously to a
minimum. Buffering I/O within the httpd server really helps me with
that.

I have not been able to find a similar feature built-in into Apache,
and while looking for solutions I came across mod_buffer in Apache
2.3. Which, if I understood its working right, does not buffer input
*before* the request is passed to the handler, but while the handler
is already handling the request. Running an alpha release on a
production server does not seem like a good idea, either.

I also found mod_security, which is a sophisticated-looking external
module that seems to be able to buffer request data, but doesn't seem
to buffer output.

This makes me wonder: is my situation that rare, or am I simply
looking in the wrong direction? What is the usual Apache way to handle
situations like this?

Thanks,
Yoran.

-
The official User-To-User support forum of the Apache HTTP Server Project.
See URL:http://httpd.apache.org/userslist.html for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
  from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



[us...@httpd] Certain Pages being served are erroring...

2010-11-05 Thread Scott Shippee
I maintain a series of web sites for the fraternal organizations I belong to
and recently we published a set of web pages to out server for one of the
sites and we are getting:

 

Parse error: syntax error, unexpected T_STRING in
/home/harmony9/www/harmonylodge9/Doric_Masonic_Center.html on line 1

 

I have traced it to the first line which is: 

 

?xml version=1.0 encoding=UTF-8?

 

Which if removed allows the page to work, HOWEVER, according to the
standards, this line should be there any ideas?

 

I have PHP  MySQL installed as well

 

Scott



RE: [us...@httpd] Apache2, MySQL and mod_dbd

2010-11-05 Thread Niklas Johansson

Hello,

Thank you for your answer. 

What I have learned now is that lmysqlclient is named differently in OSX and 
Linux. Hence, since I planned to develop on OSX but deploy on Linux, I think I 
will need to abandon OSX for this projekt and use Linux. I thought that it 
would be almost transparent, but since I have found this difference I will use 
Linux in order to avoid future problems and also for not needing to learn 
things twice, once for each OS. Also, almost all instructions are taylored for 
Linux.

Regards,
Niklas

 Date: Thu, 4 Nov 2010 19:16:39 -0400
 From: gubyd...@his.com
 To: users@httpd.apache.org
 Subject: Re: [us...@httpd] Apache2, MySQL and mod_dbd
 
 Niklas wrote:
 
  I want to use Apache2's built in functionality to authenticate and
  authorize user for accessing certain pages, mod_dbd. I want to store the
  users in MySQL.
 
  How should I set up this? I have tried a lot of things and it seems to be
  really hard getting it to work. As I understand, there is no support for
  this by default in Apache but I have to compile Apache in order to
  include the mysql driver. Today I get the Invalid command 'DBDriver'
  when starting httpd. 
 
 I have done this fairly recently.  Rather than go through it all here,
 I'll refer you to http://www.apachefriends.org/f/viewtopic.php?p=93012
 which I think is the article I found with google to figure out how to get
 things working.
 
 Essentially you need to install a third-party module to take care of the
 logins.  There are a couple of them out there, none of them updated for
 apache 2.2.x, but mysql-3.0.0 is close and a patch is available from
 another source which will bring it the rest of the way.
 
 Good luck,
 
 Sheryl
 
  I am using
  OSX 10.6.4 (I guess one can solve it as you would do in linux)
  Apache 2.2.17
  MySQL 5.1
 
  I really need to solve this and hope someone knows how to do this!
 
  Thanks in advance!
 
  Regards,
  Niklas
 
  -
  The official User-To-User support forum of the Apache HTTP Server Project.
  See URL:http://httpd.apache.org/userslist.html for more info.
  To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
from the digest: users-digest-unsubscr...@httpd.apache.org
  For additional commands, e-mail: users-h...@httpd.apache.org
 
 
 
 
 
 -
 The official User-To-User support forum of the Apache HTTP Server Project.
 See URL:http://httpd.apache.org/userslist.html for more info.
 To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
   from the digest: users-digest-unsubscr...@httpd.apache.org
 For additional commands, e-mail: users-h...@httpd.apache.org
 
  

Re: [us...@httpd] Buffering I/O for (Fast)CGI

2010-11-05 Thread Jeff Trawick
On Fri, Nov 5, 2010 at 9:36 AM, YorHel yor...@gmail.com wrote:
 Hello,

 I am considering migrating my sites from Lighttpd to Apache. And while
 migrating the configuration went fine on my test server (using
 mod_fcgid), there's one problem I have been unable to solve.

 Lighttpd buffers the entire HTTP request in memory before passing it
 to the content generator (which runs as plain CGI or FastCGI), and
 buffers the entire HTTP response in case the client connection is not
 fast enough. My FastCGI applications are written to process requests
 as fast as possible (usually within 100ms, pages that take longer than
 500ms are very rare) and with my lighttpd setup one or two processes
 are enough to handle all requests while keeping the site responsive.
 As each process takes almost 20MB of RAM, you can imagine that I'd
 like to keep the number of processes that run simultaneously to a
 minimum. Buffering I/O within the httpd server really helps me with
 that.

 I have not been able to find a similar feature built-in into Apache,
 and while looking for solutions I came across mod_buffer in Apache
 2.3. Which, if I understood its working right, does not buffer input
 *before* the request is passed to the handler, but while the handler
 is already handling the request. Running an alpha release on a
 production server does not seem like a good idea, either.

For input, mod_fcgid already does what you want (in fact it doesn't
implement any alternative).

For output, have you looked at the FcgidOutputBufferSize directive?

I looked at mod_buffer and similar logic in mod_fcgid some time ago
with the thought that mod_buffer could be used, but IIRC fcgid has
flushing unexpectedly integrated with buffering.  It would be good for
someone to separate that into separately configurable processing and
hopefully allow mod_buffer to be used to the extent possible.

 I also found mod_security, which is a sophisticated-looking external
 module that seems to be able to buffer request data, but doesn't seem
 to buffer output.

 This makes me wonder: is my situation that rare, or am I simply
 looking in the wrong direction? What is the usual Apache way to handle
 situations like this?

not rare; somebody sitting next to me at the moment complains of some
humongous Drupal (PHP) processes, 8 of which will take over a 48GB
system

-
The official User-To-User support forum of the Apache HTTP Server Project.
See URL:http://httpd.apache.org/userslist.html for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
  from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [us...@httpd] Certain Pages being served are erroring...

2010-11-05 Thread Tom Evans
On Fri, Nov 5, 2010 at 1:43 PM, Scott Shippee sship...@scoden.net wrote:
 I maintain a series of web sites for the fraternal organizations I belong to
 and recently we published a set of web pages to out server for one of the
 sites and we are getting:



 Parse error: syntax error, unexpected T_STRING in
 /home/harmony9/www/harmonylodge9/Doric_Masonic_Center.html on line 1



 I have traced it to the first line which is:



 ?xml version=1.0 encoding=UTF-8?



 Which if removed allows the page to work, HOWEVER, according to the
 standards, this line should be there any ideas?



 I have PHP  MySQL installed as well



 Scott

That is a PHP error message. You have configured Apache to serve HTML
as PHP scripts, and XML prologs are not valid in PHP (google PHP XML
prolog).

Cheers

Tom

-
The official User-To-User support forum of the Apache HTTP Server Project.
See URL:http://httpd.apache.org/userslist.html for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
  from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [us...@httpd] Buffering I/O for (Fast)CGI

2010-11-05 Thread YorHel
Thanks for the quick reply!

On 5 November 2010 15:18, Jeff Trawick traw...@gmail.com wrote:
 On Fri, Nov 5, 2010 at 9:36 AM, YorHel yor...@gmail.com wrote:
 Hello,
 ..

 I have not been able to find a similar feature built-in into Apache,
 and while looking for solutions I came across mod_buffer in Apache
 2.3. Which, if I understood its working right, does not buffer input
 *before* the request is passed to the handler, but while the handler
 is already handling the request. Running an alpha release on a
 production server does not seem like a good idea, either.

 For input, mod_fcgid already does what you want (in fact it doesn't
 implement any alternative).

Ah, I wasn't aware of that. I did test mod_cgi and found out that the
httpd wasn't buffering the input in that case. I had assumed mod_fcgid
to work similar in that regard, but I guess I was wrong. I'll do a
similar test with mod_fcgid tomorrow.

 For output, have you looked at the FcgidOutputBufferSize directive?

I'm surprised haven't noticed that option before. Looks like I was too
focused on plain CGI in my research. (for which it's not even all that
crucial to buffer I/O *sigh*) The documentation suggests it will do
what I want. I'll play around with that as well tomorrow and report my
results.

 I looked at mod_buffer and similar logic in mod_fcgid some time ago
 with the thought that mod_buffer could be used, but IIRC fcgid has
 flushing unexpectedly integrated with buffering.  It would be good for
 someone to separate that into separately configurable processing and
 hopefully allow mod_buffer to be used to the extent possible.

 I also found mod_security, which is a sophisticated-looking external
 module that seems to be able to buffer request data, but doesn't seem
 to buffer output.

 This makes me wonder: is my situation that rare, or am I simply
 looking in the wrong direction? What is the usual Apache way to handle
 situations like this?

 not rare; somebody sitting next to me at the moment complains of some
 humongous Drupal (PHP) processes, 8 of which will take over a 48GB
 system

Ouch. I will consider myself lucky, then.

-
The official User-To-User support forum of the Apache HTTP Server Project.
See URL:http://httpd.apache.org/userslist.html for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
  from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [us...@httpd] Certain Pages being served are erroring...

2010-11-05 Thread Dennis Jacobfeuerborn

On 11/05/2010 03:34 PM, Tom Evans wrote:

On Fri, Nov 5, 2010 at 1:43 PM, Scott Shippeesship...@scoden.net  wrote:

I maintain a series of web sites for the fraternal organizations I belong to
and recently we published a set of web pages to out server for one of the
sites and we are getting:



Parse error: syntax error, unexpected T_STRING in
/home/harmony9/www/harmonylodge9/Doric_Masonic_Center.html on line 1



I have traced it to the first line which is:



?xml version=1.0 encoding=UTF-8?



Which if removed allows the page to work, HOWEVER, according to the
standards, this line should be there any ideas?



I have PHP  MySQL installed as well



Scott


That is a PHP error message. You have configured Apache to serve HTML
as PHP scripts, and XML prologs are not valid in PHP (google PHP XML
prolog).


XML is fine in a php file as long as you disable short_open_tags in php.ini.

Regards,
  Dennis

-
The official User-To-User support forum of the Apache HTTP Server Project.
See URL:http://httpd.apache.org/userslist.html for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
 from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



[us...@httpd] Mod_Proxy with Basic Authentication on Target

2010-11-05 Thread Todd Simons
Hello All

We have an internal application that uses basic authentication (the browser 
prompts the user for login).   We need to make this publically available using 
Apache Reverse Proxies.

Does anyone know how to prompt and pass through the Basic Authentication?   
When I try to access the page via the Apache Reverse Proxy I get a 500 error, 
instead of a login box

Thanks!
___
Todd Simons



  
CONFIDENTIALITY NOTICE
This e-mail message from Delphi Technology, Inc. is intended only for the 
individual or entity to which it is addressed. This e-mail may contain 
information that is privileged, confidential and exempt from disclosure under 
applicable law. If you are not the intended recipient, you are hereby notified 
that any dissemination, distribution or copying of this communication is 
strictly prohibited. If you received this e-mail by accident, please notify the 
sender immediately and destroy this e-mail and all copies of it.


[us...@httpd] Please add timestamps to Apache Service Monitor

2010-11-05 Thread Ken Winter
In the Apache Service Monitor for Windows, it would be helpful if the pane
that shows an action that has been performed (e.g. The Apache2.2 service
has restarted) would include a timestamp (e.g. 2010-11-05 12:41:27: The
Apache2.2 service has restarted).  

 

This would help me, as a developer, keep track of where I'm at in my debug
cycle.

 

~ Thanks

~ Ken



[us...@httpd] mod_proxy_balancer hot standby with non-GET methods

2010-11-05 Thread Mark J. Reed
I have a reverse proxy set up in front of some RESTful web services.
I'm using mod_proxy_balancer, not to actually balance load, but to
provide for failover.  The config for a given service looks like this:

Proxy balancer://service
BalancerMember http://host1:8080/service
BalancerMember http://host2:8080/service status=+H
BalancerMember http://host3:8080/service status=+H
BalancerMember http://host4:8080/service status=+H
/Proxy

So the idea is that host1 handles all requests, then if it fails host2
takes over, etc.  (Four servers may seem like overkill in a failover
situation, but the goal was to enable failover both within and between
our two data centers; we could easily lose access to two servers at
once.)

What I'm seeing when host1 goes down is not what I expected, however.
GETs continue to succeed, but every Nth PUT or POST or DELETE to the
service fails with a 500 error.  This is what I see in the logs:

[Fri Nov 05 14:11:33 2010] [error] (111)Connection refused: proxy:
HTTP: attempt to connect to host1.local:8080 (10.98.76.101) failed
[Fri Nov 05 14:11:33 2010] [error] ap_proxy_connect_backend disabling
worker for (10.98.76.101)

Is this expected behavior?  Does the balancer not retry requests with
bodies after failing a worker?  Am I missing some flags?  Is something
else going on?

Any tips appreciated.

Thanks!
--
Mark J. Reed markjr...@gmail.com

-
The official User-To-User support forum of the Apache HTTP Server Project.
See URL:http://httpd.apache.org/userslist.html for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
  from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



[us...@httpd] Rotating logs

2010-11-05 Thread Patrick McCambridge
Because I am not a Unix person or web developer, I am struggling with the 
exercise to rotate my logs in Apache (I am running 2.2).
 
When I add the following command to my httpd.conf file, it creates a file 
called access_log.old (in the time interval I designate), but Apache still 
continues to write to the original log.
 
Here is the command I am using:
CustomLog |apache22/bin/rotatelogs /apache22/logs/archive_log 300 combine
 
How do I tweak this to ensure the new log that is created becomes the primary 
log, until it's time to replace it, and them it becomes archived?
 
Thank you in advance.
Patrick

Confidentiality Notice:
This message may contain information that is 
confidential or privileged.

If you are not the intended recipient, 
Please advise the sender immediately and delete this message.


RE: [us...@httpd] Rotating logs

2010-11-05 Thread Bennett, Tony
Patrick,

For me, examples always help the most.
Here's what we do...

TransferLog | /usr/local/apache/bin/rotatelogs -l -f 
/var/adm/syslog/apache_access_log.%m-%d-%y-%I:%M:%S 86400

This way, our apache_access_log filename is appended with the 
month-day-year-hour-minute-second... 
...and its rotated every 86400 seconds (once a day).  
You'll note we specify -l, which means all processing is done in local time.

Here's an example of one of our apache_access_log filenames:

/var/adm/syslog/apache_access_log.11-05-10-12:00:00 

hope this helps.

-tony

From: Patrick McCambridge [mailto:mcca...@fdny.nyc.gov] 
Sent: Friday, November 05, 2010 2:05 PM
To: users@httpd.apache.org
Subject: [us...@httpd] Rotating logs

Because I am not a Unix person or web developer, I am struggling with the 
exercise to rotate my logs in Apache (I am running 2.2).
 
When I add the following command to my httpd.conf file, it creates a file 
called access_log.old (in the time interval I designate), but Apache still 
continues to write to the original log.
 
Here is the command I am using:
CustomLog |apache22/bin/rotatelogs /apache22/logs/archive_log 300 combine
 
How do I tweak this to ensure the new log that is created becomes the primary 
log, until it's time to replace it, and them it becomes archived?
 
Thank you in advance.
Patrick



Confidentiality Notice:
This message may contain information that is
confidential or privileged.

If you are not the intended recipient,
Please advise the sender immediately and delete this message. 

-
The official User-To-User support forum of the Apache HTTP Server Project.
See URL:http://httpd.apache.org/userslist.html for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
  from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [us...@httpd] Rotating logs

2010-11-05 Thread Nerius Landys
There are other ways to rotate Apache logs, too.  For example, on my FreeBSD
systems, there is something called newsyslog present at the operating system
level.  There is a file named /etc/newsyslog.conf that has the following
lines on my system (I edited the file and added these lines):

# logfilename  [owner:group]mode count size when  flags
[/pid_file] [sig_num]
/var/log/httpd-access.log   644  101000 * J
/var/run/httpd.pid30
/var/log/httpd-error.log644  101000 * J
/var/run/httpd.pid30

The signal 30 on FreeBSD is SIGUSR1.  SIGUSR1 is what you send to Apache to
close the current log and start a new one, or something like that.  SIGUSR1
is probably a different number on your Linux system.  Anyhow, the entries
above in newsyslog on my system make everything work perfectly.  Logs are
rotated, archived, and removed after there are too many archived logs.

I prefer rotating logs with newsyslog.


Re: [us...@httpd] SSLRequire SUCCESS but actually failure (2 possible bugs)

2010-11-05 Thread Joe Orton
On Mon, Nov 01, 2010 at 04:42:41PM -0400, Jeff Blaine wrote:
...
 [Mon Nov 01 14:50:14 2010] [error] [client xxx.xx.160.29] access
 to /apps/rtsrv1dev/share/html/ failed, reason: SSL requirement
 expression not fulfilled (see SSL logfile for more details)
 
 However, note the SUCCESS (bogus?) via CustomLog of
 %{SSL_CLIENT_VERIFY}x

The SUCCESS doesn't sound bogus in this context - it merely indicates 
whether or not the client cert itself verified OK, which is orthogonal 
to SSLRequire.

You're not using the worker MPM here are you?

 Here's what *DOES WORK* for all parties with certificates, but
 is not really what we want, and as I understand the docs, the
 other (full DN) should work.
 
 SSLRequire %{SSL_CLIENT_S_DN_CN} in { \

Yes, the full DN comparison should work; I wouldn't necessarily 
recommend it though.

It could be an SSLRequire bug you are hitting here, can't say without 
debugging it; if you can verify with vanilla upstream 2.2.17 you could 
file a bug at issues.apache.org, or else open a support ticket with Red 
Hat for the RHEL5 package.

Regards, Joe

-
The official User-To-User support forum of the Apache HTTP Server Project.
See URL:http://httpd.apache.org/userslist.html for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
  from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org