apache2 잘못된 명령 "SSLEngine"

apache2 잘못된 명령 "SSLEngine"

httpd를 다시 시작하면 다음 오류가 발생합니다. 내가 무엇을 놓치고 있나요?

[root@localhost ~]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd: Syntax error on line 22 of /etc/httpd/conf.d/sites.conf:
Invalid command 'SSLEngine', perhaps misspelled or defined by a module not included in the server configuration

다음을 사용하여 mod_ssl을 설치했습니다.yum install mod_ssl openssh

Package 1:mod_ssl-2.2.15-15.el6.centos.x86_64 already installed and latest version
Package openssh-5.3p1-70.el6_2.2.x86_64 already installed and latest version

내 sites.conf는 다음과 같습니다

<VirtualHost *:80>
#    ServerName shop.itmanx.com
    ServerAdmin [email protected]

    DocumentRoot /var/www/html/magento
    <Directory /var/www/html>
        Options -Indexes
        AllowOverride All
    </Directory>

    ErrorLog logs/shop-error.log
    CustomLog logs/shop-access.log
</VirtualHost>

<VirtualHost *:443>
    ServerName secure.itmanx.com
    ServerAdmin [email protected]

    SSLEngine on
    SSLCertificateFile /etc/httpd/ssl/secure.itmanx.com/server.crt
    SSLCertificateKeyFile /etc/httpd/ssl/secure.itmanx.com/server.key
    SSLCertificateChainFile /etc/httpd/ssl/secure.itmanx.com/chain.crt

    DocumentRoot /var/www/html/magento
    <Directory /var/www/html>
        Options -Indexes
        AllowOverride All
    </Directory>

    ErrorLog logs/shop-ssl-error.log
    CustomLog logs/shop-ssl-access.log    
</VirtualHost>

답변1

많은 시스템(Ubuntu, Suse, Debian...)에서 Apache의 SSL 모드를 활성화하려면 다음 명령을 실행하십시오.

sudo a2enmod ssl

a2enmod 매뉴얼 페이지

답변2

SSL 모듈을 로드하지 않았을 수도 있습니다. 너 하나쯤은 갖고 있어야 해모듈 로드지시문은 Apache 구성 파일 어딘가에 있습니다.

그것은 다음과 같습니다:

LoadModule ssl_module /usr/lib64/apache2-prefork/mod_ssl.so

일반적으로 모든 배포판의 Apache 구성 템플릿에는 서버가 시작될 때 Apache에 로드되는 각 모듈에 대한 지침을 loadmodule.conf찾아야 하는 (예:)라는 파일이 있습니다 .LoadModule

답변3

CentOS 7에 "mod_ssl" 패키지를 설치하고 Apache 서버를 다시 시작하면 도움이 되었습니다.

yum install mod_ssl
systemctl restart httpd

답변4

Ubntu 18.04 Bionic에서.

sudo a2enmod ssl
sudo service apache2 restart

관련 정보