Я успешно развернул приложение Laravel на Apache Ubuntu 20.04 в Digital Ocean, все было хорошо, пока я не установил программное обеспечение CertBot для настройки HTTPS на моем сервере Apache. После установки и настройки certbot, когда я захожу на домашнюю страницу по ссылке HTTPS://, он работает нормально, но когда я пытаюсь посетить другие страницы по ссылке HTTPS://, я получаю следующую ошибку:
не обнаружена
Запрошенный URL-адрес не найден на этом сервере. Сервер Apache/2.4.41 (Ubuntu) на mysite.com, порт 443
Я следовал руководству по этой ссылке: https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-20-04.
Ниже приведены мои файлы конфигурации Apache.
mysite.com.conf
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName mysite.com
ServerAlias www.mysite.com
DocumentRoot /var/www/mysite.com/mysite-web-app/public
<Directory /var/www/mysite.com/mysite-web-app/public>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<IfModule mod_dir.c>
DirectoryIndex index.php index.pl index.cgi index.html index.xhtml index.htm
</IfModule>
RewriteEngine on
RewriteCond %{SERVER_NAME} =www.mysite.com [OR]
RewriteCond %{SERVER_NAME} =mysite.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
mysite.com-le-ssl.conf
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin webmaster@localhost
ServerName mysite.com
ServerAlias www.mysite.com
DocumentRoot /var/www/mysite.com/mysite-web-app/public
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/mysite.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/mysite.com/privkey.pem
</VirtualHost>
</IfModule>