Categories
advice and tips

Move WordPress from Share Hosting to DigitalOcean

Reading Time: 4 minutes

(Original 11-12-2015)
I decided to give cloud server another try, after my failed attempt to move WordPress from shared hosting to Amazon AWS last year. This time I go with DigitalOcean as I heard good things from my friend Don (who made this cool makeyourcase site and api).

Decision choosing Apache or Nginx
I chose Nginx over Apache due to 2 reasons:
1) I had fairly bad experience running Apache web server on Amazon tc2 micro instance last year. It was fighting for resources with MySQL server;
2) I saw Nginx getting popular recently. And it must have its own strength (performance, scale better). Did read Apache vs Nginx: Practical Considerations.

Some tips and tricks
1) Need to fix the extension for php in nginx setting. Follow this instruction will help, for php the key is the location setting below:

location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

2) I found again I could not update the plugins after the move, found again this is due to file permission problem. After I grant the correct file permission to wp-content folder, it appears update plugin fine (kebo twitter plugin). Actually the initial problem was the twitter feed was not showing, which leads me to the plugin update. In the process I also changed the twitter feed.

3) A related problem is I went to this maintenance page, after I started updating a bunch of plugins. It appears stopped at the “related post” plugin.

Briefly unavailable for scheduled maintenance. Check back in a minute.

The fix was to delete the .maintenance file in the website root folder (refer to this thread at wordpress site)

Useful links
WordPress
How To Install WordPress with Nginx on Ubuntu 14.04

How To Install Linux, nginx, MySQL, PHP (LEMP) stack on Ubuntu 14.04

Virtual host
How To Set Up Nginx Server Blocks (Virtual Hosts) on Ubuntu 14.04 LTS

Host name (DNS)
How To Set Up a Host Name with DigitalOcean

Migrate
How To Migrate WordPress from Shared Hosting to a Cloud Server with Zero Downtime

Ubuntu initial setup
Initial Server Setup with Ubuntu 14.04

Additional Recommended Steps for New Ubuntu 14.04 Servers (think security 🙂

How To Add Swap on Ubuntu 12.04

In general, I think those articles/tutorials above made the job of newbie’s much easier. For me personally I have some UNIX/Linux/Mac experience (and concept), but I’ve never done system admin job full time. Those instructions made my life much easier.

Overall impression 
I spent about total 3 hours to spin up the Linux server, MySQL and nginx web servers, install and set up WordPress, and move site from shared hosting to droplet. The next step is to see the reliability of this setup, if everything is ok, I plan to move stlplace.com to here.

(Update 12-02-2015)
Started working on moving stlplace.com from shared hosting to droplet. That site is about 10 times bigger because it has my 10 years blogs. Encountered a few problems shown below. Was able to overcome so far. It’s up and running and let’s see if the droplet will hold up 🙂

1) Moving of mysql database: from my past experience, direct export via phpmysqladmin won’t work. I tried command line approach again. Note I tried the .gz file format as well, but it failed during import (may due to my data problem in the old mysql db). But regular .sql importing worked.

2) The permanent links stopped working, after looking at the php setting for nginx, file (folder) permission, finally I was able to compare this with uudaddy.com, and found I miss this line for /etc/nginx/sites-available/stlplace.com :
try_files $uri $uri/ /index.php?q=$uri&$args;

After adding this line, the permanent links worked.

The remaining task is to make Chinese characters show properly. I encountered this problem last time when moving it to Amazon AWS. Luckily I found this life saver from wordpress.org (I kind of sensed it as I read from the old wp-config.php, I something much simpler, it does not have the following 2 lines):
======
Not encoding – collation.
In the newer version of WP the config file has two new lines:

define(‘DB_CHARSET’, ‘utf8’);
define(‘DB_COLLATE’, ”);
If it is an upgrade, delete those two lines!
======

Last but not least, I found I could not update the plugin again after installation. After much try and error, trying to emualte uudaddy.com setup (which works), I found this article on digitalOcean about setup wordpress FTP user/keys for update. I followed along and was able to made it work as desired.

(Update 12-03-2015) I also moved a small wordpress site (happymandarin) from shared hosting to droplet. The one obstacle here was I manually changed the ‘siteurl’ and ‘home’ of wp_options table from happymandarin.stlplace.com (this is a legacy of shared hosting feature) to www.stlplace.com/happymandarin. Btw, this is my wife’s site.

(Update: sometime in the early part of 2019, likely between Apr to June) I updated the ubuntu from 14 to 16, in the process I also upgraded the PhP version. Had to do a small fix (change) to make sure the php continues to work on nginx side.

(Update 03-14-2020 Pi Day) I moved the uudaddy.com wordpress site under stlplace.com/uudaddy. There was some small technical challenges, but the steps are similar to the one above. I also found out the wordpress update (one click update) prompt me to the annoying ftp credentials. It seems the digital ocean article above (2013) no longer works. I changed the folder ownership from wp-user:wp-user to www-data:www-data, as well as adding this line define(‘FTP_METHOD’, ‘direct’ ); to wp-config.php , now the one click update seems to work. Not sure if it will have any other issues for example, upload a picture in wordpress etc. I will update as time goes.

Btw, the reason I moved uudaddy.com (not renewing the domain) is mainly for consolidation. The godaddy.com asks for $18 for domain per year. It seems to me it’s a bit overpriced. My stlplace.com domain expires in 2022. That’s the only dependency I have for godaddy. For some tech people, it seems Godaddy does not have high reputation.

Also, how to get free ssl cert.

Categories
advice and tips finance

A few Checking account promotions

Reading Time: 3 minutes(Update 11-05-2015) Citibank Gold Checking account offer: 50,000 AA miles or 50,000 ThankYou Points (doctorofcredit has a detailed explanation and step-to-step guide). This seems like good deal even consider $90 monthly fees (3 months). Also, a top on checks. Sometimes it cost money to get beginning checks for a checking acct. One way to workaround is to use PayPal as a conduit. I recall I used it long time ago when I sold stuff on ebay. Almost forgot about it as I have not done it for years. One drawback compared to check is PayPal is a bit slower because it adds a layer.

(Update 10-16-2015) Two more checking account offers. Santander and TD Bank (expired 11/05/2015, per hustlermoneyblog). Both offers $150 for opening account and direct deposit for (Santander), 15 debit transactions for TD Bank.

(Update 10-08-2015) Hunnington Bank is doing a $200 checking account offer. Here’s all it takes to get your $200: Open a new Huntington 5 Checking account using the link below by November 24, 2015. Make at least $1,000 in deposits within 60 days of account opening. It’s really that simple. We’ll then deposit $200 into your new account within 14 days of meeting the requirements. Read more about waiving monthly fee from here. (hint: $5000 account balance for one). Also note: This offer is only available to online applicants residing in Ohio, Michigan, Indiana, Pennsylvania, Kentucky and West Virginia.

(Update 10-01-2015) More checking account opening bonus, this one from First Tennessee Bank, offers ends on Oct 31st, 2015. “To receive your bonus, you must open the checking account online and ensure the code ONLINE appears in the online application where “Offer/Promo code” is requested. You must have an opening deposit of at least $300, and at least one direct deposit must post to your account within 60 days of account opening…” (11-03-2015) I received their bonus shortly after meeting their requirement. That’s fast 🙂

Also useful links: Doctor of Credit List Of Methods Banks Count As Direct Deposits (not super scientific, but still useful if one plan to use Paypal instead of employer paycheck); My Money Blog Applying for Multiple Bank Accounts: Can You Apply For Too Many?

(Original 09-27-2015)
Fifth Third Bank
53 Bank offers $150 for opening Checking account with qualifying activities. Link here. Note this is direct link (not affiliated link, in other words I am not taking any commision from the bank. Same below). Qualifying activity includes three online bill payments, using Fifth Third Bank’s online bill payment service, and direct deposit. Don’t know when the offer will ends. Last time I got a $200 offer from them and enrolled at the last day (July 26, 2015). They were very quick to deposit the bonus money after I met their requirement.

Note: Fifth Third Bank will also donate $150 to “Stand Up to Cancer”. Keep in mind there are many cancer related charity ripoffs according to Anderson Cooper, it seems SU2C is legit.

BMO Harris
Back to topic. BMO Harris is doing $200 offer for new checking account with direct deposit. Link here. Offer (account opening) is valid between July 27, 2015 and January 22, 2016. (11-3-2015) Just opened an Everyday Checking account with them today.

PNC Bank
PNC is offering up to $400 for opening new checking account with qualifying direct deposit. Offer ends 12/31/2015. Link here. (11-3-2015) I received their bonus about 28 days after meeting their requirement.

Notes:
1) The bonus overall is not as general as some credit card offer (more than $500 opening bonus with qualifying spending). But keep in mind opening credit card usually means a hard pull on credit record, while opening checking account does not. One thing keep in mind is one has to be US citizen or permanent resident for opening checking accounts, due to the new laws and regulations in this new era.

2) Also the bonus from checking account will usually reported as interest income or ordinary income. It will be taxed when we file the tax next year, this is different from the credit card promotion, which usually billed as rebate or points (and there is no tax implication).

Categories
advice and tips finance Fun

A map (or a chart) is worth a thousand words

Reading Time: 2 minutesairlines miles award chart

Complete map of Starwood SPG hotels

award map (hotels points and map)

British airways avios map

Car rental primary insurance

PS (09-24-2015): booked Westin Lake Las Vegas via BA Avios points. It cost about 11,000 points for the premium room ($81 + taxes). The room there starts at 7,000 SPG points, note 7,000 points is for traditional room (I got a premier double room). I feel it’s a decent deal as SPG points are usually worth more.

Westin Lake Las Vegas

PS2 (09-25-2015): more hotels booking. Last night I also booked Hilton Anaheim both via BA Avois (about 18,000 points) and Chase Ultimate Rewards (about 10,500 points). The hotel was very close to Disneyland. And today I booked one more night Hilton Anaheim via Chase UR (now we have 3 nights total), it seems the UR points for the hotel increased overnight, but the dollar price stayed the same. The next step is to get the Disneyland (and California Adventure) tickets booked.

Hilton Anaheim

PS3 (09-26-2015)
Other nearby hotels, both cost HHonors 20,000 points : Double Tree Anaheim (this one does not have free breakfast, parking cost is similar to the Hilton above, about $16 per day).

Double Tree Anaheim

Another one: Hampton Inn Los Angeles-Orange County-Cypress. Hampton Inn has free parking and breakfast compared to Double Tree. It’s a bit farther away from Disneyland.

hampton inn los angeles orange county Cypress

Categories
advice and tips finance iOS

Discover Apple Pay 10% cash back until end of year

Reading Time: 2 minutesWith $10000 as spending limit. The prerequisite: iPhone 6, 6+, 6s, 6s+; iOS 9; in store purchase, no giftcard.

Stores support Apple Pay

Here in St. Louis, Schnucks, Dierbergs, WalGreens, St. Louis Bread Co. (Panera Bread) all supports Apple Pay. Though on Sept. 17 I tried at Schnucks counter, it failed, note this is the 2nd day of Discover Apple Pay launch, so it could be a glitch. It worked on Panera Bread (Sept 18, 19). I will also try Trader Joe’s as I saw it’s coming soon from the Apple website.

Why iOS 9 for Apple Pay
It’s a bit more security. Previously one can add a card to Apple Pay just from the physical card. So basically if a card is stolen, technically it can still be added. Obviously the card issuer usually has fraud detection system in place to catch those. But iOS add a two factor authentication when adding a new card, which is definitely a great idea. We catch the problem earlier this way. A thief cannot add a stolen card as easily as it used to be.

Btw, I saw the fingerprint based authentication get popular as BoA app and other apps (e.g., Apple’s own iTunes connect) use that for authentication. Save some typing work and more security.

(Update 09-20-15) It appears Discover Apple Pay still does not work on local Schnucks store. It prompts “do you want cash back”, I said “No”, then the transaction got declined. Something at a miss at Schnucks or their payment processor. Because it does work at Panera (St. Louis) Bread since Sept 18. I guess one way to test it is to swipe Discover Card directly to see if it works 🙂

(Update 09-25-2015) Used Apple Pay with Discover at Subway for lunch today, it worked flawlessly.

(Update 09-27-2015) Worked in Trader Joe’s too.

(Update 11-07-2015) Discover Apple Pay works in Schnucks now. 

Categories
advice and tips finance

Fuel Rewards Network, eBates

Reading Time: 2 minutesFuel Rewards Network offers about 1% for shopping online, e.g., I bought $36 worth of clothes from Load and Taylor via their shopping mall, it gave me 10 cent. The calculation goes like this: $36 * 3 / 1000 = $0.108 rounded down to $0.10 which is 10 cent per gallon gas discount. If I buy 10 gallon of gas, that’s $1.00 discount. $1 divide by $36 which comes out by 3%. Note typically shopping mall earning rate is 1 instead of 3, so in the example above, I will earn 3.6 cent per gallon gas discount, instead of 10 cent.

Another example, I shopped at gap via FRN, bought $50 apparel. It gave me 10 cent also (2x earning rate instead of 3x at L&T). This is lower than the gap rebate one can get from ebates right now (typically 2%, now at 8%). I mean 3% or 2% vs. 8%. So the bottom line is we can use this calculation to maximize the cash back (rebate).

Btw, FRN is free to join, and as a minimum it offers 3 cent discount for gas purchase, so in other words about 1% in addition to whatever the credit card offers (in my case, I use Sams Club mastercard or the Pentagon Reward visa, both offer 5% cash/points back).

Back to the topic, I think it’s worth to join FRN since we already spend money on shopping or dining, and those activities adds up to gas savings, in addition to the regular credit card cashback/points we get. Don’t spend to get the points though 🙂

(Update 09-20-15) Other two ways I got discount for gas purchase. I use both Sam’s Club MasterCard and PenFed Rewards visa card, both gives 5% cash (points) back, which is unlike some of those rotational 5% reward cards (e.g., Chase Freedom, Discover Cash Bonus). Sometimes it’s hard to keep track of those quarterly rotational promotion. This is also higher than 3% cashback from Amex Costco Card. PenFed also offers 3% for supermarket and grocery shopping. And Sam’s Club MasterCard offers 3% on restaurant purchase.

Categories
advice and tips Fun

Parenting

Reading Time: < 1 minuteFrom Facebook

Categories
advice and tips iOS

How to fix iPhone 5 5s 6 6 plus speaker after dropping it to water

Reading Time: < 1 minuteI made this mistake again. Last time I dropped my iPhone 4 into water, I tried this “put it in rice” strategy. This time I also this trick, but the speaker was not still working. Luckily I found this youtube video on the web, basically I used a cotton knob to clean up the headphone jack. It worked.

Categories
advice and tips Fun

It’s Friday again

Reading Time: < 1 minuteThis afternoon (actually more like evening), on linkedIn I was surprised to find that the company I used to work for has laid off its CIO (chief information officer). I remember we talked about I joined the company in late 2011. I left the company about 2 years ago, to pursue better opportunities. Also I knew the company was not doing well financially. It seems now it’s becoming more and more difficult for the company to survive. Note it’s more like industry wide problem, not isolated the company. Management could do something, but once a fatal mistake made by former CEO (buy another company at market top using borrowed money), there is very little current management can do.

Also, from indeed.com I found a former colleague of mine, we started on the same day on a small software (custom development) company 5 years ago, and he left the company a year later, and found he has driving trucks for a while after that stint.

Last but not least, I saw my neighbor when he came back from work, and just exchanged “hellos”, and he said it’s Friday 🙂

(11-12-2015) Tomorrow will be friday again. Today I happened to see the website I worked on and put quite a bit effort went live, here it is. It’s a mixed feeling for me, because I left the company and the team a few months ago, shortly after the direction of the project changed. It’s good to see the project finally pulled up and it even got 2 mobile apps, cool 🙂

Categories
advice and tips Fun kids

Went to kindergarten roundup at Yoyo’s new new school

Reading Time: < 1 minuteTo be precise, it’s Spoede Elementary, about 5 mins drive from my condo. When I bought the condo 10 years ago, I was single and had no kids. But I knew Ladue is a good school district. That’s one reason I bought condo here. If things does not work out, I can rent out the condo to someone else who will like this location. Back to school.

We met the school principal, the 4 kindergarten teachers, one counselor, and one idea lab teacher (outside classroom?), a lot of parents from diverse background. The teachers gave a lot tips about transition kids to kindergarten, and I like what the principal said at last: we will treat your kids like our own. That is indeed what I felt at some of the school Yoyo already attended. And this is largely true in the post Newtown world. I recall some of the teachers lost lives trying to save the kids. Maybe a bit harsh but I think we need to think about gun violence and do something about it.

Back to school, we are really excited to see Serenity growing up, and we also like the ROCKS principle (Respect, Ownership, Cooperation, Kindness and Safety) of the school.

Categories
advice and tips Fun

Timerland hiking shoes

Reading Time: 2 minutesTimberland Ledge Low Leather Hyper Mesh Gore-Tex®. My first pair of Timberland shoes. Bought it from timberland.com for about $65 to $70 on Sept 2011. It did not disappoint. The water proof feature works as claimed. I worn it for over 3 years, for mostly daily and some hiking. I would definitely buy it again.

Timberland Ledge Low Leather Hyper Mesh Gore-Tex®

Timberland Ossipee Mid Hiker Gore-Tex®. My second pair. I just started wearing it. I bought it in Jan 2012 at timberland.com for about $40. I lent it to my in-law for couple months. As my 1st pair timberland started worn out. I started this one. One thing is it’s a mid hiker or in other words, it’s a bit taller. I anticipate it may not ventilate as well as the 1st pair in St. Louis summer. But I plan to wear this one out before purchase a new pair.

Timberland Ossipee Mid Hiker with Gore-Tex®

Another thing I noticed is the price of hiking shoes went up quite a bit, and the quality seems declining. From some of the reviews I read from Rei.com about Northface and Merrell.

Btw, came across this top 10 hiking shoes list from outdoorgearlab. Amazon has a good list too.