Skip to content

Instantly share code, notes, and snippets.

@Sorbog
Last active June 12, 2023 13:54
Show Gist options
  • Save Sorbog/c7c03d3338d3c4fd703957b79e41b709 to your computer and use it in GitHub Desktop.
Save Sorbog/c7c03d3338d3c4fd703957b79e41b709 to your computer and use it in GitHub Desktop.
Magento 2 Apache Virtual Host Configuration
<VirtualHost *:80>
ServerName magento2.dev
SetEnv MAGE_RUN_CODE "base"
SetEnv MAGE_RUN_TYPE "website"
DocumentRoot "/var/www/html/magento2.dev/pub"
<Directory "/var/www/html/magento2.dev/pub">
AllowOverride All
Order Allow,Deny
Allow from all
</Directory>
ErrorLog "/usr/local/var/log/httpd/magento2_error.log"
CustomLog "/usr/local/var/log/httpd/magento2_access.log" combined
</VirtualHost>
<VirtualHost *:443>
ServerName magento2.dev
SetEnv MAGE_RUN_CODE "base"
SetEnv MAGE_RUN_TYPE "website"
DocumentRoot "/var/www/html/magento2.dev/pub"
<Directory "/var/www/html/magento2.dev/pub">
AllowOverride All
Order Allow,Deny
Allow from all
</Directory>
SSLEngine on
SSLCertificateFile "/usr/local/etc/httpd/server.crt"
SSLCertificateKeyFile "/usr/local/etc/httpd/server.key"
ErrorLog "/usr/local/var/log/httpd/magento2_error.log"
CustomLog "/usr/local/var/log/httpd/magento2_access.log" combined
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment