Build Blog with WordPress(1)First Simple Installation

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

猜你喜欢

转载自sillycat.iteye.com/blog/2239829
今日推荐