Drupal 7 - Can't login after server or database migration

I just ran into a problem where I couldn't log in to a Drupal 7 website after I moved the website from a Test environment to the Production web server. The end problem was that I didn't have the Apache mod_rewrite module enabled; fixing that problem let me log into my Drupal website.

However, I also had some file and directory permission problems, which I fixed with the help of the URL I've shown. I ran these commands, and as noted on that link, it's of course extremely important that you run these commands from within the root of your Drupal directory installation. (The first command below shows that you should 'cd' to your Drupal installation directory.) If you run these commands from another directory, you may really screw up your server (beyond repair).

Given that warning, here are the commands, which I just used successfully on my Drupal 7 Production server (after migrating the files from my Test server):

[root@localhost]cd /path_to_drupal_installation
[root@localhost]chown -R greg:www-data .
[root@localhost]find . -type d -exec chmod u=rwx,g=rx,o= {} \;
[root@localhost]find . -type f -exec chmod u=rw,g=r,o= {} \;