Build Blog with WordPress(1)First Simple Installation

本文详细介绍如何使用WordPress在Raspberry Pi上搭建个人博客网站,包括安装Apache、PHP、MySQL等步骤,并配置WordPress完成博客的初步设置。
Build Blog with WordPress(1)First Simple Installation

1. Install Apache
install apache on raspberry
> sudo apt-get install apache2

Command to start
> sudo service apache2 start

Error Message:
[....] Starting web server: apache2apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName

Solution:
Find the configuration file and add one line at the end
> /etc/apache2/apache2.conf

ServerName sillycat.ddns.net

Place anything you want in this directory, apache2 will serve the html there.
/var/www

2. Install PHP
Directly use apt install
> sudo apt-get install php5

Usually it will install the apache module as well
> sudo apt-get install libapache2-mod-php5

Verify PHP installation. Change the permission of the directory first.
> sudo chmod 777 -R www

> cat index.php
<?php echo "hello world \n";
echo date('Y-m-d H:i:s');

Then we can visit the page
http://xxxxx/index.php

And display all the PHP information
> cat info.php
<?php phpinfo();

3. Install Mysql
> sudo apt-get install mysql-server

Install the php mysql connector
> sudo apt-get install php5-mysql

4. Install WordPress
Download the latest file
> wget https://wordpress.org/latest.tar.gz

This is the open source official website
https://wordpress.org/

The latest version I get is 4.3 I guess. Unzip the file and copy that to /var/www

The customized directory is wp-content.

5. Configuration on WordPress
Set up Database First
> mysql -u root -p

> create database wordpress;
Query OK, 1 row affected (0.01 sec)

> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| wordpress |
+--------------------+
4 rows in set (0.00 sec)

> use mysql;

> grant all privileges on wordpress.* to username@"%" identified by ‘xxxx';

> flush privileges;

Then I try to hit the website and leading me to a configuration page.
http://sillycat.ddns.net/wordpress

Follow the content and set up mysql database configuration.

> vi wp-config.php

Follow the link and create Sillycat Blogs

The admin link
http://sillycat.ddns.net/wordpress/wp-admin/

My own blog link
http://sillycat.ddns.net/wordpress/

I may switch the names to an easy one. Just use blog.
http://sillycat.ddns.net/blog/wp-admin/
http://sillycat.ddns.net/blog/

References:
http://www.buildyourownblog.net/

https://codex.wordpress.org/zh-cn:WordPress_%E6%96%B0%E6%89%8B_-_%E5%A6%82%E4%BD%95%E5%BC%80%E5%A7%8B

https://www.raspberrypi.org/learning/web-server-wordpress/worksheet.md

add more storage
http://rpi.linux48.com/usbstorage.html
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值