Raspberry Pi with WordPress

IMG_0014

Previously I set up the Raspberry Pi with Berry Web Server, but today I wanted to see how the Pi would run with the more often used Apache, PHP, MySQL and WordPress. One of the podcasts that I watch frequently is Know How, on the TWiT network. A couple of weeks ago they had a show where they did just this.  (A RAMP/LAMP server).  I’ve included their show notes below – the original episode and notes are found via Know How!

Setup:

    1. Download all the files that you’ll need for the project. (Formatting Tool & NOOBS) You’ll find all files at the Raspberrypi.org Download Page
    2. Extract the files to your desktop and copy ALL the contents of the extracted NOOBs folder onto the SD Card.
    3. Connect the Raspberry Pi.
    4. Install – You’ll get a screen that lets you select which distro you want installed on your Pi. Select “Raspbian” and then click “install”
    5. Click “OK” and the RasPi will reboot into the configuration tool.
    6. Change your Password – Using the arrow keys, choose option #2 and change the default password. (Your username will be “pi” and your password will be whatever value you choose.)
    7. Set Language and Time Zone – Scroll down to option #4 “Internationalisation Options” and set the Pi to your language and time zones.
    8. Select “Finish” then hit ENTER

* You’ll now see the Raspbian command prompt which should look like this: “pi@raspberrypi ~$_”

You now need to update the list of available packages, install Apache, MySQL, PHP5, PEAR, and phpMyAdmin, then set the Apache Configuration.

Update Packages
sudo apt-get update

Install Apache
sudo apt-get install apache2

Install MySQL
sudo apt-get install mysql-server
* In the middle of the installation, you’ll be asked to change the root password for the MySQL database.

Install PHP5 & PEAR
sudo apt-get install php5 php-pear php5-mysql
sudo service apache2 restart

Install phpMyAdmin
sudo apt-get install phpmyadmin
* It will ask you, halfway through the installation, which web server you want to use. Select Apache and then select “OK”
* It will also ask you to confirm that you want to use the MySQL database installation that you just completed. Give it the password that you selected and continue.
* Lastly, it will ask you what password you want to use for the phpMyAdmin page.

Set the Apache Configuration
sudo nano /etc/apache2/apache2.conf

Add the line:
Include /etc/phpmyadmin/apache.conf

Start the server
sudo service apache2 restart

Test It!
Type: ifconfig and you’ll get a status screen that includes the “eth0″ IP address. Type that address into your browser and you should see the “It Works!” screen.

If you append “/phpmyadmin/” to the IP address, you’ll enter the phpMyAdmin page.

Add an FTP Server!
Take ownership of the web root by typing:
sudo chown –R pi /var/www

Install the vsftpd package by typing:
sudo apt-get install vsftpd

Edit the vsftpd configuration file by typing:
sudo nano /etc/vsftpd.conf

You need to make four changes to the configuration file:
– First, change “anonymous_enable=YES” to “anonymous_enable=No”
– Remove the comment, the pound sign, from “local_enable=YES” and “write_enable=YES”
– Go to the bottom of the file and add the line: “force_dot_files=YES”
Hit CTRL & X to save and exit.

Now start the FTP server by typing :
sudo service vsftpd restart

Finally, we’re going to create a FTP shortcut. Type:
ln –s(space) /var/www/ (space) ~www

Success :)  It runs pretty well considering the low power!

Pi Blog

Weekend Project: Raspberry Pi with 4.3″ TFT Color Screen

RaspPi-02

For Christmas my geek-half (boyfriend) wanted a 4.3″ screen from Adafruit.com for his Raspberry Pi. After a bit of searching, I decided to get a screen that looked pretty darn similar to the Adafruit one off of Amazon.com that was less than half the price! I then bought one for myself with the savings :)  It seems really great for a tiny Pi terminal, either for IRC chat or a Twitter client.

RaspPi-03

I set up this particular SD card for my Raspberry Pi using NOOBS, and installed the Raspbian image.  If you also decide to get the same screen (for such a good deal at $19.78 USD), I have the following set up for my /boot/config.txt in order to get a really good edge to edge fit on the display. (By default it’s a bit wonky.)   I’ve only included the lines that I’ve uncommented.  There are some comments on the Amazon.com thread where I purchased this.  See my settings work for you!


# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
disable_overscan=0
overscan_scale=1 #currently undocumented but works

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
overscan_left=8
overscan_right=8
overscan_top=0
overscan_bottom=-16

# uncomment to force a console size. By default it will be display’s size minus
# overscan.
framebuffer_width=480
framebuffer_height=272

# uncomment for composite PAL
sdtv_mode=0 #for NTSC
sdtv_aspect=3 #for 16:9

# for more options see http://elinux.org/RPi_config.txt
start_x=1
gpu_mem=128

RaspPi-01

If you are wondering, the keyboard I use is a Logitech K400.  It’s great for space saving and super lightweight.

Next step is to find a lightweight Twitter client. This seems to be a challenge…Comments with suggestions would be appreciated!

 

Glance App for Pebble!

 

image

 

I’m really liking the Pebble watch.  I finally received mine in red – I decided to wait instead of settling for the black version.  Today I decided to try to install Glance, which is an app for Pebble.  It gives you an option to display the weather, plus more notifications if you want to.  Check it out on the Google Play store if you have a Pebble watch and Android phone!

I’m a Gadgeteer!

My college friend Jackie Cheng informed me about audtions for The-Gadgeteer.com, a gadget reviews and news website by Julie Strietelmeier.  I figured it was worth a shot to try out, and after a couple of weeks – HURRAY, I was accepted!  I now will get to do gadget reviews of my own, as well as post news stories on anything I find interesting.  So far it’s really taught me a lot about writing, reviewing, and editing what I post.  Strangely, I never realized how much work it actually was to write professionally and give my opinions on a product.

I can’t wait to contribute more!  Thanks for the opportunity Julie!

MK802 Mini Android PC

Today’s “hack” comes to you by something I saw on one of my fave podcasts from Hak5.  I decided to purchase the MK802 from Amazon.com for only $35 USD! There are newer models with slightly different hardware, but this one was cheap enough for me to want to play with.  

For my first try, I followed the instructions from this forum over at Rikomagic.  I did have a bit of trouble downloading the Lubuntu image since it was so big, but after a few tries I got a successful image.  I was able to boot into it from the micro SD card, and viola, Lubuntu on my (other) $35 PC!  I definitely recommend giving this fun PC a try, since it’s so affordable and pretty easy to install other OS’s if you don’t like the default Android OS that’s on there (it comes with Android 4.0).

 

Android to Ubuntu

 

 

 

Raspberry Pi with BerryWebServer

Today I decided to install a new OS onto my Raspberry Pi, since I want to try it out as a light web server for a local blog or website.  After reading the raspberry.org site, I gave BerryBoot  a try.  I unzipped the required files onto my formatted SD card, and booted up the pi.  I chose the OS BerryWebServer that gave me the option to install Lighttpd + PHP + SQLITE.  Perfect, or so I thought!

When I installed everything, it booted and let me change my default password. It gave me the web address of the Pi, and I went ahead and FTP’d into my new pi web server from another machine.  Since this install doesn’t come with an SQL manager, I installed PHPLiteAdmin.  I ran into a few issues after uploading my wordpress files and edited my wp-config.php to match my server:

Although this installation is running SQLite, WordPress needs to be told this specifically since it uses MySQL by default. We need to install the PDO (SQLite) for Wordpress plugin.

To install PDO For WordPress we need to:

  1. unzip the files in your wp-content directory. The structure should look like:
    wp-content
    ->plugins
    ->themes
    ->pdo
    db.php
    index.php[maybe]
    Then in wp-config.php, right after the define(‘COLLATE’,”); line, we need to add

 

define(‘DB_TYPE’, ‘sqlite’);    //use sqlite

After much trial and error, I still couldn’t get my database installed properly.  I was puzzled by the fact that phpliteadmin couldn’t see the database WordPress would have created, as well as why I couldn’t log in once I WAS able to run the install.  I found my answer here:

http://wordpress.org/support/topic/plugin-pdo-sqlite-for-wordpress-does-not-give-the-password-on-install-in-301

Turns out I had to add

function wp_install($blog_title, $user_name, $user_email, $public, $deprecated=”, $user_password = ”)

then

$message = __(‘Note that password:’ . $random_password . ‘ carefully! It is a random password that was generated just for you.’);

in the file  “wp-content/pdo/wp_install.php”.  After that, I was able to see the randomly generated password on the page, and log in with that.  (This will happen even if you do choose a password.)

 

I then found out after all this that the PDO plugin wouldn’t really work unless I went back to WordPress 3.1.2!  Someone says that if you update WordPress after everything works, it will stay working as it should.

Either way, I’m happy I persisted, and now have my very light PiServer running at home :)

 

 

Boxee alternative

I recently wanted to catch up to all of my podcasts that I’ve missed due to my recent trip to California (post and photos coming soon!), so I fired up my HTPC/Server, only to find out that Boxee for Windows no longer runs properly on my machine. The software will run, but no internet content will be downloaded.  I ensured internet access was running on my server, and no go.  I know that they stopped supporting Boxee on the desktop a while back due to wanting people to purchase a Boxee box, but I figured I’d hold off since I didn’t want to purchase another box just for that.

So now I need to look into another alternative.  I really liked Boxee due to it’s easy to use interface, including being able to view popular apps to stream podcasts and TV shows.  I’ve heard of XMBC, but never gave it a proper shot.  So I proceeded to install XMBC, and finally took the time out to check what it has to offer. I was looking mainly for ability to stream my favorite podcasts online.  I discovered that I can install TONS of video plugins, including my favorite channel on Revision3.  I also like that it can run on any popular OS, including Mac, Windows and Linux.  I’m very  happy!

Raspberry Pi and HDMI

I finally had time to sit down and try to figure out what was wrong with with my monitor resolution when connecting to my Raspberry Pi.  I am using HDMI to connect to my 23″ monitor that supports 1920×1080 resolution. My Raspberry Pi would never seem to fit the entire screen! Frustrating after spending over an hour testing different configurations in the /boot/config.txt file.  I finally ran across this thread from the forums, and the command

disable_overscan=1

worked!  Such a simple fix.  I guess googling the correct keywords finally helped me in the end :P  Thank you Raspberry Pi forums :D

Home Server RAID

Today’s project is brought to you by the letter “R”, for RAID!

I finally bought three Seagate Barracuda Green 1.5TB SATA 6Gb/s drives for my HP N36L Micro Server that I got for Christmas. I will set it up as a software RAID on my Windows Server 2008 R2 box and use it as a file share. Pretty sweet. Software RAID will be good enough for my home usage as far as I can see.

I had another though since I use a small PC for all of my video podcasts. Why not try to install my spare Asus ATI Radeon HD 5450 via card in my Micro Server? Since it’s a low profile card that has DVI and HDMI out – I could easily use the HDMI to output to my TV and use that for audio as well! Turns out it works great! So I have Windows Server 2008 R2 running Miro for my podcasts, eventually rip all of my media onto the RAID, and keep Win2k8 so that I can learn about it for work and my career. Professional server and HTPC all in one!