LEMP for Raspberry Pi

如果覺得自己修改 RASPBIAN 很麻煩,或自己從 ArchLinux 安裝 LNMP(Linux Nginx + MariaDB+PHP) 很辛苦,可以考慮下載由 Hayden James 製作的 LEMP for Raspberry Pi

LEMP for Raspberry Pi 網站:
http://haydenjames.io/download-lemp-raspberry-pi-nginx-mariadb-mysql-php/

下載網站:
http://sourceforge.net/projects/lemp-raspberry-pi/files/latest/download[@more@]預設登入的帳號及密碼:root / root
# passwd
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully

設定時區
# date
Sun Sep 28 09:13:30 MDT 2014
# ls -l /etc/localtime
lrwxrwxrwx 1 root root 34 Aug 13  2013 /etc/localtime -> /usr/share/zoneinfo/America/Denver

刪除舊有設定
# rm -rf /etc/localtime

連結到 Asis/Taipei
# ln -s /usr/share/zoneinfo/Asia/Taipei /etc/localtime

# timedatectl set-timezone Asia/Taipei
# date
Sun Sep 28 23:16:19 CST 2014

更換成台灣的 Server
# sed -i ‘s/^Server/#Server/’ /etc/pacman.d/mirrorlist
# sed -i ’53s/# Server/Server/g’ /etc/pacman.d/mirrorlist

安裝的 Nginx Web Server 版本
# pacman -Qi nginx | grep Version
Version        : 1.6.0-5

安裝的 PHP 版本
# pacman -Qi php | grep Version
Version        : 5.5.14-1

安裝的 MariaDB SQL Server 版本
# pacman -Qi mariadb | grep Version
Version        : 10.0.12-1

更新套件庫
# pacman -Syy

更新已安裝的套件
# pacman -Syu

Niginx Web Server 預設網頁根目錄
/usr/share/nginx/html

MariaDB SQL Server 預設帳號及密碼
root / changeme

進行密碼更改及安全性上設定
/usr/bin/mysql_secure_installation

解決 ArchLinux 套件更新時出現的錯誤

做套件更新時出現錯誤
# pacman -Syu
(28/28) checking for file conflicts                       [##############################] 100%
error: failed to commit transaction (conflicting files)
/sbin/ exists in both ‘bash’ and ‘filesystem’
/lib/ exists in both ‘libldap’ and ‘filesystem’
/lib/ exists in both ‘krb5’ and ‘filesystem’[@more@]

在網路上搜尋了一下,找到了下面這一篇:
arch linux – Pacman -Syu fails `/bin exists in filesystem` – Unix & Linux Stack Exchange

先不更新 filesystem 及 bash 套件
# pacman -Syu –ignore filesystem,bash

更新 bash 套件
# pacman -S bash
resolving dependencies…
looking for inter-conflicts…

Packages (1): bash-4.3.030-1

Total Installed Size:   6.38 MiB
Net Upgrade Size:       0.00 MiB

:: Proceed with installation? [Y/n] y
(1/1) checking keys in keyring                            [##############################] 100%
(1/1) checking package integrity                          [##############################] 100%
(1/1) loading package files                               [##############################] 100%
(1/1) checking for file conflicts                         [##############################] 100%
(1/1) checking available disk space                       [##############################] 100%
(1/1) upgrading bash                                      [##############################] 100%
warning: directory permissions differ on /etc/
filesystem: 775  package: 755

似乎是 /etc 目錄權限有問題,不能更新

檢查 /etc 目錄權限,目錄權限為 775
# ls -ld /etc
drwxrwxr-x 61 1001 1001 4096 Oct 31 11:04 /etc

更改 /etc 目錄權限為 755
# chmod 755 /etc

/etc 目錄權限已更改為 755
# ls -ld /etc
drwxr-xr-x 61 1001 1001 4096 Oct 31 11:04 /etc

再更新一次 bash,就能正常更新了
# pacman -S bash
warning: bash-4.3.030-1 is up to date — reinstalling
resolving dependencies…
looking for inter-conflicts…

Packages (1): bash-4.3.030-1

Total Installed Size:   6.38 MiB
Net Upgrade Size:       0.00 MiB

:: Proceed with installation? [Y/n] y
(1/1) checking keys in keyring                            [##############################] 100%
(1/1) checking package integrity                          [##############################] 100%
(1/1) loading package files                               [##############################] 100%
(1/1) checking for file conflicts                         [##############################] 100%
(1/1) checking available disk space                       [##############################] 100%
(1/1) reinstalling bash                                   [##############################] 100%

更新剩下的 filesystem
# pacman -Su