0

SSLを機能させることができないようです。Web サイトを HTTPS で動作させるのに 15 時間ほど費やしました。
Comodo から SSL 証明書を取得しました。私はこれらの指示に従いました。

最初に ssl.conf の正しいフィールドを編集しようとしましたが、httpd.conf に別の仮想ホストを追加するだけになりました。ただし、どちらの方法でも、https を使用して自分のサイトにアクセスすることはできませんでした。

私のウェブサイトはfoodchute.comです。どうすればいいのかわからず、過去数日間、Apache と ssl をいじっています。どんな助けでも素晴らしいでしょう。

補足: 証明書チェーン ファイルは PEM でエンコードする必要がありますか? 私のチェーン ファイルは 4 つの証明書のみで構成されています。デフォルトのチェーン ファイルを調べたところ、一連の証明書と次のようなその他の情報が表示されました。

Certificate:

Data:
    Version: 3 (0x2)
    Serial Number:
        61:8d:c7:86:3b:01:82:05
    Signature Algorithm: sha1WithRSAEncryption
    Issuer: CN=ACEDICOM Root, OU=PKI, O=EDICOM, C=ES
    Validity
        Not Before: Apr 18 16:24:22 2008 GMT
        Not After : Apr 13 16:24:22 2028 GMT
    Subject: CN=ACEDICOM Root, OU=PKI, O=EDICOM, C=ES
    Subject Public Key Info:
        Public Key Algorithm: rsaEncryption
            Public-Key: (4096 bit)
            Modulus:
                00:ff:92:95:e1:68:06:76:b4:2c:c8:58:48:ca:fd:
                80:54:29:55:63:24:ff:90:65:9b:10:75:7b:c3:6a:
                db:62:02:01:f2:18:86:b5:7c:5a:38:b1:e4:58:b9:
                fb:d3:d8:2d:9f:bd:32:37:bf:2c:15:6d:be:b5:f4:
                21:d2:13:91:d9:07:ad:01:05:d6:f3:bd:77:ce:5f:
                42:81:0a:f9:6a:e3:83:00:a8:2b:2e:55:13:63:81:
                ca:47:1c:7b:5c:16:57:7

これらは私のファイルです。httpd.conf

</VirtualHost>

<VirtualHost *:80>
    DocumentRoot /home/ec2-user/foodchute/foodchute
    ServerName www.foodchute.com
    #Redirect / https://23.23.93.154/
    ErrorLog /home/ec2-user/foodchute/foodchute/logs/apache_error.log
    CustomLog /home/ec2-user/foodchute/foodchute/logs/apache_access.log combined
    WSGIScriptAlias / /home/ec2-user/foodchute/foodchute/foodchute/wsgi.py

    <Directory /home/ec2-user/foodchute/foodchute/foodchute>
    <Files wsgi.py>
        Order deny,allow
        Allow from all
    </Files>
    </Directory>

    <Directory /home/ec2-user/foodchute/foodchute/images>
        Order deny,allow
        Allow from all
    </Directory>

    <Directory /home/ec2-user/foodchute/foodchute/foodchute>
        Order deny,allow
        Allow from all
    </Directory>

    #LogLevel warn

    #Alias /media/ /home/djangotest/helloworld/media

</VirtualHost>

<VirtualHost *:443>
    SSLEngine On
    SSLCertificateFile /etc/pki/tls/certs/foodchute.crt
    SSLCertificateKeyFile /etc/pki/tls/certs/foodchute.key
    SSLCertificateChainFile /etc/pki/tls/certs/foodchute.ca-bundle

    DocumentRoot /home/ec2-user/foodchute/foodchute
    ServerName www.foodchute.com
    #Redirect / https://23.23.93.154/
    ErrorLog /home/ec2-user/foodchute/foodchute/logs/apache_error.log
    CustomLog /home/ec2-user/foodchute/foodchute/logs/apache_access.log combined
    WSGIScriptAlias / /home/ec2-user/foodchute/foodchute/foodchute/wsgi.py

    <Directory /home/ec2-user/foodchute/foodchute/foodchute>
    <Files wsgi.py>
        Order deny,allow
        Allow from all
    </Files>
    </Directory>

    <Directory /home/ec2-user/foodchute/foodchute/images>
        Order deny,allow
        Allow from all
    </Directory>

    <Directory /home/ec2-user/foodchute/foodchute/foodchute>
        Order deny,allow
        Allow from all
    </Directory>

    #LogLevel warn

    #Alias /media/ /home/djangotest/helloworld/media

</VirtualHost>

WSGIPythonPath /home/ec2-user/foodchute/venv/lib/python2.6/site-packages

Alias /static/ /home/ec2-user/foodchute/venv/lib/python2.6/site-packages/django/contrib/admin/static/

wsgi.py

"""
WSGI config for foodchute project.

This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` setting.

Usually you will have the standard Django WSGI application here, but it also
might make sense to replace the whole Django WSGI application with a custom one
that later delegates to the Django one. For example, you could introduce WSGI
middleware here, or combine a Django application with an application of another
framework.

"""
import os,sys

apache_configuration = os.path.dirname(__file__)
project = os.path.dirname(apache_configuration)
workspace = os.path.dirname(project)
sys.path.append(workspace)
sys.path.append('/home/ec2-user/foodchute/foodchute')
sys.path.append('/home/ec2-user/foodchute')

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "foodchute.settings")

# This application object is used by any WSGI server configured to use this
# file. This includes Django's development server, if the WSGI_APPLICATION
# setting points here.
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

# Apply WSGI middleware here.
# from helloworld.wsgi import HelloWorldApplication
# application = HelloWorldApplication(application)
4

1 に答える 1

0

これを修正しました。Amazon ec2 インスタンスのポート 423 を開くのを忘れていました......問題は解決しました。

于 2012-09-23T23:00:42.177 に答える