-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add vhosts and letsencrypt Apache2 samples (#125)
- Loading branch information
Showing
4 changed files
with
85 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# https://microsymfony.ovh | ||
# @see https://symfony.com/doc/current/setup/web_server_configuration.html#apache | ||
# test this config with: "apache2ctl configtest" | ||
<IfModule mod_ssl.c> | ||
<VirtualHost *:443> | ||
ServerName microsymfony.ovh | ||
ServerAlias www.microsymfony.ovh | ||
DirectoryIndex index.php | ||
|
||
# Uncomment this section if you use PHP-FPM and adapt the PHP version. | ||
#<FilesMatch \.php$> | ||
# when using PHP-FPM as a unix socket | ||
#SetHandler proxy:unix:/var/run/php/php8.4-fpm.sock|fcgi://dummy | ||
|
||
# when PHP-FPM is configured to use TCP | ||
# SetHandler proxy:fcgi://127.0.0.1:9000 | ||
#</FilesMatch> | ||
|
||
# The public directory should be the only entry point to your application | ||
DocumentRoot /var/www/microsymfony.ovh/public | ||
<Directory /var/www/microsymfony.ovh/public> | ||
AllowOverride All | ||
Require all granted | ||
FallbackResource /index.php | ||
</Directory> | ||
|
||
# Uncomment the following lines if you install assets as symlinks | ||
# or run into problems when compiling LESS/Sass/CoffeeScript assets | ||
# <Directory /var/www/microsymfony.ovh> | ||
# Options FollowSymlinks | ||
# </Directory> | ||
|
||
ErrorLog /var/log/apache2/microsymfony_ovh_error.log | ||
CustomLog /var/log/apache2/microsymfony_ovh_access.log combined | ||
|
||
# Redirect www to . (optional) | ||
RewriteEngine on | ||
RewriteCond %{SERVER_NAME} =www.microsymfony.ovh | ||
RewriteRule ^ https://microsymfony.ovh [END,NE,R=permanent] | ||
|
||
# Letsencrypt for both www and non www domains to avoid a certificate error. | ||
# | ||
# Renew LE certificates with: | ||
# > certbot --apache -d microsymfony.ovh -d www.microsymfony.ovh | ||
# | ||
# or run: | ||
# > make le-renew | ||
# | ||
Include /etc/letsencrypt/options-ssl-apache.conf | ||
SSLCertificateFile /etc/letsencrypt/live/microsymfony.ovh/fullchain.pem | ||
SSLCertificateKeyFile /etc/letsencrypt/live/microsymfony.ovh/privkey.pem | ||
</VirtualHost> | ||
</IfModule> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# HTTP to HTTPS redirections | ||
<VirtualHost *:80> | ||
ServerName microsymfony.ovh | ||
ServerAlias www.microsymfony.ovh | ||
RewriteEngine on | ||
RewriteCond %{SERVER_NAME} =microsymfony.ovh [OR] | ||
RewriteCond %{SERVER_NAME} =www.microsymfony.ovh | ||
RewriteRule ^ https://microsymfony.ovh [END,NE,R=permanent] | ||
</VirtualHost> |