ローカル開発環境で、Laravelのプロジェクトをポート8080番でアクセス
サーバーの設定で Alias を使うと上手くいかなくなるので、ポート8080番でアクセスするようにした。
1・VirtualHost の設定。(/etc/apache2/sites-available/project01.conf)
<VirtualHost *:8080>
ServerName 192.168.1.50
SSLEngine on
SSLCertificateFile /path to/selfsigned.crt
SSLCertificateKeyFile /path to/selfsigned.key
DocumentRoot /var/www/html/laravel/project01/public
<Directory /var/www/html/laravel/project01/public>
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
2・ポート開放。(/etc/apache2/ports.conf に追記)
Listen 8080
3・有効化。
a2ensite project01.conf
systemctl reload apache2
4・ファイアウォール設定。
ufw allow 8080/tcp
