実現したいこと
AWSLightsailでBitnami HTTPS Configuration Tool を 使ってhttps化した上でLaravelをインストールする。
その上でドメインにアクセスすると、Laravelのpublic/index.phpを表示させたい。
発生している問題・分からないこと
https://qiita.com/tsukashu0210/items/c849b4cff5fa7c25afac
このページを参考に、https化しました。ドメイン名でアクセスすると、httpsになっており、bitnamiのページが表示されます。
https://juno-engineer.com/article/amazon-lightsail-lamp-php8-laravel/
このページを参考にLaravelをインストールして、bitnami.confを編集しました。
サーバーを再起動してドメイン名でアクセスしても、bitnamiのページのままです。
該当のソースコード
vi /opt/bitnami/apache2/conf/bitnami/bitnami.confで編集後のbitnami.confを貼り付けます。 ----------ここから # Default Virtual Host configuration. # Let Apache know we're behind a SSL reverse proxy SetEnvIf X-Forwarded-Proto https HTTPS=on # Default Virtual Host configuration. # Let Apache know we're behind a SSL reverse proxy SetEnvIf X-Forwarded-Proto https HTTPS=on <VirtualHost _default_:80> DocumentRoot "/opt/bitnami/apache2/htdocs/laravel/public" # BEGIN: Configuration for letsencrypt Include "/opt/bitnami/apps/letsencrypt/conf/httpd-prefix.conf" # END: Configuration for letsencrypt # BEGIN: Support domain renewal when using mod_proxy without Location <IfModule mod_proxy.c> ProxyPass /.well-known ! </IfModule> # END: Support domain renewal when using mod_proxy without Location # BEGIN: Enable HTTP to HTTPS redirection RewriteEngine On RewriteCond %{HTTPS} !=on RewriteCond %{HTTP_HOST} !^localhost RewriteCond %{HTTP_HOST} !^[0-9]+.[0-9]+.[0-9]+.[0-9]+(:[0-9]+)?$ RewriteCond %{REQUEST_URI} !^/\.well-known RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [R,L] # END: Enable HTTP to HTTPS redirection <Directory "/opt/bitnami/apache2/htdocs/laravel/public"> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory> # Error Documents ErrorDocument 503 /503.html # BEGIN: Support domain renewal when using mod_proxy within Location <Location /.well-known> <IfModule mod_proxy.c> ProxyPass ! </IfModule> </Location>
試したこと・調べたこと
上記の詳細・結果
上記の内容を検索してみましたが、同じような現象は見当たりませんでした。
パスの打ち間違いかと思い、SSH接続で得たパスをコピペしてみましたが、現象変わらずbitnamiのページのままでした。
補足
特になし

0 コメント