How to Install Drupal 7 on a 1&1 Host

After reading about Drupal in the April Issue of Linux Journal I decided it might be a good idea to try and learn it. While I could (and have) installed it on a server in my house, I thought it might be more motivating to install drupal on my host and use it to build a site that I have been contemplating for a while.

A quick search for installing Drupal 7 on 1and1 returned this guide, following the instructions there worked perfectly.

To summarize:

  1. Download and extract the most recent version of Drupal here
  2. In the sites/ directory copy the default/ directory and name if after your site.

    cp -R drupal-7.0/sites/default/ drupal-7.0/sites/your_sites_name

  3. In the /sites/your_sites_name/ directory re-name default.settings.php settings.php

    mv drupal-7.0/sites/your_sites_name/default.settings.php drupal-7.0/sites/your_sites_name/settings.php

  4. Add the following line to the top of your .htaccess file (located in the drupal-7.0/ directory).

    AddType x-mapp-php5 .php

  5. Transfer the drupal-7.0 directory via ftp to your 1and1 host. I used filezilla.
  6. Log in to your 1and1 control panel and:
    1. point your domain to your drupal directory
    2. create a new mysql database for your site
  7. In a browser navigate to your website and follow the drupal installation guide. When prompted enter the details for your mysql server. Select the advanced settings and enter the url for your database.

When finished you should be at your dashboard and ready to begin creating your site. I am using the 1and1 Business Linux hosting package but any package that supports php5 and mysql5 should work.

Now its time to learn how to use drupal to actually create the site…

Repack .mkv files to .mp4

Recently, I encountered a strange problem with an .mkv file. It would play on my laptop (albeit very choppily as my laptop only has the intel dedicated video card and most certainly isn’t high def) but when I transferred it to my external HDD and tried to play it on my set-top media player (an ASUS O!Play Air) the picture was black and the sound would play. Hitting the display button there was no information for the video input and the audio was listed as DTS (as expected).

After deleting the file on the external HDD, re-extracting and transferring it back to the external HDD with the same results I looked into repacking the .mkv to see if that would make any difference. Some quick Google searching resulted in me finding this tutorial. I followed the instructions pretty much as written but will write them here along with the modifications I needed to make as well.

First step was to install mkvextract, mkvinfo, MP4Box, hexedit and mplayer:

sudo apt-get install mkvtoolnix gpac hexedit mplayer

Download neroAacEnc from here. Unpack the Linux files (the tutorial states a directory in your $PATH, I found it easier to unpack them to the same directory that has your .mkv file).

Determine which track is the video and audio tracks:

mkvinfo file_name.mkv

Make note of which tracks are the video and audio tracks as well as the framerate on the video track. Next you need to ‘demux’ the .mkv file:

mkvextract tracks file_name.mkv 1:video.h264 2:audio.ac3

This took a few minutes on my laptop. After this the tutorial stated to hexedit the video.h264 file which was just created and change a section of the first line from: “67 64 00 33″ to “67 64 00 29″. I have no idea what this was actually to do but in my case the first line already contained the “67 64 00 29″.

The next step was to convert the audio to aac format:

mkfifo audiodump.wav
./neroAacEnc -ignorelength -q 0.20 -if audiodump.wav -of audio.m4a & mplayer audio.ac3 -vc null -vo null -ao pcm:fast

This took several minutes. The last step was to ‘mux’ the audio and video files into a new container. The first time I did this and transferred the resultant .mp4 file to my external HDD and played it it on the set top box we had video, but the audio was badly out of sync. Reading further in the tutorial thread revealed a solution; MP4Box uses a default framerate of 25, the video file had a frame rate of 24. Muxing the audio and video files with the following command:

MP4Box -add video.h264 -add audio.m4a -fps framerate output_file.mp4

/usr/lib/libgconf2-4/gconf-sanity-check-2 exit with status code256

Recently we had to reboot one of our servers at work. After the splash screen, we were met with the following error:

/usr/lib/libgconf2-4/gconf-sanity-check-2 exited with error status 256

and at the login screen an error along the lines of:

Error in Gnome Power Manager configuration file

and then the login would fail. Rebooting the system we were able to boot into recovery mode. We had tried the following fixes to no effect:

  • Changing the permissions on the /etc/gconf/gconf.* files:sudo chmod 755 /etc/gconf/gconf.*
  • Reconfigured gnome (I can’t remember the command line I used)

As a work around we installed kde and set it is the default desktop for managing the x server. To install kde from the command line:

sudo apt-get install kde-base – this installed enough to get the system to boot to the command line normally. In order to get to an actual desktop we had to install most of the packages listed here using apt-get install package-name. Happily the server now boots completely to the desktop. One alternative which may work for installing just the kde desktop without the other packages may be:

sudo apt-get install kde-desktop

Further digging suggests that it may be a problem with the permissions in the /tmp directory and that it could be fixed by sudo chmod 1777 /tmp. We will try it out at work and see how it works (this may have the added bonus of fixing an error with cron jobs run as root not being able to send mail due to being unable to dot lock certain files…).

Update:

We have changed the permissions on the /tmp directory and it has fixed the issues with root not being able to dot lock certain mail files when running the cron jobs. We haven’t tried booting back into Gnome to see if has fixed the issue with the configuration file or not. We’ll have to try that tomorrow and keep you posted.

Basic Internet Security

I work in the abuse department of an ISP and we spend a great deal of time dealing with the results of malware infections. During conversations I was surprised how many people were not taking basic steps to protect themselves while online. I’ve put together a few basic suggestions to help protect yourself from getting infected.

  • Keep your system up to date, focusing on three main areas:
    1. Operating System – updates are released by all OS vendors periodically to patch known issues, including vulnerabilities that can be exploited to compromise your system. These updates should be downloaded and installed as soon as they are available. Windows can be set to automatically install updates if you don’t want the hassle of having to remember to install them.
    2. Anti-virus – malware is constantly adapting, with new exploits and variants constantly being discovered. Anti-virus vendors are constantly releasing updates which need to be installed in order to provide the maximum protection, which include the latest definitions (hash tags of known viruses/malware) as well as improvements to their behavioural analysis software (which in current times is arguably the most important component of your anti-virus). Typically, your anti-virus program will be set to automatically update by default.
    3. Third party programs, including web browsers, Java and Flash – A recent study identified that the majority of security vulnerabilities in Windows now actually derive from third party programs and not from the operating system itself. Software providers will release updates to repair known issues, including security vulnerabilities. It is important that these programs be updated when a new version or update is released, however, you should be leery of clicking on any pop up windows asking you to update as this is a method that has been used in the past as an exploit. If you receive a pop-up about an update for a program, check the vendor website and download the update from there.
  • Use a router, even if you only have a single computer connected to the Internet. Routers function as a firewall will drop a lot of incoming traffic before it even reaches your computer. It is important to properly secure your router. I would advise changing the default password (see the section on password strength below) to the router configuration and if you using a wireless router secure the connection with a strong password/passphrase and wpa2 encryption.
  • Use strong passwords. The current recommendation is that your password be at least 7 characters and contain at minimum one uppercase letter, a number and a symbol. I would recommend between 9-11 characters and to use different passwords for different sites. There are a number of free programs or add-ons that can be used to remember passwords for the various sites including Last Pass which will work with all major web browsers and should automatically enter the password for you. Another alternative is a program like KeePass which rather than store your passwords on a remote secure database stores them in a secure database locally
  • Browse safely and use caution. Malware can often be downloaded by what are called drive-by downloads, downloads either authorised by the user without them being aware of the consequences (often by mimicking a legitimate download, like a codec installation or software update) or without the user being aware of the download. This content can be delivered in a number of ways including visiting compromised websites, clicking e-mail links, or on pop-ups. Be wary of any e-mails containing links or downloadable content relating to current topics or events, even if sent from friends. Additionally browser add-ons like No Script will prevent unauthorised scripts from running on any sites that you visit and can even build up a list of trusted sites. However, there is a trade off for this security, in that some pages will not work properly unless scripting is enabled.
  • Its cliché but remember that forewarned is forearmed. Making yourself aware of what malware is, what is out there and how your system can compromised/infected goes a long way to improving your safety and security.

Following these guidelines doesn’t guarantee that your system will not become infected, new exploits are being uncovered all the time but they will go a long way to mitigating the common threats. Currently malware is designed to target the most vulnerable systems and users. As always comments and suggestions are welcome.

Upgrading to WordPress 3.0.1

I’m not always as good about upgrading the blog to the most recent version of WordPress as I should be (probably due to the fact that I don’t post nearly as often as I would like to). A few weeks ago I attempted to do the automatic update and things seem to stop at downloading or unpacking the latest wordpress.zip file. So I tried a manual update by downloading the latest .zip file, extracting it locally and copying the new files over to my host via ftp, which broke the blog. Having at least had the foresight to create a back up of the blog locally I quickly loaded that back up to the host and forgot about matters for the time being.

I decided to try and upgrade the blog again this week and once again manually transferred the files for 3.0.1 via FTP. This time the content of the blog loaded properly but whenever I tried to login to the control panel I got a 500 internal server error message. I restored and then tried the upgrade and the extended upgrade instructions with the same result. A quick search of the WordPress forums didn’t yield a fix so I tried a fix of my own which I can I happily say worked. Here’s what I ended up doing:

  1. Deleted WordPress from my webhost
  2. Transferred WordPress 3.0.1 to the correct folder on my webhost.
  3. Went to the wp-admin page of my blog

At this point I was informed that there was no wp-config.php file created and was prompted to create one. I entered the information for my database (server, username and password). Once the config file was finished I was informed that the database needed to be updated. After updating the database I was able to both view the previous content of the blog and log in to my control panel. All that was left was to re-add my themes and plug-ins. Rather then tempt fate and transfer the contents of my wp-content folder to the blog I elected to just install the latest versions of my plugins and find a new theme.

Repairing/Restoring Grub Boot Loader

One of the many projects I have on the go at home is creating a digital back-up of all of our DVDs, to save some space in the condo and so we can watch them on our set top media player (the ASUS O!Play Air). Since I upgraded to Ubuntu 10.04 (Karmic Koala) I have been having some problems ripping DVDs using either thoggen or DVD::rip. The DVD menus aren’t reading properly, thoggen is unable to read the source and DVD::rip is giving an error message about ripping stopping about 80% of the way through the rip. I tried dual-booting my machine using 9.10 to see if downgrading to an earlier version of Ubuntu would solve the problem (which it didn’t).

After removing the partition on which 9.10 was installed I got an error from GRUB while rebooting (it just went to grub>). I managed to fix it be rebooting using a live CD (Ubuntu 10.04 in this case) and following the tutorial listed here.

Briefly, here’s the commands I entered (I only 2 partitions after removing 9.10, my main partition and the swap, so GRUB was located on /sda/dev1)

sudo mkdir /mnt/system
sudo mount /sda/dev1 /mnt/system
sudo -i
mount -o bind /mnt/system/dev
chroot /mnt/system
grub-install /sda/dev

Rooting Rogers HTC Magic Post 911 Update

I rooted my HTC Dream several months ago but I have been using my HTC Magic since Rogers offered the free upgrade in January. I finally got tired of waiting for Rogers and HTC to update the Magic to Android 2.1 from 1.5 and decided to try 2.1 on my Dream (Cyanogenmod 5.0.7). While I liked 2.1, the Dream was a little sluggish (no doubt due to the hardware). Convinced that I didn’t want to wait for Rogers to upgrade my Magic I went about trying to root it.

To root my Magic I followed this guide by GreatBigDog (h/t to I Want My 1.6 for the link to the guide) I have also followed GreatBigDogs guide to overclock the Magic. Although there were a couple of hiccups I am happy to report that my Magic has been successfully rooted and is running cyanogenmod 5.0.7 with the Dream 911 radio.

Many thanks to GreatBigDog for his guides and to the crew at cyanogenmod for all their hard work.

Converting .avi to .mp4 for play on iPod/iPhone using FFMPEG

Recently, I wanted to convert some of my video files to play on my wife’s iPhone. After some quick google searching I found a shell command using ffmpeg that looked like it would get the job done. As stated in the article entering the command quickly told me that there were a number of codecs that were missing and needed to be installed. Unfortunately getting the command to work wasn’t quite as simple as just installing the missing codecs. I ended up having to install ffmpeg from source in order to get things to work. Here’s the steps I needed to take. These worked for my Kubuntu distro, not sure how they would work with other distros.

Download the right codecs:

sudo apt-get install libfaac-dev libfaad-dev

Download ffmpeg from source:

sudo apt-get source ffmpeg

Switch to the directory containing the ffmpeg source code

cd ffmpeg-*

Compile from source:

sudo ./configure –enable nonfree –enable libfaac
sudo make install

Convert the file:

ffmpeg -i input.avi -acodec libfaac -ab 128kb -vcodec mpeg4 -mbd 2 -flags +4mv -trellis 2 -cmp 2 -subcmp 2 -s 320×240 output.mp4

To get the converted files onto the iPhone I just had to transfer them to my wife’s Windows machine, import the files into iTunes and sync.

h/t Tech Exposures

Rooting My HTC Dream (Rogers)

Rooting my HTC Dream from Rogers was something that I have been thinking about since I first got the phone at the start of September. After a lot of Google searches and digging through forums I was able to find some guides and decided just to give it a shot. It took me the course of the evening but I was able to root my phone and installed Cyanogenmod 4.2.3, an optimized version of Android 1.6. I’ve been using the rooted phone for a couple of weeks now and it was definitely worth the effort. In addition to Cyanogenmod just looking better then the stock OS on the Rogers Dream, the phone is much more responsive and I’ve been getting better reception and greatly improved battery life to boot (over 36 hours between charges, obviously I’m not the heaviest mobile phone user ever but its a marked improvement over the 18-24 hours I was getting between charges. Strangely, before I rooted my handset and installed the new OS my phone would recognize 3G networks but as soon as I began using data it would switch over to HSPA. I’m happy to report now that my phone both recognizes and seems to use the 3G network, although my speedtest app doesn’t show any difference in data transfer speeds.

A big thanks to all the folks at XDA and to Cyanogen for all their hard work.

Here is the guide that I followed. The only difference is that entered fastboot mode by rebooting the phone and holding down the power and camera buttons instead of the power and dial buttons as suggested in the guide and I didn’t have to input my access point names. I also partitioned my SD card, creating a 512Mb ext partition and a swap partition of ~266Mb (I can’t remember the exact size) as per the Cyanogenmod wiki. Lastly, I highly recommend installing the audio resources available here by extracting the contents of the .zip file to your SD card. Unless of course you like the only tone available for an alarm is that ultra annoying buzzer from clock radios :D

Fall Cleaning For the Household Computers

There’s been a bit of a fall cleaning here far as the household computers go. Mostly I’ve been trying to fix all of those niggling little problems here.

  1. We’ve been having some problems with our wireless network here. We were running co-ax through a splitter to the modem near the computer but found that the connectivity was intermittent. Bypassing that splitter and using a long cat5e cable seemed to fix that problem for a while at least. It looked like the old router was dropping its IP or just dropping computers from the wireless networks. We just picked up a D-Link DIR-655 Wireless Router as a replacement. So far, so good; the wireless connection seems more stable and to have better coverage in the house (not that our tiny 800 square feet is hard to cover mind you). An added bonus was that D-Link seems to have changed the router menus since I configured the old one. I was able to figure out how to enable the MAC address filtering, although its location in the router menus wasn’t the most intuitive (Network Filters under the Advanced Tab wouldn’t have been the first place I looked) but at least it was there and findable after a few minutes poking around. Another nice configuration option is the ability of the router to reserve an IP address for a specific MAC address which means that each device on my home network can have a static IP address without having to worry about setting up the subnet mask or DNS servers (not that this is difficult mind you, but still a nice feature)
  2. The next task was finally getting around to updating to WordPress 2.8.4. Of course that upgrade ended up breaking my WP to twitter plugin . It was a relatively simple matter to find an alternative plugin (RF-Twitterpost) and install it. I haven’t had a chance to test it yet but as soon as this update is posted I will know if its working :)
  3. The most frustrating task on the list was trying to fix a bug that had developed on my Windows XP box. Whenever I tried to open the properties of my network connections the windows explorer would crash. Google searches for solutions to the problem were not much help. The only proposed solution was to close the explorer process in the task manager and restart windows. Unfortunately this didn’t work. I ran both a check desk and system file check and a repair install of windows, none of which helped. Last resort was to do a complete re-install of the Windows OS which I am happy to report has worked.

Next up – restoring the GRUB Boot Loader on my dual boot machine since Windows doesn’t play well with others and the reinstall overwrote it. Thankfully this will be relatively straight forward with a bootable CD or flash drive with a linux .iso on it. In the not to distant future I am hoping to pick up a USB hub to connect to the USB port on the router and connect our printer and external hard drive to allow any computer in the house to back up data or print.

Next Page »