Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have been trying to setup SSL virtual host

    ServerAdmin webmaster@mts.com
    ServerName moclm.tap.pt
    DocumentRoot /var/www/tapme/
    <Directory />
            Options FollowSymLinks
            AllowOverride All
            Order deny,allow
            Deny from all
            Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>
    <Directory /var/www/tapme/>
            Options -Indexes FollowSymLinks MultiViews
            AllowOverride All
            #Order allow,deny
            #allow from all
    </Directory> 
    SSLEngine on
    SSLCertificateFile /etc/ssl/moclm.cer
    SSLCertificateKeyFile /etc/ssl/moclm.pem
    </VirtualHost>

For some reason, the server automatically redirect to SSL (http:// to https://). The apache is not configured to redirect and application was working fine on port 80 only. I have no knowledge how the internal network works as i am working remotely.

The SSL error logs show:

[Tue Oct 02 22:40:32 2012] [error] Hostname linemnt01.tap.pt provided via SNI and hostname moclm.tap.pt provided via HTTP are different

I thought may be the hostname has some issue and have changed the hostname of the server from "linemnt01.tap.pt" to "moclm.tap.pt" but the issue is still there.

I am getting the following error on browser:

Bad Request

Your browser sent a request that this server could not understand.

i have /etc/hosts:

    127.0.0.1       localhost.localdomain   localhost       moclm.tap.pt    moclm

and openssl returns:

    openssl verify -CAfile cert-CA.cer moclm.cer
    moclm.tap.pt.cer: OK

I have been trying to troubleshoot the issue but no luck. Need help

Thanks

share|improve this question
    
can you include the top part of your config with the Virtualhost directive? –  user16081 Oct 2 '12 at 23:00
    
ie you've shown </VirtualHost> but not <Virtualhost> (it is in your config file, right?) Also could you look for a "Listen" directive and or "NameVirtualHost" directive in your apache config files and post them here? –  user16081 Oct 2 '12 at 23:04
    
Yeah sorry i missed <virtualhost> directive. The config is OK. apachectl configtest say OK. I dont know it could be because of this name mess may be. The server is behind the dmz with reverse proxy to forward the requests. and the server has two DNS records in the internal name server. here is what i heard from the network team in the Portugal office. –  user105566 Oct 3 '12 at 19:32
    
"The server LINEMNT01 is behind a DMZ (behind a firewall). Access to it is possible via the firewall (access controlled) either directly for management purposes, or via reverse-proxy (and the firewall) for service availability. The name linemnt01.tap.pt resolves to 172.17.128.77 and my opinion is that it should remain like that because it refers to the host itself. On the other hand, moclm.tap.pt resolves to 10.129.9.142 (from internal networks) and to 91.198.90.142 (from the internet). –  user105566 Oct 3 '12 at 19:36
    
This (moclm) refers to the “service”. Access to moclm.tap.pt (either internally or from the web) is made via a reverse-proxy, which then forwards the requests to the machine linemnt01." –  user105566 Oct 3 '12 at 19:37
show 1 more comment

2 Answers

If your apache config file does not have a line like this <VirtualHost 192.168.1.100:443> you need to add that before the relevant directory block(s) in apache2/conf/extra/httpd-ssl.conf Note the ip address needs to be available on the server and your website hostname (not necessarily the server hostname!) should have a DNS record pointing to that ip address if you want SSL to work without a warning.

Assuming you start apache using apachectl, you should run apachectl configtest before restarting apache to see if there are any warnings or errors.

share|improve this answer
add comment

Guys this is a big time bug in apache-2.2.X where X>15.

i shifted to nginx and everything worked fine.

This bug is reported and apache guys are saying it will be fixed in 2.4.x.

share|improve this answer
1  
It would be useful to provide a link to reference for that bug (or relevant discussion about it) so other people finding their way to this page can read the details to see if it is the cause of their issue. –  David Spillett Aug 3 '13 at 7:36
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.