From the category archives:

Cloud Computing

FTP Upgrading of WordPress on AWS Instances

by Jorge Escobar on July 4, 2010

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!

{ 4 comments }

Microsoft Azure is The New Outlook

November 17, 2009

I just received an email invitation to try out a new application. I get a lot of those these days, but this one was different.

It was from Microsoft.

It picked my interest. A Web Platform Installer? Microsoft doing PHP?

I went to the URL provided and I was blown away with the concept behind this application. Basically Windows has introduced point-and-click cloud computing for the masses and it’s doing it in a way that resembles the iPhone application directory but for web applications.

I hate to say it but it’s brilliant.

Read the full article →

AWS Import Tip: Don’t Do It On Windows

November 16, 2009

I just spent the last ten days trying to do an import on Amazon S3 using their Import/Export service. Basically Import/Export allows you to send a drive to Amazon via snail mail and they will hook the drive to their system and import the data locally. It’s much faster than trying to upload the first [...]

Read the full article →

It Sucks to be T-Mobile in the Sidekick Fiasco

October 12, 2009
Thumbnail image for It Sucks to be T-Mobile in the Sidekick Fiasco

The worst situation any provider can face is a huge data loss that happens completely outside of its circle of influence. T-Mobile relied on Microsoft to keep the data integrity of its popular Sidekick cell phone. But when a major outage affected most of its users, it wasn’t Microsoft that had to deal with the [...]

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 →

Five Truths (or Lies) of Hosting in the Cloud

May 21, 2009
Thumbnail image for Five Truths (or Lies) of Hosting in the Cloud

Dave Winer put up a great guide on how to start a server in Amazon’s cloud a few weeks back. The article takes the user’s hand and step by step you go on to create your first server on the cloud. It’s a great accomplishment (I still remember the first time I did it) and you feel like you have become a member of an exclusive club.

However, once you see that “Hello world!” screen in there, many people ask, as Daniel Pritchett does in Winer’s post: “what do I put on my new cloud server?”

Read the full article →

Apple Has To (and Will) Have a Netbook

May 8, 2009
Thumbnail image for Apple Has To (and Will) Have a Netbook

On my Christmas vacation I carried a new friend with me that everyone was nuts about. What was it? What’s the brand? How much did it cost?

I had just bought a brand new MSI Wind on Amazon.com for a little less than $400 bucks.

Eight months later I can tell you that this machine has increased my work output by at least 10x. I carry it everywhere, I’m now writing a novel, two blogs and coding my next app while riding on the subway, I take it to the conference room and show power point presentations under my co-worker’s jealous glances, I surf the web while watching TV and my wife almost doesn’t mind it. Without knowing it, I had been waiting for a long time for something like this, and so were thousands of people.

The only thing, of course, is that it’s not an Apple — and I’m an Apple fan. I have an iPhone, an iMac and an iBook, and would have loved this next purchase to be an iTablet.

Read the full article →

Building A Social Application on the Cloud Part 1: Why build it on the cloud?

April 10, 2009
Thumbnail image for Building A Social Application on the Cloud Part 1: Why build it on the cloud?

I’ve always been a David Letterman fan and one of the most famous sections of the show is the Top Ten List. Basically they pick a theme from current news and make a funny list around it, sorting the ones that are the most funny on the top.

I thought that this would be a great social tool to build: a crowdsourcing tool for Top Ten lists. But having people create ten items sounded like too much, so I decided to pair it down to five.

Thus I had my application: The Top5.

Read the full article →

Building A Social Application on the Cloud

April 10, 2009
Thumbnail image for Building A Social Application on the Cloud

As I do more and more research about the Cloud Area Network, I’ve also found that people (technical and non-technical) still don’t get a clear grasp of how and why we should build applications that run on the cloud.

I thought the best way to explain the concept was by building a simple application that would use infrastructure as well as logic that would demonstrate the approach and the benefits of a cloud app.

Read the full article →

Moving My Blog to the Cloud

March 9, 2009
Thumbnail image for Moving My Blog to the Cloud

A week ago I decided to put my blog where my mouth is. I am writing a book on cloud computing and services, and needed some hands-on experience on the latest technology available. I had tried Amazon Web Services aabout a year ago and wasn’t impressed with their offering; the tools were Java-based and somewhat cumbersome. I was in for a surprise. The main reason: Amazon’s Graphical Management Console.

Amazon now allows users to manage servers using a graphical control panel that allows you to do most tasks using a point and click interface (for a sneak preview of what it does, see this video by Mike Culver, one of Amazon’s Web Services Evangelists).

In this post I will try to explain some of the concepts that you must have in mind if you’re thinking of moving some of your servers to the cloud.

Read the full article →