cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2 admin login not working

Magento 2 admin login not working

We have moved our Magento 2 build from an Linux Apache server to a Linux Nginx Server ... with some troubleshooting we managed to get everything working again with the exception of the Admin login. 

 

What has been done:
cache flush, session truncated for db, inserted new admin, reset admin password, checked ngnix error logs (nothing related), made sure admin is "unlocked" via db

 

Still will not work with new admin or old admin. I can login via the frontend with customer accounts and they all work. its just the admin that is not working, and idea why?

 

6 REPLIES 6

Re: Magento 2 admin login not working

Hello @patrickpla5aa2 

 

Please follow the below steps to solve the issue.

 

It’s because your server does not enable rewrite mode.

Solution

  1. Enable Rewrite mode
sudo a2enmod rewrite
  1. Configure apache

For Ubuntu / Debian edit the file /etc/apache2/apache2.conf. To edit this file, you can run command

sudo vi /etc/apache2/apache2.conf 

Modify from:

<Directory /var/www/>
     Options Indexes FollowSymLinks
     AllowOverride None
     Require all granted
</Directory>

to

<Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

Then restart apache

sudo service apache2 restart

or

sudo /etc/init.d/apache2 restart

Problem 3: Page 403 Forbidden errors

If you are experencing with 403 Forbidden errors while accessing to Magento store, you should update Apache configuration to allow visitors access to your site.

Solution

  • Open apache2.conf file
  • For Ubuntu, the file /etc/apache2/apache2.conf. To edit this file run command
sudo vi /etc/apache2/apache2.conf 

Update like this:

 

<Directory /var/www/>
	Options Indexes FollowSymLinks MultiViews
	AllowOverride All
	Order allow,deny
	Allow from all
</Directory>

 

If my answer is helpful full then please set the accept solution flag and kudos flag so other members can take the same reference.

Re: Magento 2 admin login not working

my setup is Nginx, not Apache. I will research a rewrite mode for nginx


@dipmegpro wrote:

Hello @patrickpla5aa2 

 

Please follow the below steps to solve the issue.

 

It’s because your server does not enable rewrite mode.

Solution

  1. Enable Rewrite mode
sudo a2enmod rewrite
  1. Configure apache

For Ubuntu / Debian edit the file /etc/apache2/apache2.conf. To edit this file, you can run command

sudo vi /etc/apache2/apache2.conf 

Modify from:

<Directory /var/www/>
     Options Indexes FollowSymLinks
     AllowOverride None
     Require all granted
</Directory>

to

<Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

Then restart apache

sudo service apache2 restart

or

sudo /etc/init.d/apache2 restart

Problem 3: Page 403 Forbidden errors

If you are experencing with 403 Forbidden errors while accessing to Magento store, you should update Apache configuration to allow visitors access to your site.

Solution

  • Open apache2.conf file
  • For Ubuntu, the file /etc/apache2/apache2.conf. To edit this file run command
sudo vi /etc/apache2/apache2.conf 

Update like this:

 

<Directory /var/www/>
	Options Indexes FollowSymLinks MultiViews
	AllowOverride All
	Order allow,deny
	Allow from all
</Directory>

 

If my answer is helpful full then please set the accept solution flag and kudos flag so other members can take the same reference.


 

Re: Magento 2 admin login not working

You can use this link to setup your magento it will start work fine:

 

https://magecomp.com/blog/fix-404-error-page-not-found-admin-url-magento-2/

 

Thanks

Re: Magento 2 admin login not working

That link is for apache i have an Nginx setup

Re: Magento 2 admin login not working

There are a few areas I would troubleshoot to debug the Magento 2 admin login not working after migrating from Apache to Nginx:

  • Check Nginx config for proper rewrite rules to allow admin URI access. The standard Magento 2 .htaccess rules need to be converted to Nginx format.
  • Enable developer mode, check for JS errors on the admin page and exceptions in logs.
  • Compare PHP versions between Apache vs Nginx - incompatibilities can cause login failures.
  • Look for custom modules/extensions that may be tied to Apache modules like mod_security and causing conflicts.
Avid learner and technical marketer at devrims.com

Re: Magento 2 admin login not working

This solution is worked for me.
Thank you