Skip to content

Instantly share code, notes, and snippets.

@evgv
Last active January 12, 2018 09:43
Show Gist options
  • Save evgv/c05195520e9fd9d60a5d2d15660c1a10 to your computer and use it in GitHub Desktop.
Save evgv/c05195520e9fd9d60a5d2d15660c1a10 to your computer and use it in GitHub Desktop.
Magento 2. Apache2 virtualhost configuration (local development)

Magento 2. Apache2 virtualhost configuration (local development)

I use AssignUserID option to differentiate access rights for my user and server user, if you also use this option, then you need to install an additional apache2 module mpm-itk, instructions below.

   sudo apt update
   sudo apt install libapache2-mpm-itk
   sudo service apache2 reload
<VirtualHost *:80>

   ServerName localhost
   ServerAlias www.m2.local m2.local
    
   ServerAdmin [email protected]
	
   DocumentRoot /var/www/m2/public_html/
   SetEnv APPLICATION_ENV "development"
   
   AssignUserID user www-data

   <Directory /var/www/m2/public_html>
      DirectoryIndex index.php

      Options All
      AllowOverride All
      Require all granted
   </Directory>

   ErrorLog /var/www/m2/logs/error.log
   CustomLog /var/www/m2/logs/access.log combined
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment