Posts Tagged ‘site’

(mt) MediaTemple migrated my Server and broke my LEMP stack. (Part 2)

If you’re joining me from part 1thank you. If you are just joining you may want to check out part 1.

    When I last left you I had just installed MySql and setup a root user with a strong password. Now I need to get all the domain web files and MySql Databases to my new server,  perserving permissions and ownership, hopefully. Before I accomplish any of this I need to create users and all their directories that hold the public web files for each domain. I am then going to create all the same databases and import all the database dumps. Lastly, I want to start Nginx and test all my old configuration files before activating them all.

I created new users first using useradd.

$useradd jabo

I then rsync’d each users files one at a time to try and preserve permissions. Notice I said “try” I later had to chmod each users web directory so they could have the correct ownership. The more advanced Linux users will know why, the UID # of each user didn’t match the UID on the old server but that is another post. So Rsync is awesome. I mirrored all my web files and sent them via ssh to my new server. In verbose mode of course.

$ rsync -r -a -v -e "ssh -l root" --delete /old/Server/path/

MySql is not my favorite from the command line but since this is a new server and I was in a rush I didn’t have time to install and setup PHPAdmin. Now this did not work for me as root. I had to make a dump using each database users username and password. That also meant I had to go rooting around in some of my users WordPress installs. not to tough.

$ /usr/bin/mysqldump -u root -p --opt >/web/root/alldatabases.sql

After a quick rsync of all the database files. I logged into MySQL from the command prompt then created new databases with the same passwords and usernames. Lastly, I restored each database with their respective user.

$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 162
Server version: 5.1.41-3ubuntu12.6 (Ubuntu)
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> create database testdb;
Query OK, 1 row affected (0.00 sec)
mysql> grant all on testdb.* to 'dbuser1' identified by 'db_user_pw';
Query OK, 0 rows affected (0.00 sec)
mysql> quit

Restore each database with the appropriate username and password.

$/bin/mysql -u username -ppassword databasename < /tmp/databasename.sql

With all that said and done I was finally ready to test if this all worked. I checked my Ngnix configuration files visually to make sure they made sense. I almost rubber ducked them but it was 3 am at the time, so the prospect of my girlfriend waking up to me talking to myself in front of a dim lit monitor was not appealing. I ran Nginx with the -t option and everything worked out. I then started Nginx and BEHOLD I have CONQUERED!

Now it didn’t work all gravy right out of the box. I was spawning like 100 PHP processes and my VPS Memory was zooming! With some help from Google and the Nginx Wiki I was able to trim Nginx to pre-migration levels. I still have lots of tweaking to do to make it run leaner and allowing MySQL to run for a few weeks before I tune. After all that I still stayed with MediaTemple. I really didn’t want to go through all that again with another hosts control panel I am not familiar with or worse C-panel.


Funny thing but two weeks later Media Temple decided to migrate the “new” VPS they gave me. Luckily, I got some attention from support, the next migration went well, and had no issues this time around. I know now what went wrong and I know how to prevent it in the future.

Moving your email to Google Apps

Working in I.T. for many years the biggest energy among all users is email. From my desktop support background I can assure you that I have had my share of email problems and solutions. My favorite email solution has to be Google Apps. Google Apps is a step just above your normal Gmail email. Both are free, but Apps allows you to use a domain name that you own or gives you the option to purchase one during setup for $10 a year. Included with Google Apps is Gmail, Google Calendar, Google Docs, Google Sites, and much much more… I will go into more detail about the other services Google apps has to offer in later posts. Right now we’ll just be concerned with the initial setup of your domain and email.

You can sign up for Google Apps using the domain or website you already own, or purchase a new domain from one of Googles registration partners.

Lets get started?

  1. Go to Google Apps (for free) and click the big blue button to begin. If you are purchasing a domain you must first setup a Google Apps free account, even if you are trying to setup a Google Business Account. Google makes you get a free Apps account then you can upgrade to a free trial for Google Business. Google Business is also a great pay for service that allows you to use Outlook exchange services. $5 a year per user.
  2. Follow the instructions that appear to sign up your domain and create your Google Apps account, it is very self explanatory. The instructions are easy to follow, but there are a few things:
    • If you are setting up your own domain, you have to prove to Google that you own the domain or website. This requires that you have access to any one of the following: the domain’s or website’s DNS records (managed by your domain host or registrar), the server that hosts your domain’s web site (via FTP or SSH), or a Google Analytics account for your domain. For more details Verifying your Domain.
    • Next you need to create an email address at your domain where you’ll send and receive mail ( You are going to use this email and password to log in to your Google Apps account and manage the domain to add users, as well as access your own Google Apps services.
    • You have to provide an alternate email address that’s not in your Google Apps domain. I used a gmail address that you can easily setup fro free. This is incase you forget you password  and Google needs to send you new login credentials. This should continue to be a valid address.

After you sign up, we’ll take you to your Google Apps administrator control panel. Now you can log in to your new account, verify domain ownership (if you signed up an existing domain), and continue setting up services for your users. click on the Setup link in the navigation bar and you can use the setup wizard to add users and services.

If you’d like to see more details after that, please leave a comment, and I will consider updating this post with more detailed steps.


Updated CV

I have updated my Resume and CV. If you haven’t checked it out in awhile or ever please Click Here.

I have a new Blog post in the works about setting up your own domain to use Google Email and setting up Google Apps. Stay tuned.

Here is a video I am using to test the Youtube plugin Smart YouTube.



New Day

Today is a new day. Work flew by, I did some great work on my site, and even exercised (little as it was).  I’m using this new app called “RunKeeper,” it’s pretty easy to use and lets you track stats for a different activities; running, jumping, climbing trees, etc. This is going to be fun.

Guess what tomorrow is …?

A new Day.

Hello world!

Welcome to My Blog. This is my first post. I uploaded a bunch of Plugins to test the optimization of my Server. I work in the I.T. industry as a Customer Service Agent. I feel like I should tell you more about myself, but then you wouldn’t come back….

Stay tuned for Updates to myHome Page


Return top