我已经安装了证书,但是当我尝试使用https访问url时,它给了我403禁止的错误,但是当我尝试将其与http一起使用时,它就可以正常工作。
Apache Version 2.4.18
Document root /home/ubuntu/app
我已经在/ etc / ssl / certs /中安装了证书,并且具有以下文件:
在apache中,我已将.conf文件放入 1. /etc2/apach2/sites-available/test.com.conf 2. /etc2/apach2/sites-enable/test.com.conf
<VirtualHost *:80>
ServerName test.com
ServerAlias www.test.com
ErrorLog /var/log/apache2/aspnetcoredemo-error.log
CustomLog /var/log/apache2/aspnetcoredemo-access.log common
Redirect permanent "/" "https://test.com/"
<Directory /home/ubuntu/app>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:443>
ServerAdmin admin@test.com
ServerName test.com
ServerAlias www.test.com
DocumentRoot /home/ubuntu/app
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLEngine on
SSLCertificateFile /etc/ssl/certs/test_com.crt
SSLCACertificateFile /etc/ssl/certs/test_com.ca-bundle
SSLCertificateKeyFile /etc/ssl/certs/test_com.key
<Directory /home/ubuntu/app>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
我还检查并正确安装了ssl证书:
该网站是使用.net核心创建的。
我不知道我在这里错什么。