Admin backend Access - cannot get in [ubuntu localhost]

Post By:user_17901 | Reply

 

Hi There!
Just downloaded, O/S Magento, installed on a local Ubuntu (Karmic) for sandbox webdev and Magento curiosity with a view to looking at webdev services etc.

Magneto installed aok on localhost Ubuntu nix machine in my ‘science lab’, but using my generic admin login and p/w, it won’t let me in as per usual so I can’t even get to look at the backend in detail (ohh vicar!).
I’ve changed my p/w several times in PhpMyAdmin (using MD5 function) but the admin back-end of Magento is just not having it, then back to the original.

Maybe I’ve missed something here, any pointers, I’m REALLY keen to get started on Magento and get my head ‘stressed’ out with all this new learning curve (again!!!).

Thanx in advance.
(-:

Paul B,
Lancs.

user_17902 Thu, 01 Apr 2010

 

What browser you use?

user_17901 Thu, 01 Apr 2010

 

Hi Andrew,
Thanks for the reply. I use (and have tried) both the latest strains of Firefox and Opera on an Ubuntu (latest Karmic).

I just looked again with Opera and get this following error:

Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 19456 bytes) in /var/www/magento/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Abstract.php on line 349

??? erh

Not very impressive for something over $11k IMO (ok, it’ probably something wrong on MY sandbox!).
tehe (-:

Paul B,
Lancs, UK

user_17902 Fri, 02 Apr 2010

 

if you see in .htaceess file on magento root category, you find there settings of 128 memory limit for php. Probably this settings haven’t apply! May be your php run in safe mode? Try also change your global php memory limit setting

user_6027 Mon, 05 Apr 2010

 

There is an available solution now that requires you to comment out parts of the core code allowing you to fix the problem when logging in at Magento via localhost. But instead of commenting all those line of codes which make it pretty unsecured when used in a production environment, why not detect the domain if its localhost and disable it, then restore usual function when it’s not.

This is how I did it:
http://mysillypointofview.wordpress.com/2010/03/24/how-to-fix-magentos-admin-login-failing-no-error-message-on-localhost/

user_17901 Mon, 05 Apr 2010

 
Enigma - 05 April 2010 01:51 AM

There is an available solution now that requires you to uncomment parts of the core code allowing you to fix the problem when logging in at Magento via localhost. But instead of commenting all those line of codes which make it pretty unsecured when used in a production environment, why not detect the domain if its localhost and disable it, then restore usual function when it’s not.

This is how I did it:
http://mysillypointofview.wordpress.com/2010/03/24/how-to-fix-magentos-admin-login-failing-no-error-message-on-localhost/

Thank you for your reply, it looks interesting and I followed through your instructions, However, my Ubuntu Sandbox gives the following error:

Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 4864 bytes) in /var/www/magento/lib/Varien/Autoload.php on line 93

CONFUSED!

Running:
- Ubuntu Karmic and all latest updates of mySQL, PHP etc
- Both Opera and Firefox web flavours.

I will try again and give you feedback on your homepage.

Regards

Paul B , UK

user_17902 Mon, 05 Apr 2010

 

Enigma, Do I lost in security if I simply not set cookie ‘domain’ attribute on cookies? I mean, simply disabled line 97

user_17902 Mon, 05 Apr 2010

 

paulbuk, Why you can’t increase memory_limit on your php.ini? Have you access to that file?

user_6027 Tue, 06 Apr 2010

 
paulbuk - 05 April 2010 06:37 AM

Thank you for your reply, it looks interesting and I followed through your instructions, However, my Ubuntu Sandbox gives the following error:


Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 4864 bytes) in /var/www/magento/lib/Varien/Autoload.php on line 93

CONFUSED!


Running:
- Ubuntu Karmic and all latest updates of mySQL, PHP etc
- Both Opera and Firefox web flavours.


I will try again and give you feedback on your homepage.

Regards

Paul B , UK

Hello paulbuk!

Follow Andrew Gonchar’s suggestion by increasing your memory_limit by either of the following options avaiable to you:

if you have access to php.ini, locate the line which says:

memory_limit 32M  Maximum amount of memory a script may consume (32MB)
change it to 64M or 128M depending on your available memory (requires apache restart after).

you can also do it via .htaccess file, create or open (if you have one) the file .htaccess and add the line below and adjusting it to a higher value (no apache restart needed):

php_value memory_limit 32M

or you can also add this line to your page to temporarily increase the memory_limit using ini_set() method (no apache restart required):

ini_set('memory_limit','32M');

user_6027 Tue, 06 Apr 2010

 
Andrew Gonchar - 05 April 2010 11:54 AM

Enigma, Do I lost in security if I simply not set cookie ‘domain’ attribute on cookies? I mean, simply disabled line 97

Hi Andrew,

The cookie specification says that any cookie set for one domain, must not be sent to any other domain.

Commenting out the portion where the cookie’s domain is set breaks a portion in the administration page that allows the admin to select/deselect cookie request validation thru domain.

Also by specifying a domain attribute in the cookie, an application can take measures to protect itself from flawed products that share the same hosting environment.

References:
http://www.net-security.org/article.php?id=704
http://www.net-security.org/dl/articles/cookie_path.pdf

user_17902 Wed, 07 Apr 2010

 

Thanks, Enigma. It’s important information for me!

user_6027 Thu, 08 Apr 2010

 
Andrew Gonchar - 07 April 2010 02:40 AM

Thanks, Enigma. It’s important information for me!

Sure Andrew! You’re welcome rasberry

user_17903 Tue, 27 Apr 2010

 

I found out the answer, and hope this solves your problems, too.

Operating System: Ubuntu
Web Server: Apache
Database Server: MySQL

1. edit the file on MySQL my.cnf. Exact directory is /etc/mysql/my.cnf
2. Find the ip address that says “bind-address = 127.0.0.1”
3. Change the ip address of your own computer which maybe “bind-address="192.168.0.2"
4. Restart your MySQL server. sudo /etc/init.d/apache2 restart (depends what apache server you have)
5. Reinstall Magento.

Conclusion: Magento could connect to Apache server correctly without any problem. But, when it comes to MySQL, it needs to be your own IP address and not the localhost. When you use your localhost IP address for MySQL, which is 127.0.0.1:3306, you could not log in! Magento prefers to have your own IP address - 192.168.0.2:3306, then you could log in!

Don’t mess up with the cookie codes!

user_17903 Tue, 27 Apr 2010

 

I found out the answer, and hope this solves your problems, too.

Operating System: Ubuntu
Web Server: Apache
Database Server: MySQL

1. edit the file on MySQL my.cnf. Exact directory is /etc/mysql/my.cnf
2. Find the ip address that says \"bind-address = 127.0.0.1\”
3. Change the ip address of your own computer which maybe \"bind-address=\"192.168.0.2\"
4. Restart your MySQL server. sudo /etc/init.d/apache2 restart (depends what apache server you have)
5. Reinstall Magento.

Conclusion: Magento could connect to Apache server correctly without any problem. But, when it comes to MySQL, it needs to be your own IP address and not the localhost. When you use your localhost IP address for MySQL, which is 127.0.0.1:3306, you could not log in! Magento prefers to have your own IP address - 192.168.0.2:3306, then you could log in!

Don\’t mess up with the cookie codes!

user_6027 Tue, 27 Apr 2010

 
fritzdenim - 27 April 2010 06:33 AM

I found out the answer, and hope this solves your problems, too.

Operating System: Ubuntu
Web Server: Apache
Database Server: MySQL

1. edit the file on MySQL my.cnf. Exact directory is /etc/mysql/my.cnf
2. Find the ip address that says “bind-address = 127.0.0.1”
3. Change the ip address of your own computer which maybe “bind-address="192.168.0.2"
4. Restart your MySQL server. sudo /etc/init.d/apache2 restart (depends what apache server you have)
5. Reinstall Magento.

Conclusion: Magento could connect to Apache server correctly without any problem. But, when it comes to MySQL, it needs to be your own IP address and not the localhost. When you use your localhost IP address for MySQL, which is 127.0.0.1:3306, you could not log in! Magento prefers to have your own IP address - 192.168.0.2:3306, then you could log in!

Don’t mess up with the cookie codes!

I have a few questions regarding your solution. Is there really a need to modify the MySQL setting just to accommodate one application? Is MySQL really the culprit? I was just thinking, if the Admin login is failing while the frontend can still display the homepage that extracts other information like categories, catalogs, page contents from the same MySQL database then maybe we’re barking at the wrong tree since the MySQL connection is working?

user_17903 Sat, 01 May 2010

 
Enigma - 27 April 2010 07:13 AM

I have a few questions regarding your solution. Is there really a need to modify the MySQL setting just to accommodate one application? Is MySQL really the culprit? I was just thinking, if the Admin login is failing while the frontend can still display the homepage that extracts other information like categories, catalogs, page contents from the same MySQL database then maybe we’re barking at the wrong tree since the MySQL connection is working?

If we are only using Magento for a test for our localhost, then it may be a need to modify MySQL.cnf, provided we do not use other applications. Yes, it is true that we could use it on one application (Magento) and also other applications that could connect to the ip address 192.168.0.2 on MySQL database. Some application may have different settings on MySQL.cnf. However, it is worth a try for me to set MySQL.cnf setting, if my sole purpose is to control the front end with the back end.

Cookies may also be effective, but this worked well for me.

`Reply Or Comment!
Please LogIn to Reply!