1

Magento 2.0.2 installed from composer, when I try to navigate to Web Setup Wizard: http://mg2.com/admin_url/admin/backendapp/redirect/app/setup/ It takes me to http://mg2.com/setup which in turn produces 404 page Magento is setup to use /pub as document root, with apache mod_php Any ideas why is it not working?

Update:

Since Magento was configured with pub as site root, I decided that this might cause the issue, so I changed apache config to serve from Magento root. Did not make any difference, still http://mg2.com/setup produces 404

6
  • any error log available Petar?
    – phanvugiap
    Commented Feb 15, 2016 at 18:52
  • unfortunately none. I should mention that Magento was installed from cli so i didn't need to access web wizard during install. Commented Feb 15, 2016 at 19:07
  • Did you check file permissions?
    – Maddy
    Commented Apr 1, 2016 at 17:09
  • Oh yeah, file permissions are fine. This is developer site, so server runs under my personal user. Compilation completes fine. Commented Apr 1, 2016 at 17:10
  • Anything in server logs?
    – Maddy
    Commented Apr 1, 2016 at 19:43

6 Answers 6

2

So when you have the case of Magento being served out of pub one solution to have access to setup is to configure an alias. To do that in apache, you may do something like the following.

<VirtualHost *:80>
    ServerName m2.local
    ServerAdmin [email protected]
    DocumentRoot "/var/www/magento202/pub"

    <Directory "/var/www/magento202/pub">
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
    Alias "/setup" "/var/www/magento202/setup"
    Alias "/update" "/var/www/magento202/update"
</VirtualHost>

Probably not the most elegant solution but it works.

1
  • Hi, I am still not able to access admin dashboard, any suggestion? Commented Sep 1, 2020 at 4:58
0

first, you are right, when the webserver is configured to have the pub/ directory as root (which is the right way in a production env) the /setup path is not reachable, since it is installed in the path magento_root/setup.

The key question here would then be how you installed magento from cli and if everything was installed correctly.

You should have a /setup directory in you magento root containing all needed files https://github.com/magento/magento2/tree/develop/setup

===EDIT===

although I'm not sure how this is handled when you are navigating from admin and have the pub directory as web root. My second thought is that this should work, but I have not testet it yet

2
  • I installed using composer. Everything else worked fine and works fine. Event if served fro pub, setup should be reachable, it is being redirected to specific router from web setup wizard menu. I am trying to perform upgrade to 2.0.3 as described in the documents. Commented Apr 2, 2016 at 18:26
  • 1
    Just an update, changing site document root to Magento root, and restarting apache gave me access to setup, it is still however good to know if it is not supposed to work at all when served from pub, or if it is a bug. Commented Apr 2, 2016 at 19:03
0

I started getting this error when I switched the web server config to point to /pub instead of /.

Reverting the above back to / fixes the issue.

0

Just create symlink inside pub directory:

ln -s ../setup setup

After this you will be able to navigate to Web Setup Wizard.

0

pub and setup are at the same level, you won't be able to run the Web Setup Wizard if pub is your root. It's designed that way so that if you use pub as your docroot in production, no one can access the Web Setup Wizard.

Here's what we advise: "create another subdomain or docroot that uses the Magento installation directory as its root."

0

Solution for me was:

Base URLs (Secure)
-> Use Secure URLs on Storefront -> Yes
-> Use Secure URLs in Admin -> Yes
-> Enable HTTP Strict Transport Security (HSTS) -> Yes
-> Upgrade Insecure Requests -> Yes

php bin/magento cache:clean

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.