Skip to content

Instantly share code, notes, and snippets.

@jorgehs91
Forked from Sorbog/magento2.dev-vhost.conf
Created April 15, 2021 20:55
Show Gist options
  • Save jorgehs91/4deb0ac28b5ac71fdba4fadd24ccbf39 to your computer and use it in GitHub Desktop.
Save jorgehs91/4deb0ac28b5ac71fdba4fadd24ccbf39 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