cloud

Ted vs The Cloud

Amazon's 'cloud' service, which is relied on by many serious organizations as the answer to down-time, was just down for as many as 24 hours. Not sure if this is true, but, according to TIME, some of the data Amazon hosts for its clients is lost forever. The largest Drupal hosting company, Acquia, which hosts over 40,000 Drupal websites, had to issue an embarrassing public apology to all their clients.

Now, I own a small software shop that hosts about 60 Drupal websites. Over and over again, people have told me that I should move my hosting to 'the cloud' or one day I would lose all of my clients when my server goes down. And if my server were down for 24 hours, and I lost some of my client's data, I would expect many of them to leave. Hell, I would leave. But, two years into hosting Drupal sites, my company's hosting has never been down for more than a couple minutes and 'the cloud' is proving to be much less reliable than traditional dedicated servers.

Maybe the owners of 'the cloud' you use will do a better job than you at backing up data and ensuring uptime. Or, maybe not. They certainly aren't making any promises:

We are not responsible for any data loss or data corruption [...]

People talk about the cloud like it is magical. The cloud is just a computer that you don't control. That should send chills down your spine if you are in charge of technology for an organization working for social justice and you rely on the cloud.

In short, so far: Ted 1, Cloud 0.

Configuring a new Debian Rackspace Cloud Server for Drupal

I had to set up a new Rackspace Cloud Debian Linux server today for a rather large Drupal project. Since this is the second Rackspace server I have set up for Drupal in the past couple months, I thought it might be handy to take notes on every command I ran so that this is easier next time, or for someone else.

The first step is to set up your server instance, which is done through their web interface. It is as easy as clicking a button to add a server instance , select the OS type (Debian, of course), and choose the amount of Ram and a name.

Once the server instance is set up, you can log in via SSH. I recommend using a terminal as their web command line is clunky. Everything following this sentence are commands I ran through the command line via ssh.

Adding a non-root user with root privileges (sudo)

  • useradd username
  • passwd username secretPassword
  • mkdir /home/username
  • chown username /home/username
  • vim /etc/sudoers

Add the line: username ALL=(ALL) ALL

The majority of the work I did from this point was guided by these phenominal instructions. Feel free to follow along there, as they much more detailed, but the instructions below are Rackspace specific and a little more current.

Installing the webserver software to run Drupal (Apache2, PHP5)

  • sudo apt-get update
  • sudo apt-get install apache2 php5 libapache2-mod-php5

Test the install of Apache in a browser: http://ipaddress. If everything worked out, you will see a white screen saying It Works.

Once Apache is working you can test PHP. First setp is to create a php file:

  • vim /var/www/test.php

Enter the following text: <?php phpinfo(); ?> and save the file.

Next, open your web browser and navigate to: http://ipaddress/test.php. For some reason, my browser asked me to save the php file instead of executing it. I wasn't sure why this was so I tried restarting apache:

  • sudo /etc/init.d/apache2 restart

and refreshed my browser. It worked.

Installing the database software to run Drupal (MySQL5)

  • sudo apt-get install mysql-server mysql-client php5-mysql

I was prompted for a password through a fancy schmancy command line GUI, so I assigned one and copied it some place safe.

Installing PhpMyAdmin to manage MySQL

This step is entirely optional, as the MySQL client is already installed.

  • sudo apt-get install phpmyadmin

During the install, I was given a chance to specify that the setup should use apache2. Last time I did this I had to edit a config file and restart apahce. PhpMyAdmin should now be available at:

http://ipaddress/phpmyadmin

Congratulations; your server should now be set up to host a single Drupal install at /var/www/.

...

Unless your SQL dump is too large, and mine was. I edited the php.ini file (at /etc/php5/apache2/php.in), by modifying the memory_limit, upload_max_filesize, and post_max_size variables. Don't forget to restart the server: /etc/init.d/apache2 restart.

...

I keep thinking this post is done, but I wasn't able to import my sql dump through PhpMyAdmin at all. Just too big, I s'pose. So I scp'd the file over and ran this command:

mysql databasename -u username --password=secretPass < sql_dump.sql

Powered by Drupal, an open source content management system