简体   繁体   English

apache2 服务器错误 SSL 证书

[英]Error in apache2 server for SSL certificate

So I have purchased an SSL certificate, and need to add it to my Ubuntu running apache2 web service, however for some reason, my.conf file shows me the same error over and over again.所以我已经购买了一个 SSL 证书,并且需要将它添加到我的 Ubuntu 运行 apache2 web 服务,但是由于某种原因,my.conf 文件一遍又一遍地显示相同的错误。

After running the code apache2ctl configtest they mentioned...在运行他们提到的代码apache2ctl configtest之后......

AH00526: Syntax error on line 58 of /etc/apache2/sites-enabled/eblossom.conf:
Invalid command 'SSLEngine', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.

And in my.conf file...在 my.conf 文件中...

<VirtualHost *:80>
        #ServerName www.example.com

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf

        Alias /static /home/najaaz/eblossom/static
        <Directory /home/najaaz/eblossom/static>
          Require all granted
        </Directory>

        Alias /media /home/najaaz/eblossom/media
        <Directory /home/najaaz/eblossom/media>
          Require all granted
        </Directory>

        <Directory /home/najaaz/eblossom/eblossom>
          <Files wsgi.py>
            Require all granted
          </Files>
        </Directory>


        WSGIScriptAlias / /home/najaaz/eblossom/eblossom/wsgi.py
        WSGIDaemonProcess eblossom python-path=/home/najaaz/eblossom python-home=/home/najaaz/eblossom/venv
        WSGIProcessGroup eblossom


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    </VirtualHost>                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
<VirtualHost *:443>

        SSLEngine on
        SSLCertificateFile /home/najaaz/eblossom/eblossom_lk.crt
        SSLCertificateKeyFile /home/najaaz/eblossom/eblossom.lk.key
        SSLCertificateChainFile /home/najaaz/eblossom/eblossom_lk.ca-bundle

</VirtualHost>

I a using a Django framework and I don't understand where and how this error is caused.我使用的是 Django 框架,我不明白这个错误是在哪里以及如何导致的。 Could anyone help me with this?谁能帮我解决这个问题? Thanks!谢谢!

Run the following, and try again:运行以下命令,然后重试:

a2enmod ssl && systemctl restart apache2

Basically what this command does is that, it enables mod_ssl .基本上这个命令的作用是,它启用mod_ssl

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM