Tuesday, June 16, 2015

Host a Wordpress Site on the Raspberry Pi

In this tutorial I will show you how to host a Wordpress website from your Pi.

Time: About an hour.
Difficulty: Medium.

You Will Need:

  • A Raspberry Pi running Raspbian
  • An Internet connection
  • Keyboard, mouse, and monitor. Or you can use remote desktop.
Steps:
  1. Log in to Raspbian and open the terminal.
  2. Type sudo apt-get install apache2 -y and press Enter.
  3. Find the IP address of your Pi with hostname -I.
  4. Write down and save the IP address.
  5. In a web browser, navigate to the IP address.
  6. You should see this.
  7. Type sudo apt-get install php5 libapache2-mod-php5 -y. This will install php.
  8. Type sudo apt-get install mysql-server php5-mysql -y. This will install SQL.
  9. SQL will prompt you to set a password. Remember it, you'll need it later.
  10. Now we will install Wordpress.
  11. Type cd /var/www
  12. Type sudo chown pi: .
  13. Type sudo rm *
  14. Type wget http://wordpress.org/latest.tar.gz
  15. Type tar xzf latest.tar.gz
  16. Type mv wordpress/* .
  17. Type rm -rf wordpress latest.tar.gz
  18. Now let's set up the Wordpress database
  19. Type mysql -uroot -p
  20. You will have to enter the password you set earlier.
  21. Type create database wordpress;
  22. Then use Ctrl-D to exit
  23. Go to the IP address of your Pi and you should see a Wordpress site like this one.
  24. Press the Let's Go! button to fill in the details for the configuration form.
  25. You will now have to enter in the information as follows.

  26. Press submit.
  27. Copy and paste the information from the next screen to wp-config.php and hit Ctrl+X, Y, and Enter.
  28. Click Run the Install.
  29. Fill out the form in the next page and click Install Wordpress.
  30. DONE!
Log in to Wordpress to customize your site!

The code for this project came from the Raspberry Pi Official Website. They have many great tutorials so check them out!