[CentOS] apache redirection

Wed May 19 21:14:52 UTC 2010
Ski Dawg <centos at skidawg.org>

On Wed, May 19, 2010 at 2:13 PM, Craig White <craigwhite at azapple.com> wrote:
> On Wed, 2010-05-19 at 14:08 -0600, Ski Dawg wrote:
>> I found one site that said to make a change to the apache conf file,
>> which I have done. The change that I made is adding:
>> <VirtualHost xxx.xxx.xxx.xxx:80>
>>     ServerName domainname.com
>>     Redirect permanent / http://www.domainname.com/
>> </VirtualHost>
>> the certificate always matches?
> ----
> yes, put the same VirtualHost directive into /etc/httpd/conf.d/ssl.conf

Thanks for the quick response Craig.

In our ssl.conf file, our domain is not set up. The ssl configuration
for our domain is in our httpd.conf file. Is there a particular place
to put this redirect or can it just go at the end of the ssl.conf
file?

In our httpd.conf file, we have:
<IfDefine SSL>

<VirtualHost xxx.xxx.xxx.xxx:443>
    ServerName www.domainname.com
    ServerAlias domainname.com
    DocumentRoot /home/username/public_html
    UseCanonicalName off

    BytesLog /usr/local/apache/domlogs/domainname.com-bytes_log
    ScriptAlias /cgi-bin/ /home/username/public_html/cgi-bin/
    SSLEngine on
    SSLCertificateFile /etc/ssl/certs/domainname.com.crt
    SSLCertificateKeyFile /etc/ssl/private/domainname.com.key
    SSLLogFile /usr/local/apache/domlogs/domainname.com-ssl_data_log
    CustomLog /usr/local/apache/domlogs/domainname.com-ssl_log combined
    SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
</VirtualHost>
</IfDefine>

I had tried adding the redirect section into this area in our
httpd.conf file, inside the Virtualhost section, within the IfDefine,
but outside the VirtualHost section, but it still kept giving me the
error
Secure Connection Failed
(Error code: ssl_error_rx_record_too_long)


-- 
Doug

Registered Linux User #285548 (http://counter.li.org)
----------------------------------------
Never trust a computer you can't throw out a window.
   -- Steve Wozniak