Results 1 to 7 of 7

Thread: apache SSL not working: SSL not defined

  1. #1

    Default apache SSL not working: SSL not defined

    I', configuring a web server, is workking with a virtualhost on port 80, and I'm configuring the server with SSL on port 443. But the server is not configured. I have found that the problem (one of them at least) is that the server does not listen at 443 because of listen.conf

    Code:
    #Listen 80
    #Listen 443
    
    Listen 80
    
    <IfDefine SSL>
            <IfDefine !NOSSL>
            <IfModule mod_ssl.c>
    
                    Listen 443
    
            </IfModule>
            </IfDefine>
    </IfDefine>
    from another computer I do
    Code:
    tutatis:~ # telnet 192.168.2.246  443
    Trying 192.168.2.246...
    telnet: connect to address 192.168.2.246: Connection refused

    But if I uncomment line #Listen 443 from listen.conf and restart apache, then the server answer

    Code:
    tutatis:~ # telnet 192.168.2.246  443
    Trying 192.168.2.246...
    Connected to 192.168.2.246.
    Escape character is '^]'.

    so the problem is that the line <IfDefine SSL> of listen.conf is not working, but i cant see why

    I have enabled SSL with
    Code:
    #a2enmod ssl
    #a2enflag ssl

    and it seems enabled
    Code:
    moodle:/etc/apache2 # apachectl -M
    AH00558: httpd-prefork: Could not reliably determine the server's fully qualified domain name, using 192.168.2.246. Set the 'ServerName' directive globally to suppress this message
    Loaded Modules:
     core_module (static)
     so_module (static)
     http_module (static)
     mpm_prefork_module (static)
     unixd_module (static)
     systemd_module (static)
     actions_module (shared)
     alias_module (shared)
     auth_basic_module (shared)
     authn_core_module (shared)
     authn_file_module (shared)
     authz_host_module (shared)
     authz_groupfile_module (shared)
     authz_core_module (shared)
     authz_user_module (shared)
     autoindex_module (shared)
     cgi_module (shared)
     dir_module (shared)
     env_module (shared)
     expires_module (shared)
     include_module (shared)
     log_config_module (shared)
     mime_module (shared)
     negotiation_module (shared)
     setenvif_module (shared)
     ssl_module (shared)
     socache_shmcb_module (shared)
     userdir_module (shared)
     reqtimeout_module (shared)
     php7_module (shared)
    moodle:/etc/apache2 #

    What am I missing?

  2. #2
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    5,046

    Question Re: apache SSL not working: SSL not defined

    @fperal:

    Are you suggesting that, the Apache “How-To” is incorrect?

  3. #3

    Default Re: apache SSL not working: SSL not defined

    Quote Originally Posted by dcurtisfra View Post
    @fperal:

    Are you suggesting that, the Apache “How-To” is incorrect?
    No, I am not suggesting that.

    But the syntax in opensuse differs from that in apache howto. I can't see this "<IfDefine SSL>" of listen.conf of opensuse in the apache howto. And I suppose that enabling ssl should do apache to use the configuration in the <IfDefine SSL> section, but id does not, so I'm missing something.

    So maybe the question should be what do I need to enable or configure to make apache use the configuration inside a <IfDefine SSL> section?

  4. #4
    Join Date
    Sep 2012
    Posts
    8,056

    Default Re: apache SSL not working: SSL not defined

    Quote Originally Posted by fperal View Post
    And I suppose that enabling ssl should do apache to use the configuration in the <IfDefine SSL> section, but id does not, so I'm missing something.
    You have three nested conditions and all of them must be true for code inside them to be used. Why do you think that it is <IfDefine SSL> that fails?

  5. #5

    Default Re: apache SSL not working: SSL not defined

    Quote Originally Posted by arvidjaar View Post
    You have three nested conditions and all of them must be true for code inside them to be used. Why do you think that it is <IfDefine SSL> that fails?
    You're rigt, I should have explained.
    Because this does not start apache listening on 443 either

    Code:
    #Listen 80
    #Listen 443
    
    Listen 80
    
    <IfDefine SSL>
                    Listen 443
            <IfDefine !NOSSL>
            <IfModule mod_ssl.c>
    
                    Listen 443
    
            </IfModule>
            </IfDefine>
    </IfDefine>

  6. #6
    Join Date
    Sep 2012
    Posts
    8,056

    Default Re: apache SSL not working: SSL not defined

    Quote Originally Posted by fperal View Post
    I have enabled SSL with
    Code:
    #a2enmod ssl
    #a2enflag ssl
    No, you did not. You enabled "ssl" which is not the same as "SSL".
    Code:
    <IfDefine SSL>
    The code checks for "SSL" flag, not for "ssl" flag.

  7. #7

    Default Re: apache SSL not working: SSL not defined

    Quote Originally Posted by arvidjaar View Post
    No, you did not. You enabled "ssl" which is not the same as "SSL".The code checks for "SSL" flag, not for "ssl" flag.

    Yes, that was the problem. I could have been hours searching for it and not finding it.
    I didn't notice it was case sensitive.

    Now that you have pointed it I have seen in section 24.6.2 of opensuse apache ssl guide that they say that SSL for the flag is case sensitive.

    thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •