Info Security Memo
  • Blog
  • Sitemap
    • Categories
  • Contact
  • About
  • Resources
  • Tools
  • 51sec.org

Build Confidence

Focusing on Information Security 

Info Security Notes

Install Wordpress on Raspberry Pi

11/9/2015

0 Comments

 

Raspberry Pi is mostly ready for use after the basic configuration completed in my previous posts:

  • Raspberry Pi 2 Model B Basic Configuration Part 2
  • Raspberry Pi 2 Model B Basic Configuration Part 1
  • Remote Access Raspberry Pi from Anywhere

The next cool thing to do is to install wordpress on it. This post is just used to record all steps I have followed online instruction installed an instance of a WordPress site to run on Raspberry Pi using the Apache Web Server. There are a lots of more things you may like to know regarding Apache, PHP, Mysql. It is best to search other online resources or take a look those listing at the Reference section to find out more.


1. Check system update

sudo apt-get update && sudo apt-get upgrade

Choose Y if there is any update.

2. Install Apache2

sudo apt-get install apache2 -y


hostname -I
Get the ip address your Raspberry Pi

Open http://<IP> to confirm apache is working. It show the /var/www/index.html in your browser.

3. Install php5

sudo apt-get install php5 libapache2-mod-php5 -y


create a test index.php file
cd /var/www
sudo echo "<?php phpinfo(); ?>" | sudo tee index.php

verify php has been installed properly by using curl command.
pi@raspberrypi /var/www $ curl http://127.0.0.1/index.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<style type="text/css">
body {background-color: #ffffff; color: #000000;}
body, td, th, h1, h2 {font-family: sans-serif;}
pre {margin: 0px; font-family: monospace;}
a:link {color: #000099; text-decoration: none; background-color: #ffffff;}
a:hover {text-decoration: underline;}
table {border-collapse: collapse;}
.center {text-align: center;}
.center table { margin-left: auto; margin-right: auto; text-align: left;}
.center th { text-align: center !important; }
td, th { border: 1px solid #000000; font-size: 75%; vertical-align: baseline;}
h1 {font-size: 150%;}
h2 {font-size: 125%;}
.p {text-align: left;}
.e {background-color: #ccccff; font-weight: bold; color: #000000;}
.h {background-color: #9999cc; font-weight: bold; color: #000000;}
.v {background-color: #cccccc; color: #000000;}
.vr {background-color: #cccccc; text-align: right; color: #000000;}
img {float: right; border: 0px;}
hr {width: 600px; background-color: #cccccc; border: 0px; height: 1px; color: #000000;}
</style>
<title>phpinfo()</title><meta name="ROBOTS" content="NOINDEX,NOFOLLOW,NOARCHIVE" /></head>
<body><div class="center">
<table border="0" cellpadding="3" width="600">
<tr class="h"><td>
<a href="http://www.php.net/"><img border="0" src="/index.php?=PHPE9568F34-D428-11d2-A769-00AA001ACF42" alt="PHP Logo" /></a><h1 class="p">PHP Version 5.4.45-0+deb7u2</h1>
</td></tr>
......



4. Install mysql database server.

sudo apt-get install mysql-server
During installation of mysql, you will be asked to provide root password.

5. Download wordpress and install it under /var/www/wordpress folder

cd /var/www
sudo chown pi: .
sudo rm *
wget http://wordpress.org/latest.tar.gz


tar xzf latest.tar.gz
//mv wordpress/* .
rm -rf wordpress latest.tar.gz



6. Create wordpress database from mysql command line

mysql -uroot -ppassword
mysql> create database wordpress;
Query OK, 1 row affected (0.00 sec)


7. Open URL "http://<IP>/wordpress" in the browser to start configure Wordpress


During installation wizard, fill out the basic site information as follows:
Database Name:      wordpress
User Name:          root
Password:           <YOUR PASSWORD>
Database Host:      localhost
Table Prefix:       wp_





During configuration Wordpress site, there is a problem to write wp-config.php file. To resolve this issue, you will have to manually create it with the contents showing above in the browser.

cd /var/www/wordpress
nano wp-config.php

Paste the copied text from browser into this file, and save and exit with Ctrl + X, then Y for yes and Enter.

Hit Run the install button to continue the installation. The last step is to enter your wordpress site information.




After installation done, the browser will jump to http://<ip>/wordpress/wp-admin. You will need to provide wordpress site username and password to log into Dashboard to manage your new created site.


There is one tip for a problem which is when you are trying to install new plug-in in your Wordpress site, it will prompt a page to ask you ftp username, password and site address. It is because of wordpress folder's permission problem.

The easiest and fastest fix is :
cd /var/www
sudo chown -hR http:http wordpress

You can replace http user with pi user.




Reference:


  • BUILD A LAMP WEB SERVER WITH WORDPRESS
  • How to Install WordPress on a Raspberry Pi


0 Comments



Leave a Reply.

    Categories

    All
    Architecture
    Blog
    Checkpoint
    Cisco
    Cloud
    CyberArk
    F5
    Fortigate
    Guardium
    Juniper
    Linux
    Network
    Others
    Palo Alto
    Qualys
    Raspberry Pi
    Security
    SIEM
    Software
    Vmware
    VPN
    Wireless

    Archives

    March 2024
    February 2024
    January 2024
    December 2023
    November 2023
    October 2023
    September 2023
    August 2023
    July 2023
    June 2023
    May 2023
    April 2023
    March 2023
    February 2023
    January 2023
    December 2022
    November 2022
    October 2022
    September 2022
    August 2022
    July 2022
    June 2022
    May 2022
    April 2022
    March 2022
    February 2022
    January 2022
    December 2021
    November 2021
    October 2021
    September 2021
    August 2021
    July 2021
    June 2021
    May 2021
    April 2021
    March 2021
    February 2021
    January 2021
    December 2020
    November 2020
    October 2020
    September 2020
    August 2020
    July 2020
    October 2019
    September 2019
    June 2019
    July 2018
    May 2018
    December 2017
    August 2017
    April 2017
    March 2017
    January 2017
    December 2016
    November 2016
    October 2016
    September 2016
    August 2016
    July 2016
    June 2016
    May 2016
    April 2016
    March 2016
    February 2016
    January 2016
    December 2015
    November 2015
    October 2015
    September 2015
    August 2015
    July 2015
    June 2015
    May 2015
    April 2015
    March 2015

    Print Page:

    RSS Feed

    Email Subscribe
Powered by Create your own unique website with customizable templates.
  • Blog
  • Sitemap
    • Categories
  • Contact
  • About
  • Resources
  • Tools
  • 51sec.org