0

Ducument root is /var/www/html

Magento root is /var/www/html/magento

I tried the virtual directory like

VirtualHost *:80>
    DocumentRoot /var/www/html/magento
    <Directory /var/www/html/magento>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
    </Directory>
</VirtualHost>

But this broke my frontend page and admin page.

2
  • You need Set require all granted: <Directory /var/www/html/magento> Require all granted </Directory> after that static content deploy and flush the cache using this command: php bin/magento setup:static-content:deploy php bin/magento cache:flush
    – shail
    Commented Jul 13, 2018 at 4:53
  • It didn't work.
    – stevieki
    Commented Jul 13, 2018 at 5:22

1 Answer 1

0

This one is working for me.

<VirtualHost *:80>
    ServerAdmin [email protected]
    ServerName magento2.local.com
    ServerAlias www.magento2.local.com
    DocumentRoot /var/www/html/magento21
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    <Directory /var/www/html/magento21>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
   </Directory>
</VirtualHost>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.