Created
December 22, 2022 06:20
-
-
Save fiko/8fdd25da39ed4441f566acc5fe7c2ca0 to your computer and use it in GitHub Desktop.
Basic Apache Configuration
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
ServerAdmin hi@fiko.me | |
DocumentRoot /home/fiko/sites/project/middleman/public/ | |
ServerName project.dev.fiko.me | |
#ServerAlias www.domain.com | |
<Directory /home/fiko/sites/project/middleman/public/> | |
Options Indexes FollowSymLinks MultiViews | |
AllowOverride All | |
Require all granted | |
</Directory> | |
<FilesMatch \.php$> | |
# From the Apache version 2.4.10 and above, use the SetHandler to run PHP as a fastCGI process server | |
SetHandler "proxy:unix:/run/php/php8.1-fpm.sock|fcgi://localhost" | |
</FilesMatch> | |
ErrorLog ${APACHE_LOG_DIR}/error.log | |
CustomLog ${APACHE_LOG_DIR}/access.log combined |
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
ServerAdmin hi@fiko.me | |
DocumentRoot /home/fiko/sites/project/pub/ | |
ServerName project.dev.fiko.me | |
#ServerAlias www.domain.com | |
<Directory /home/fiko/sites/project/pub/> | |
Options Indexes FollowSymLinks MultiViews | |
AllowOverride All | |
Require all granted | |
</Directory> | |
<FilesMatch \.php$> | |
# From the Apache version 2.4.10 and above, use the SetHandler to run PHP as a fastCGI process server | |
SetHandler "proxy:unix:/run/php/php7.4-fpm.sock|fcgi://localhost" | |
</FilesMatch> | |
ErrorLog ${APACHE_LOG_DIR}/error.log | |
CustomLog ${APACHE_LOG_DIR}/access.log combined |
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
<VirtualHost *:80> | |
Include /etc/apache2/sites-available/project-magento.conf | |
# Redirect to https (generated by certbot --apache --redirect) | |
RewriteEngine on | |
RewriteCond %{SERVER_NAME} =project.dev.fiko.me | |
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent] | |
</VirtualHost> | |
# https (generated by certbot --apache --redirect on separated file: project-le-ssl.conf) | |
<IfModule mod_ssl.c> | |
<VirtualHost *:443> | |
Include /etc/apache2/sites-available/project-magento.conf | |
SSLCertificateFile /etc/letsencrypt/live/project.dev.fiko.me/fullchain.pem | |
SSLCertificateKeyFile /etc/letsencrypt/live/project.dev.fiko.me/privkey.pem | |
Include /etc/letsencrypt/options-ssl-apache.conf | |
</VirtualHost> | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment