httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Igor Galić <>
Subject Re: [users@httpd] Noobie Htaccess/ SSL authentication
Date Thu, 09 Dec 2010 18:56:40 GMT

----- "Anthony Kowalick" <> wrote:

> Excuse me for my ignorance on Apache up front and sorry if this email
> is duplicated....
> Here Is my situation (hopefully Im explaining it correctly).
> We have an apache 2 server, using AuthLDAP for htaccess user/pass.

Lets hear what #httpd Channel bot fajita has to say about that:

<fajita> Don't confuse htaccess with password-protection. The
  purpose of htaccess is to enable users to configure apache
  locally for their own directories, when they have no privilege
  to do so in httpd.conf. Using htaccess slows the server. Also
  rewriterules and redirects are more complex in htaccess

> I am trying to set it up so that if a user goes to a page which
> requires
> authentication that that htaccess login is forced to to HTTPS/SSL so
> it=B9s
> not clear text.
> For example.(folder names are not specific, examples only)
> This page requires LDAP auth but since the user didn=B9t type HTTPS
> its clear
> text.
> How can I force Apache to say OK, this isnt HTTPS, redirect to HTTPS
> and
> then pop the login box and its not clear text?
> I have tried all of these below
> * RewriteCond %{SERVER_PORT} !^443$ RewriteRule .*
> https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
> This pops the login box but only after it shows the content of the
> page
> first. =B3hello world=B2
> * SSLOptions +StrictRequire
> SSLRequireSSL
> SSLRequire %{HTTP_HOST} eq ""
> This fails to load any page if the user doesn=B9t explicitly type
> HTTPS in
> browser.
> So what I=B9m looking to do is say:
> User types in
> Apache says OK, that folder requires AUTH, lets first go to HTTPS,
> require
> LDAP login then show the page.

Maybe I can break this down to something resonable:

<VirtualHost *:80>
   DocumentRoot /srv/web/
   Redirect permanent /secure

<VirtualHost *:443>
   DocumentRoot /srv/web/

   SSLEngine On
   <Location /secure>

> Hope this makes sense.

So do I.

> Regards,
> Tony


Igor Galić

Tel: +43 (0) 664 886 22 883

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message