From the category archives:

Productivity

For months I was annoyed at the inability of my WordPress installation to automatically upgrade both plugins as well as the core installation. Every time I had to do a core upgrade of WordPress, I would manually download the zip file, unpack, copy the wp-contents and wp-config files and then take care of any outdated plugins. I tried many, many times to open the FTP ports on my instance and do the upgrades, but time after time I got the same annoying connectivity error.

I decided today to end all that, as I am getting ready to get back to blogging (after a couple of months hiatus, related to a project I’ll share with you later) and wanted to start with the new WordPress 3.0.

First of all, I needed to figure out how to open the FTP server of my instance, since I don’t have it open all the time. I highly recommend to everyone to keep FTP closed, and only open as needed (minutes is better) as FTP can be easily be exploited by hackers.

FTP works with multiple ports. On one hand you have the standard ports, which are port 20 and 21, and on the other a “passive” control port that is randomly picked per session.

I recommend that you use vsftpd, which is standard on most Linux installations. You can start and stop vsftpd using the command: sudo /sbin/service vstfpd start (or stop).

First, you will need to edit your vsftpd config file by editing /etc/vsftpd/vsftpd.conf. At the end of the file, insert the following snippet:

# Passive support
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES

pasv_min_port=51000
pasv_max_port=51999
pasv_address=201.201.144.144
pasv_addr_resolve=YES
cmds_allowed=USER, PASS, QUIT, PASV, RETR, SYST, PWD, NOOP, CWD, STOR, LIST, DELE, MKD

The pasv_min_port and pasv_max_port can be any range you pick, as long as they are available on your instance. Then, on the pasv_address put your instance’s Elastic IP address or publicly visible IP.

Next go to the AWS Management Console, and under Networking & Security select the Security Groups option and make sure to add two entries on the list of ports: one for TCP ports 20 to 21 and another for TCP ports 51000 to 51999. See the graphic below:

Now, make sure you start vsftpd (using sudo /sbin/service vstfpd start) and check from an outside computer that you can log in to your machine. You need to make sure that you have a user that will be chmoded to your root wordpress installation (using the command useradd, as described here).

One last thing on the FTP side is that the apache user has access to your whole installation (as the upgrade process will be driven by the WordPress program which runs as apache). You can do that by issuing sudo chown -R apache:apache blog/.

If you try doing the upgrade now, you could still receive this cryptic error message: “Unable to locate WordPress root directory”. I found the fix, via this blog, where you basically add the following snippet at the end of your wp-config.php file:

if(is_admin()){
add_filter('filesystem_method', create_function('$a', 'return "direct";'));
define('FS_CHMOD_DIR', 0751 );
}

Try now — if the WordPress Gods are smiling at you, you should be able to upgrade via FTP. A reconfiguration of the WordPress may be necessary, so make sure to do a backup of your blog DB. But I’ve got to say, once I saw WordPress’s 3.0 Dashboard only after a few seconds, I was glad I spent the time to finally get this to work. I also upgraded a couple of plugins without any problems.

After you’re done, remember to shut down vsftpd — don’t let it running on your instance to avoid possible hacking, by doing sudo /sbin/service/vsftpd stop

Let me know if this worked for you. I’m looking forward to a whole lot of blogging in the following months!

{ 5 comments }

Feeling Secure with the Latest WordPress Version? Think Again (and 7 Tips to Secure it)

September 21, 2009
Thumbnail image for Feeling Secure with the Latest WordPress Version? Think Again (and 7 Tips to Secure it)

Late on Friday, I read a post from Allen Stern in FriendFeed saying that his blog, CenterNetworks had been, once again, injected with spam links. Allen runs his blog on the latest Wordpress installation, 2.8.4, which we all figured was really secure.

I had upgraded barely a week ago, so I instantly checked my blog and lo and behold, I had been hacked as well.

There is something inherently wrong with Wordpress’ code if it’s this easy to hack it, even with the tightest security measures, which in my case, include the top 5 of the 7 items listed below. I felt completely let down by Wordpress and for a moment thought that it’s time for me to move on to something else for my blog.

I’m giving Wordpress a last chance, and have enforced the following security measures to see how it goes, and I highly recommend you enable these as well if you are running Wordpress.

Read the full article →

Estimating Time to Launch a Startup Using The 1,000 Hour Rule

September 16, 2009
Thumbnail image for Estimating Time to Launch a Startup Using The 1,000 Hour Rule

There is this moment in all things creative where you stop and say “What am I doing?”. It doesn’t matter if you’re writing a novel, painting on canvas or coding a website (and some would say starting a relationship).

You start with a fiery passion, the eureka moment where everything looks illuminated, and your legs tremble just thinking that someone else could be doing what you’ve imagined.

You start getting things done, revel at the first sparks of creativity you see unfold before your eyes. You immediately have the urge to share this excitement with your closest friends and family. You work on it some more, and finally release it to more users, only to find that they don’t understand or get your creation.

What’s next? More work.

The business thinker Malcolm Gladwell has reported that to become a real expert at something, you need to practice it for at least 10,000 hours. That’s eight hours a day for almost three and a half years.

I was thinking about this rule and how it kind of makes sense (even though some critics question Gladwell’s rules) and how it could be applicable for a startup.

I’ve been involved in many startups during my career, both personal and work projects, and going back on the times it took to get stuff from concept to release versions, I can safely state the following rule:

To get any startup project in a launch-ready state, it must have been developed for at least 1,000 hours

Read the full article →

Trust the Cloud? Then Don’t Put Your Life On It!

August 10, 2009
Thumbnail image for Trust the Cloud? Then Don’t Put Your Life On It!

Do you have precious content on Google Docs or Flickr or some other cloud service?

Back it up locally. Now!

There’s a flurry of activity regarding the death of tr.im, a popular URL shortener service that wasn’t able to enter into a path of self sustainability.

The losers, as usual, are its users.

The fact is we’ve become too used to having reliable, free web applications. The truth is that these companies are, in most cases, launched first to see if they grab an audience, and then try to make a business model to continue sustaining their operations. Louis Gray has a great post about the cycles that these companies go through.

Please, learn this golden rule: if you are not paying for it, it might be gone tomorrow.

Read the full article →

If You’re a FriendFeed Addict, You Must Use Feedly

July 6, 2009
Thumbnail image for If You’re a FriendFeed Addict, You Must Use Feedly

Just when I thought I was closer to giving up on Firefox, a new application, in the form of a plugin, has become a major addiction for me (and a saviour for the spiraling browser). I’m talking, of course, about Feedly.

Feedly was brought to my attention (as many other applications have) by the omnipresent Robert Scoble. He posted on FriendFeed:

I love http://www.feedly.com — it is how I read my Google Reader feeds now. Requires Firefox, but if you have it very nice headline display

I thought, Firefox plugin? No thanks. But something about the UI bit my curiosity and I decided to install it.

The truth is, it’s much more than an RSS reader. It’s an extension to FriendFeed, to a point where I’m wondering why FriendFeed hasn’t purchased them yet.

Read the full article →

Don’t Wait Any Longer: End Procrastination Now!

October 27, 2008
Thumbnail image for Don’t Wait Any Longer: End Procrastination Now!

We’ve all been there. You come in to the office early. You scan the huge list of pending items to complete today. There’s no way you’ll be able to deliver them all on time. You say to yourself “Let me read some blogs or see what people are doing in Facebook. I’m sure I’ll get some ideas or relax to take on the monster pile.” Your co-worker taps you on the shoulder. “Wanna do lunch?”

Where did your morning go?

Read the full article →