Moved my drupal 7 site to a new server, can't login

I am having a very strange problem as I have moved my drupal site to a new server.

here's a description of the problem:

When I try to login to the login page (http://129.16.208.27/drupal/?q=user) it just reloads and I can't see my admin panel. If I try to access the admin page manually, I get an access denied message indicating that the login failed. If I find the wrong username or password, I get the same behavior. When I try to ask for a new password, the page just reloads (as above) and I don't receive any mail.

This is how I moved the site:

I copied and moved the files, exported and imported the database using phpmyadmin and edited session.php by changing base_url and editing db info.

The site works great, I can look at all the pages, but I just can't login!

Here's what I've tried:

Deleted the drupal folder and database and tried again.

Various methods are used to change the admin password (drush, MD5, in the users table in phpmyadmin).

Changed the permission of the whole drupal folder to 777.

Commented out cookie_domain in settings.php file.

Added drupal_page_footer (); $ GLOBALS ['tempUser'] = $ user; to my index.php file.

Empty all tables in a database that starts with a cache.

Tried different web browsers and cleared the cache.

Here's some more information:

The two servers have the same php version (5.2.3).

I can log into the old page without any problem.

The users table in db looks great, except that the access and login timestamps are old (from the moment I moved the server).

The watchdog table has no entries for failed logins, but when I try to access http://129.16.208.27/drupal/?q=admin it generates an entry (access denied) but the timestamp is wrong for 1 hour.

Server time is fine.

SpaceBeers asked for a watchdog table, here it is:

===Database orma

== Table structure for table watchdog

|------
|Field|Type|Null|Default
|------
|//**wid**//|int(11)|No|
|uid|int(11)|No|0
|type|varchar(64)|No|
|message|longtext|No|
|variables|longblob|No|
|severity|tinyint(3) |No|0
|link|varchar(255)|Yes|
|location|text|No|
|referer|text|Yes|NULL
|hostname|varchar(128)|No|
|timestamp|int(11)|No|0
== Dumping data for table watchdog

|3344|0|cron|Cron run completed.|a:0:{}|5| |http://129.16.208.27/drupal/| |83.233.148.7|1331513088
|3345|0|access denied|user/1|N;|4| |http://129.16.208.27/drupal/?q=user/1| |83.233.148.7|1331515605
|3346|0|cron|Cron run completed.|a:0:{}|5| |http://129.16.208.27/drupal/| |83.233.148.35|1331548875
|3347|0|cron|Cron run completed.|a:0:{}|5| |http://129.16.208.27/drupal/| |129.16.208.199|1332154845
|3348|0|cron|Cron run completed.|a:0:{}|5| |http://129.16.208.27/drupal/| |83.233.148.63|1332193286
|3349|0|access denied|admin|N;|4| |http://129.16.208.27/drupal/?q=admin| |83.233.148.63|1332195196
|3350|0|access denied|admin|N;|4| |http://129.16.208.27/drupal/?q=admin| |83.233.148.63|1332195841
|3351|0|access denied|admin|N;|4| |http://129.16.208.27/drupal/?q=admin| |83.233.148.63|1332198728
|3352|0|access denied|admin|N;|4| |http://129.16.208.27/drupal/?q=admin| |83.233.148.63|1332200257
|3353|0|access denied|admin|N;|4| |http://129.16.208.27/drupal/?q=admin| |83.233.148.63|1332200428
|3354|0|access denied|admin|N;|4| |http://129.16.208.27/drupal/?q=admin| |83.233.148.63|1332200431
|3355|0|cron|Cron run completed.|a:0:{}|5| |http://129.16.208.27/drupal/?q=user| |83.233.148.35|1332322440
|3356|0|access denied|admin|N;|4| |http://129.16.208.27/drupal/?q=admin| |76.123.53.220|1332336792
|3357|0|cron|Cron run completed.|a:0:{}|5| |http://129.16.208.27/drupal/?q=admin| |76.123.53.220|1332336792
|3358|0|access denied|admin|N;|4| |http://129.16.208.27/drupal/?q=admin| |76.123.53.220|1332336815
|3359|0|access denied|admin|N;|4| |http://129.16.208.27/drupal/?q=admin| |76.123.53.220|1332337311
|3360|0|page not found|register|N;|4| |http://129.16.208.27/drupal/?q=register| |76.123.53.220|1332337314
|3361|0|access denied|user/register|N;|4| |http://129.16.208.27/drupal/?q=user/register| |76.123.53.220|1332337322
|3362|0|access denied|user/register|N;|4| |http://129.16.208.27/drupal/?q=user/register| |76.123.53.220|1332337354
|3363|0|cron|Cron run completed.|a:0:{}|5| |http://129.16.208.27/drupal/| |83.248.70.120|1332353203
|3364|0|cron|Cron run completed.|a:0:{}|5| |http://129.16.208.27/drupal/| |130.235.234.145|1332418164
== Table structure for table watchdog

|------
|Field|Type|Null|Default
|------
|//**wid**//|int(11)|No|
|uid|int(11)|No|0
|type|varchar(64)|No|
|message|longtext|No|
|variables|longblob|No|
|severity|tinyint(3) |No|0
|link|varchar(255)|Yes|
|location|text|No|
|referer|text|Yes|NULL
|hostname|varchar(128)|No|
|timestamp|int(11)|No|0

      

I have spent many hours testing solutions without success, please help me!

+3


source to share


5 answers


Have you checked your sites settings.php

?

Make sure it matches your current data and that it is the presenter. is in the line below:



$cookie_domain = '.mydomain.co.uk';

      

+4


source


Check if server rewrite_module is enabled

I had the same problem with apache2 on ubuntu server

I ran

sudo a2enmod rewrite



then

sudo / etc / init.d / apache2 restart

and away he went :)

+18


source


Have you changed the database information in the /sites/mysite/settings.php file to match the new database?

Try clearing your drupal cache. To do this, clear each table, starting from the cache.

+1


source


This is how I fixed it!

I have installed a fresh drupal site on the server and have verified that it is working correctly. Then I gradually moved the old site piece by piece, checking after each piece if I can still login. The site looked pretty ugly in the middle of this process, but once I had everything I needed from the old site, it looked good again.

This is what chunks from the old site I moved:


databases drupal / themes
folder drupal / sites / default / files
drupal / sites / all folder
drupal / modules folder

And it works like a charm! Thanks for the help!

+1


source


We spent several hours on this and exhausted all possible options, even the "fanatical support" at rackspace was unable to fix it. I ended up paying the engineer and he found:

# yum list installed | grep suhosin
php54-suhosin.x86_64               0.9.34-20120520.1.ius.el6          @ius      
# yum remove php54-suhosin.x86_64

      

fixed the problem.

0


source







All Articles