Hi everyone!

RedHat Linux 7.1
Apache 1.3.19
Perl 5.005
mod_perl 1.24
embperl 
mod_ssl and openssl (precompiled from RedHat Linux 7.1)

I'm trying to establish an SSL link between browser and apache web server.
Before, I had a web page located in two different directories (bla/bla/htdocs/Intro 
and /bla/bla/htdocs/CIP). The idea is that the first directory should use the 
non-secure server and the second should use the secure server. I only want to use ONE 
ip-adress. I tried setting up the following environment in my httpd.conf file:

Port 80
Port 443

Listen 80
ServerName ip-adress
DocumentRoot "/bla/bla/htdocs"
<Directory "/bla/bla/htdocs">
AllowOverride All

        SetEnv     EMBPERL_DEBUG 0      
        PerlSetEnv      EMBPERL_LOG     /dev/null/
        <Files *.htm>
                SetHandler perl-script
                PerlHandler HTML::Embperl
                Options ExecCGI
        </Files>

        AddType text/html .htm

    Order allow,deny
    Allow from all
</Directory>



PerlRequire     AuthCookieHandler.pm

PerlSetVar      DarknessPath /CIP
PerlSetVar      DarknessLoginScript     /Login/Login.htm
PerlSetVar      AuthCookieDebug 0

<Location /Intro>
AuthType        Sample::AuthCookieHandler
AuthName        Darkness
PerlFixupHandler        Sample::AuthCookieHandler->logout
</Location>

<Files LOGIN>
AuthType        Sample::AuthCookieHandler
AuthName        Darkness
SetHandler      perl-script
PerlHandler     Sample::AuthCookieHandler->login
</Files>

AccessFileName .htaccess

NameVirtualHost ip-adress:443

RewriteEngine on
RewriteRule   ^/(.*):SSL https://%{localhost}/CIP$1 [R,L]
RewriteRule   ^/(.*):NOSSL http://%{localhost}/Intro$1 [R,L]
RewriteRule   ^/(.*):NOSSL http://%{localhost}/Login$1 [R,L]

  Listen 443
<VirtualHost ip-adress:443>

DocumentRoot "/bla/bla/htdocs/CIP"
ServerName ip-adress
SSLEngine on
SSLCertificateFile /etc/httpd/conf/ssl.crt/server.crt
SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key
Files ~ "\.(cgi|shtml)$">
    SSLOptions +StdEnvVars
</Files>
<Directory "/usr/local/www/data/site.toddle/htdocs/Intro/cgi-bin">
    SSLOptions +StdEnvVars
</Directory>
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
Error_log /var/log/httpd/ssl_error_log
CustomLog /var/log/httpd/ssl_request_log \
          "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

</VirtualHost>

I'm also using AuthCookie to provide authentication procedure in order to enter the 
protected directory (..../CIP). I specify the login handling procedures for ../CIP in 
the .htaccess file.

I want to be able to access the unprotected documents(http://...) and from them, the 
protected documents(https://) without having to write https explicitly.
With the above configuration I can get as far as the login procedure, where I'm asked 
for userid and passwd. After authenticating correctly I get a message from the browser 
saying:

"Netscape is unable to locate the server (no name specified)
Please check the server name and start again"

In my authentication handler I'm supposed to relocate to /bla/bla/CIP/document.htm:SSL 
after a successful "login" procedure.


Does anyone understand my dilemma? the ssl_error_log shows nothing and I can't enter 
https://localhost.
I'd be grateful for any help on this matter. I've tried the RedHat secure web server 
tutorial but I still don't understand how to configure the webserver for the two 
different directories.
Thanks,

Emma

PS. If I want my entire site to be SSL encrypted, can I just comment out port 80 and 
listen 80 and replace them with port 443 and listen 443? Do I have to do a virtual 
host setup?

______________________________________________________________________
Apache Interface to OpenSSL (mod_ssl)                   www.modssl.org
User Support Mailing List                      [EMAIL PROTECTED]
Automated List Manager                            [EMAIL PROTECTED]

Reply via email to