Posts by author:

Jorge Escobar

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!

{ 5 comments }

The Void Left by FriendFeed

April 3, 2010
Thumbnail image for The Void Left by FriendFeed

There is a natural cycle in Social Media applications, where there’s an initial excitement (the romantic phase), a leveling of activity (the wedding phase) and hopefully the “till death do us part” phase, where the application becomes part of our lives. But most often than not, there’s a divorce phase. The application just doesn’t measure [...]

Read the full article →

Five Tips to Thrive on Google Buzz

February 11, 2010

With Google Buzz, users have found their inboxes converted instantaneously into a social hub. Google’s bold move has turned the web into a whirlwind of blog posts appraising or criticizing the service. I will leave that part out of this post, as I feel it’s not really fair to evaluate a service that has two [...]

Read the full article →

Google’s Whitespace Bid is Where Nexus is Going

January 6, 2010

Yesterday I saw the realtime video feed (thanks to @scobleizer) of the unveiling of Google’s new phone, the Nexus One. The phone looks great, with some really cool features and confirming that Google is really lining all its guns towards the mobile space. But the announcement wasn’t revolutionary in any level. It’s a great new [...]

Read the full article →

FriendFeed’s Lifecycle: A Story of the Modern Startup

December 9, 2009

Today I noticed Compete.com had come out with November stats. My blog had a spectacular month (and if you read it, you know why), but my intentions were other: to see how FriendFeed fared in a key month after its Facebook announcement has died down.

The graph doesn’t look good for FriendFeed, which has lost an additional 20% of its audience.

The question we, as FriendFeed fanatics ask ourselves is why? Why is a product that is so unique been left for dead all of a sudden.

Read the full article →

Why I Hate Traffic Spikes

November 30, 2009

There is a rush when you see a post that gets a lot of attention. I remember Hutch Carpenter experiencing something similar when he had his “Cisco Fatty” post.

But after the moment passes and you look back, there’s a bunch of negative things that slowly emerge from the experience. I will share with you some of the ones I have thought of.

Read the full article →

Chrome OS: Is It Really An Operating System?

November 19, 2009

As I read report after report on Google’s Chrome OS, I have to say I feel a little let down. But most importantly, I’m a little hesitant to call it a real Operating System.

According to the official post:

[Google Chrome OS is] an open source operating system for people who spend most of their time on the web.

Don’t we all spend most of our time nowadays on the web? What is not to love?

The problem is the rest of the time when we are not on the web.

Read the full article →

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 →

Web Platforms, Not Web Portals

November 17, 2009

In talking to different startups in the past weeks, it’s very clear to me that businesses haven’t grasped yet how the Internet has shifted from the destination paradigm to the platform paradigm.

In a post titled “The Web in Danger”, Anil Dash compiles and adds to the thoughts of Tim O’Reilly, Doc Searls and Chris Messina about how the web is in danger of losing its essence: the destination URL.

So far people have thought of websites by the URLs they enter on their browsers to consume its services. But today, they are thinking of businesses as omnipresent services. They want to be able to do everything they normally do on the URL, using their iPhone or on Facebook or on their Chrome OS powered netbook.

They want to fire up your application using an icon; not enter an address on a URL window.

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 →