...

Raspberry Pi で作る WordPress サーバ

by user

on
Category: Documents
24

views

Report

Comments

Transcript

Raspberry Pi で作る WordPress サーバ
Raspberry Pi で作る
WordPress サーバ
2012年11月3日 OSC 会津
WordBench 川崎
池田 百合子
自己紹介
池田 百合子 (いけだゆりこ)
WordPressプラグイン作者
‣
‣
Ktai Style
Ktai Entry
旅行好き
http://www.yuriko.net/
@lilyfanjp
ラズベリーパイ
Raspberry Pi
RaspBerry Pi
カードサイズのARMコンピュータ
教育目的
$35
SD, NIC, USBx2, HDMI, etc
Debian, Arch, QtonPi, etc
じゃんけん大会
に提供
本ガイドについて
OS 書き込みは Mac OS X で作業
$ shasum raspbian.zip
3ee33a94079de631dee606aebd655664035756be
のフォントはシェル作業を示す
raspbian は環境等で変化あり
3ee33a..
は結果表示。入力しない
iface eth0 dhcp
はファイル編集
まず Debian
専用ディストロ Raspbian
Debian Wheezy ベース
testing/sid 混在
www.raspberrypi.org/
downloads
OS書き込み
$ shasum 2012-10-28-wheezy-raspbian.zip
3ee33a94079de631dee606aebd655664035756be
$ unzip 2012-10-28-wheezy-raspbian.zip
(SDカード挿入)
$ df -h
Filesystem
/dev/disk0s2
Size
210Gi
Used
177Gi
3.7Gi
35Mi
Avail Capacity
32Gi
85%
Mounted on
/
3.7Gi
/Volumes/SDCARD
...
/dev/disk1s1
1%
$ diskutil unmount /dev/disk1s1
$ sudo time dd bs=1m if=2012-10-28-wheezyraspbian.img of=/dev/rdisk1
1850+0 records in
1850+0 records out
1939865600 bytes transferred in 595.864583 secs (3255548 bytes/sec)
595.89 real
0.00 user
1.63 sys
起動
起動中
raspi-config
!""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""#
$ Raspi-config
$
$
$
$
info
Information about this tool
$
$
expand_rootfs
Expand root partition to fill SD card
$
$
overscan
Change overscan
$
$
configure_keyboard Set keyboard layout
$
$
change_pass
Change password for 'pi' user
$
$
change_locale
Set locale
$
$
change_timezone
Set timezone
$
$
memory_split
Change memory split
$
$
overclock
Configure overclocking
$
$
ssh
Enable or disable ssh server
$
$
boot_behaviour
Start desktop on boot?
$
$
update
Try to upgrade raspi-config
$
$
$
$
$
$
<Select>
<Finish>
$
$
$
%""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""&
ファイルシステム拡張
!""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""#
$ Raspi-config
$
$
$
$
info
Information about this tool
$
$
expand_rootfs
Expand root partition to fill SD card
$
$
overscan
Change overscan
$
$
configure_keyboard Set keyboard layout
$
$
change_pass
Change password for 'pi' user
$
$
change_locale
Set locale
$
$
change_timezone
Set timezone
$
$
memory_split
Change memory split
$
$
overclock
Configure overclocking
$
$
ssh
Enable or disable ssh server
$
$
boot_behaviour
Start desktop on boot?
$
$
update
Try to upgrade raspi-config
$
$
$
$
$
$
<Select>
<Finish>
$
$
$
%""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""&
expand_rootfs
!""""""""""""""""""""""""""""""""""""""""""""""""""""""""""#
$
$
$ Root partition has been resized.
$
$ The filesystem will be enlarged upon the next reboot
$
$
$
$
$
$
$
$
$
$
$
$
$
$
$
$
$
$
$
$
$
$
$
$
$
$
$
$
<Ok>
$
$
$
%""""""""""""""""""""""""""""""""""""""""""""""""""""""""""&
GPUメモリ割り当て
!""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""#
$ Raspi-config
$
$
$
$
info
Information about this tool
$
$
expand_rootfs
Expand root partition to fill SD card
$
$
overscan
Change overscan
$
$
configure_keyboard Set keyboard layout
$
$
change_pass
Change password for 'pi' user
$
$
change_locale
Set locale
$
$
change_timezone
Set timezone
$
$
memory_split
Change memory split
$
$
overclock
Configure overclocking
$
$
ssh
Enable or disable ssh server
$
$
boot_behaviour
Start desktop on boot?
$
$
update
Try to upgrade raspi-config
$
$
$
$
$
$
<Select>
<Finish>
$
$
$
%""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""&
サーバなので最小で
!""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""#
$ How much memory should the GPU have? e.g. 16/32/64/128/256
$
$
$
$ 16________________________________________________________________ $
$
$
$
$
$
$
$
$
$
$
$
$
$
$
$
$
$
$
$
$
$
$
$
$
$
$
$
<Ok>
<Cancel>
$
$
$
%""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""&
キーボード設定
!""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""#
$ Raspi-config
$
$
$
$
info
Information about this tool
$
$
expand_rootfs
Expand root partition to fill SD card
$
$
overscan
Change overscan
$
$
configure_keyboard Set keyboard layout
$
$
change_pass
Change password for 'pi' user
$
$
change_locale
Set locale
$
$
change_timezone
Set timezone
$
$
memory_split
Change memory split
$
$
overclock
Configure overclocking
$
$
ssh
Enable or disable ssh server
$
$
boot_behaviour
Start desktop on boot?
$
$
update
Try to upgrade raspi-config
$
$
$
$
$
$
<Select>
<Finish>
$
$
$
%""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""&
※デフォルトが UK なので変更すべし
Keyboard model
!""""""""""""""""""""' Configuring keyboard-configuration ("""""""""""""""""""""#
$ Please select the model of the keyboard of this machine.
$
$
$
$ Keyboard model:
$
$
$
$
Generic 101-key PC
$
$
Generic 102-key (Intl) PC
) $
$
Generic 104-key PC
) $
$
Generic 105-key (Intl) PC
) $
$
Genius Comfy KB-12e
) $
$
Genius Comfy KB-16M / Genius MM Keyboard KWD-910
) $
$
Genius Comfy KB-21e-Scroll
) $
$
Genius KB-19e NB
) $
$
Genius KKB-2050HS
) $
$
$
$
$
$
<Ok>
<Cancel>
$
$
$
%"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""&
Generic 105-Key
!"""""""""""""""' Configuring keyboard-configuration ("""""""""""""""#
$ Please select the layout matching the keyboard for this machine.
$
$
$
$ Keyboard layout:
$
$
$
$
English (UK)
$
$
English (UK) - English (UK, Colemak)
$
$
English (UK) - English (UK, Dvorak with UK punctuation)
$
$
English (UK) - English (UK, Dvorak)
$
$
English (UK) - English (UK, Macintosh international)
$
$
English (UK) - English (UK, Macintosh)
$
$
English (UK) - English (UK, extended WinKeys)
$
$
English (UK) - English (UK, international with dead keys)
$
$
Other
$
$
$
$
$
$
<Ok>
<Cancel>
$
$
$
%""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""&
UK→US
!""""""""""""""""""' Configuring keyboard-configuration (""""""""""""""""""#
$ The layout of keyboards varies per country, with some countries having
$
$ multiple common layouts. Please select the country of origin for the
$
$ keyboard of this computer.
$
$
$
$ Country of origin for the keyboard:
$
$
$
$
English (Cameroon)
)
$
$
English (Ghana)
)
$
$
English (Nigeria)
)
$
$
English (South Africa)
)
$
$
English (UK)
)
$
$
English (US)
)
$
$
Esperanto
)
$
$
Estonian
)
$
$
Faroese
)
$
$
Filipino
$
$
$
$
$
$
<Ok>
<Cancel>
$
$
$
%""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""&
※日本語の場合はここでJapaneseを選ぶ
English(US)
!"""""""""""""""""""""' Configuring keyboard-configuration (""""""""""""""""""""""#
$ Please select the layout matching the keyboard for this machine.
$
$ Keyboard layout:
$
$
English (US)
$
$
English (US) - Cherokee
$
$
English (US) - English (Colemak)
$
$
English (US) - English (Dvorak alternative international no dead keys)
$
$
English (US) - English (Dvorak international with dead keys)
$
$
English (US) - English (Dvorak)
$
$
English (US) - English (Macintosh)
$
$
English (US) - English (US, alternative international)
$
$
English (US) - English (US, international with dead keys)
$
$
English (US) - English (US, with euro on 5)
$
$
English (US) - English (classic Dvorak)
$
$
English (US) - English (international AltGr dead keys)
$
$
English (US) - English (layout toggle on multiply/divide key)
$
$
English (US) - English (left handed Dvorak)
$
$
English (US) - English (programmer Dvorak)
$
$
English (US) - English (right handed Dvorak)
$
$
English (US) - Russian (US, phonetic)
$
$
English (US) - Serbo-Croatian (US)
$
$
Other
$
$
<Ok>
<Cancel>
$
%"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""&
AltGr Key
!"""""""""""""""""""""' Configuring keyboard-configuration (""""""""""""""""""""""#
$ With some keyboard layouts, AltGr is a modifier key used to input some
$
$ characters, primarily ones that are unusual for the language of the keyboard
$
$ layout, such as foreign currency symbols and accented letters. These are often $
$ printed as an extra symbol on keys.
$
$
$
$ Key to function as AltGr:
$
$
$
$
The default for the keyboard layout
$
$
No AltGr key
$
$
Right Alt (AltGr)
$
$
Right Control
$
$
Right Logo key
$
$
Menu key
$
$
Left Alt
$
$
Left Logo key
$
$
Keypad Enter key
$
$
Both Logo keys
$
$
Both Alt keys
$
$
$
$
$
$
<Ok>
<Cancel>
$
$
$
%"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""&
Compose Key
!"""""""""""""""""""""' Configuring keyboard-configuration (""""""""""""""""""""""#
$ The Compose key (known also as Multi_key) causes the computer to interpret the $
$ next few keystrokes as a combination in order to produce a character not found $
$ on the keyboard.
$
$
$
$ On the text console the Compose key does not work in Unicode mode. If not in
$
$ Unicode mode, regardless of what you choose here, you can always also use the
$
$ Control+period combination as a Compose key.
$
$
$
$ Compose key:
$
$
$
$
No compose key
$
$
Right Alt (AltGr)
$
$
Right Control
$
$
Right Logo key
$
$
Menu key
$
$
Left Logo key
$
$
Caps Lock
$
$
$
$
$
$
<Ok>
<Cancel>
$
$
$
%"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""&
Ctrl+Alt+BS
!"""""""""""""""""""""' Configuring keyboard-configuration (""""""""""""""""""""""#
$
$
$ By default the combination Control+Alt+Backspace does nothing. If you want it $
$ can be used to terminate the X server.
$
$
$
$ Use Control+Alt+Backspace to terminate the X server?
$
$
$
$
<Yes>
<No>
$
$
$
%"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""&
パスワード変更
!""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""#
$ Raspi-config
$
$
$
$
info
Information about this tool
$
$
expand_rootfs
Expand root partition to fill SD card
$
$
overscan
Change overscan
$
$
configure_keyboard Set keyboard layout
$
$
change_pass
Change password for 'pi' user
$
$
change_locale
Set locale
$
$
change_timezone
Set timezone
$
$
memory_split
Change memory split
$
$
overclock
Configure overclocking
$
$
ssh
Enable or disable ssh server
$
$
boot_behaviour
Start desktop on boot?
$
$
update
Try to upgrade raspi-config
$
$
$
$
$
$
<Select>
<Finish>
$
$
$
%""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""&
※キーボードレイアウト変更後に行うこと
時間帯の変更
!""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""#
$ Raspi-config
$
$
$
$
info
Information about this tool
$
$
expand_rootfs
Expand root partition to fill SD card
$
$
overscan
Change overscan
$
$
configure_keyboard Set keyboard layout
$
$
change_pass
Change password for 'pi' user
$
$
change_locale
Set locale
$
$
change_timezone
Set timezone
$
$
memory_split
Change memory split
$
$
overclock
Configure overclocking
$
$
ssh
Enable or disable ssh server
$
$
boot_behaviour
Start desktop on boot?
$
$
update
Try to upgrade raspi-config
$
$
$
$
$
$
<Select>
<Finish>
$
$
$
%""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""&
Geographic area
!"""""""""""""""""""""""""' Configuring tzdata (""""""""""""""""""""""""""#
$ Please select the geographic area in which you live. Subsequent
$
$ configuration questions will narrow this down by presenting a list of
$
$ cities, representing the time zones in which they are located.
$
$
$
$ Geographic area:
$
$
Africa
$
$
America
$
$
Antarctica
$
$
Australia
$
$
Arctic
$
$
Asia
$
$
Atlantic
$
$
Europe
$
$
Indian
$
$
Pacific
$
$
SystemV
$
$
US
$
$
Etc
$
$
$
$
<Ok>
<Cancel>
$
$
$
%"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""&
Asia
!"""""""""""""""""""""""' Configuring tzdata ("""""""""""""""""""""""#
$ Please select the city or region corresponding to your time zone. $
$
$
$ Time zone:
$
$
$
$
Seoul
)
$
$
Shanghai
)
$
$
Singapore
)
$
$
Taipei
)
$
$
Tashkent
)
$
$
Tbilisi
)
$
$
Tehran
)
$
$
Tel_Aviv
)
$
$
Thimphu
)
$
$
Tokyo
)
$
$
Ujung_Pandang
)
$
$
Ulaanbaatar
)
$
$
Urumqi
$
$
$
$
<Ok>
<Cancel>
$
$
$
%""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""&
ロケール追加
!""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""#
$ Raspi-config
$
$
$
$
info
Information about this tool
$
$
expand_rootfs
Expand root partition to fill SD card
$
$
overscan
Change overscan
$
$
configure_keyboard Set keyboard layout
$
$
change_pass
Change password for 'pi' user
$
$
change_locale
Set locale
$
$
change_timezone
Set timezone
$
$
memory_split
Change memory split
$
$
overclock
Configure overclocking
$
$
ssh
Enable or disable ssh server
$
$
boot_behaviour
Start desktop on boot?
$
$
update
Try to upgrade raspi-config
$
$
$
$
$
$
<Select>
<Finish>
$
$
$
%""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""&
change_locale
!""""""""""""""""""""""""""' Configuring locales (""""""""""""""""""""""""""#
$ Locales are a framework to switch between multiple languages and allow
$
$ users to use their language, country, characters, collation order, etc.
$
$
$
$ Please choose which locales to generate. UTF-8 locales should be chosen
$
$ by default, particularly for new installations. Other character sets may $
$ be useful for backwards compatibility with older systems and software.
$
$
$
$ Locales to be generated:
$
$
$
$
[ ] en_GB ISO-8859-1
)
$
$
[ ] en_GB.ISO-8859-15 ISO-8859-15
)
$
$
[ ] en_GB.UTF-8 UTF-8
)
$
...(略)...
$
$
$
[ ] en_US ISO-8859-1
[ ] en_US.ISO-8859-15 ISO-8859-15
[*] en_US.UTF-8 UTF-8
...(略)...
)
)
)
$
$
$
$
[*] ja_JP.EUC-JP EUC-JP
)
$
$
[*] ja_JP.UTF-8 UTF-8
)
$
$
$
$
<Ok>
<Cancel>
$
%"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""&
Default Locale
!""""""""""""""""""""""""""' Configuring locales (""""""""""""""""""""""""""#
$ Many packages in Debian use locales to display text in the correct
$
$ language for the user. You can choose a default locale for the system
$
$ from the generated locales.
$
$
$
$ This will select the default language for the entire system. If this
$
$ system is a multi-user system where not all users are able to speak the
$
$ default language, they will experience difficulties.
$
$
$
$ Default locale for the system environment:
$
$
$
$
None
$
$
en_US.UTF-8
$
$
ja_JP.EUC-JP
$
$
ja_JP.UTF-8
$
$
$
$
$
$
<Ok>
<Cancel>
$
$
$
%"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""&
※ja_JP を選ぶならフォントも入れよう
アップデート
!""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""#
$ Raspi-config
$
$
$
$
info
Information about this tool
$
$
expand_rootfs
Expand root partition to fill SD card
$
$
overscan
Change overscan
$
$
configure_keyboard Set keyboard layout
$
$
change_pass
Change password for 'pi' user
$
$
change_locale
Set locale
$
$
change_timezone
Set timezone
$
$
memory_split
Change memory split
$
$
overclock
Configure overclocking
$
$
ssh
Enable or disable ssh server
$
$
boot_behaviour
Start desktop on boot?
$
$
update
Try to upgrade raspi-config
$
$
$
$
$
$
<Select>
<Finish>
$
$
$
%""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""&
raspi-config update
Get:1 http://archive.raspberrypi.org wheezy InRelease [7665 B]
Get:2 http://mirrordirector.raspbian.org wheezy InRelease [12.5 kB]
Get:3 http://archive.raspberrypi.org wheezy/main armhf Packages [5738 B]
Get:4 http://mirrordirector.raspbian.org wheezy/main armhf Packages [7376 kB]
Ign http://archive.raspberrypi.org wheezy/main Translation-en
Get:5 http://mirrordirector.raspbian.org wheezy/contrib armhf Packages [23.3 kB]
Get:6 http://mirrordirector.raspbian.org wheezy/non-free armhf Packages [46.5 kB]
Get:7 http://mirrordirector.raspbian.org wheezy/rpi armhf Packages [14 B]
Ign http://mirrordirector.raspbian.org wheezy/contrib Translation-en
Ign http://mirrordirector.raspbian.org wheezy/main Translation-en
Ign http://mirrordirector.raspbian.org wheezy/non-free Translation-en
Ign http://mirrordirector.raspbian.org wheezy/rpi Translation-en
Fetched 7472 kB in 60s (124 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
raspi-config is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 63 not upgraded.
OS アップデート
$ sudo su # aptitude update
# aptitude upgrade
筆者は aptitude が好み
apt-get 大嫌い
ここから
シェル作業
固定IP化
$ cd /etc/network/
$ sudo su # cp -p interfaces interfaces-dhcp
# mv interfaces interfaces-static
# ln -s interfaces-static interfaces
# vi interface-static
iface eth0 inet static
address
192.168.2.8
netmask
255.255.255.0
network
192.168.2.0
broadcast 192.168.2.255
gateway
192.168.2.1
ホスト名変更
# vi /etc/hostname
yucca
# vi /etc/hosts
#127.0.0.1 raspberrypi
192.168.2.8 yucca
# shutdown -r now
Yucca gloriosa
Photo by Magnus Manske
aptitude install
$ sudo su # aptitude install php5 php5-gd \
mysql-server phpmyadmin wordpress
The following NEW packages will be installed:
apache2-mpm-prefork{a} apache2-utils{a} apache2.2-bin{a}
apache2.2-common{a} dbconfig-common{a} heirloom-mailx{a}
javascript-common{a} libaio1{a} libapache2-mod-php5{a} libapr1{a}
libaprutil1{a} libaprutil1-dbd-sqlite3{a} libaprutil1-ldap{a}
libdbd-mysql-perl{a} libdbi-perl{a} libhtml-template-perl{a}
libjs-cropper{a} libjs-prototype{a} libjs-scriptaculous{a} libmcrypt4{a}
libmysqlclient16{a} libmysqlclient18{a} libnet-daemon-perl{a} libonig2{a}
libphp-phpmailer{a} libphp-snoopy{a} libplrpc-perl{a} libqdbm14{a}
mysql-client-5.5{a} mysql-common{a} mysql-server mysql-server-5.5{a}
mysql-server-core-5.5{a} php5 php5-cli{a} php5-common{a} php5-gd
php5-mcrypt{a} php5-mysql{a} phpmyadmin ssl-cert{a} tinymce{a} wordpress
wordpress-l10n{a} wwwconfig-common{a}
0 packages upgraded, 45 newly installed, 0 to remove and 5 not upgraded.
Need to get 35.0 MB of archives. After unpacking 168 MB will be used.
Do you want to continue? [Y/n/?]
MySQLパスワード設定
!""""""""""""""""""""# Configuring mysql-server-5.5 $"""""""""""""""""""""%
& While not mandatory, it is highly recommended that you set a password
&
& for the MySQL administrative "root" user.
&
&
&
& If this field is left blank, the password will not be changed.
&
&
&
& New password for the MySQL "root" user:
&
&
&
& _______________________________________________________________________ &
&
&
&
<Ok>
&
&
&
'"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""(
※RasPi 自体のパスワードとは別にしよう
パスワード確認
!""""""# Configuring mysql-server-5.5 $"""""""%
&
&
&
&
& Repeat password for the MySQL "root" user: &
&
&
& ___________________________________________ &
&
&
&
<Ok>
&
&
&
'"""""""""""""""""""""""""""""""""""""""""""""(
phpMyAdmin 設定
!""""""""""""""""""""""""' Configuring phpmyadmin ("""""""""""""""""""""""""#
$ Please choose the web server that should be automatically configured to
$
$ run phpMyAdmin.
$
$
$
$ Web server to reconfigure automatically:
$
$
$
$
[*] apache2
$
$
[ ] lighttpd
$
$
$
$
$
$
<Ok>
$
$
$
%"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""&
DB 初期設定
!""""""""""""""""""""""""' Configuring phpmyadmin ("""""""""""""""""""""""""#
$
$
$ The phpmyadmin package must have a database installed and configured
$
$ before it can be used. This can be optionally handled with
$
$ dbconfig-common.
$
$
$
$ If you are an advanced database administrator and know that you want to
$
$ perform this configuration manually, or if your database has already
$
$ been installed and configured, you should refuse this option. Details
$
$ on what needs to be done should most likely be provided in
$
$ /usr/share/doc/phpmyadmin.
$
$
$
$ Otherwise, you should probably choose this option.
$
$
$
$ Configure database for phpmyadmin with dbconfig-common?
$
$
$
$
<Yes>
<No>
$
$
$
%"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""&
DB 管理者パス入力
!"""""""""""""""""""""""' Configuring phpmyadmin (""""""""""""""""""""""""#
$ Please provide the password for the administrative account with which
$
$ this package should create its MySQL database and user.
$
$
$
$ Password of the database's administrative user:
$
$
$
$ _______________________________________________________________________ $
$
$
$
<Ok>
<Cancel>
$
$
$
%"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""&
※さっき設定した MySQL root パスワード
アプリパスワード設定
!""""""""""""""""""""""""' Configuring phpmyadmin (""""""""""""""""""""""""#
$ Please provide a password for phpmyadmin to register with the database
$
$ server. If left blank, a random password will be generated.
$
$
$
$ MySQL application password for phpmyadmin:
$
$
$
$ ________________________________________________________________________ $
$
$
$
<Ok>
<Cancel>
$
$
$
%""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""&
※これは空白のままOKしてよい
Apache2 設定
# vi /etc/apache2/apache.conf
#<IfModule mpm_prefork_module>
#
StartServers
5
#
MinSpareServers
5
#
MaxSpareServers
10
#
MaxClients
150
#
MaxRequestsPerChild
0
# </IfModule>
<IfModule mpm_prefork_module>
StartServers
2
MinSpareServers
2
MaxSpareServers
8
MaxClients
150
MaxRequestsPerChild
0
</IfModule>
# vi /etc/apache2/conf.d/charset
#AddDefaultCharset UTF-8
AddDefaultCharset UTF-8
PHP5 設定
# vi /etc/php5/apache2/php.ini
short_open_tag = Off
memory_limit = 32M
default_charset = "UTF-8"
upload_max_filesize = 8M
max_file_uploads = 2
date.timezone = Asia/Tokyo
mbstring.language = Japanese
mbstring.internal_encoding = UTF-8
mbstring.http_input = pass
mbstring.http_output = pass
mbstring.encoding_translation = Off
# vi /etc/php5/cli/php.ini
(memory_limit, upload 関連は変更不要)
phpMyAdmin保護
# vi /etc/phpmyadmin/apache.conf
# Authorize for setup
# <Directory /usr/share/phpmyadmin/setup>
#
<IfModule mod_authn_file.c>
#
AuthType Basic
#
AuthName "phpMyAdmin Setup"
#
AuthUserFile /etc/phpmyadmin/htpasswd.setup
#
</IfModule>
#
Require valid-user
#</Directory>
# Authorize for login
<Directory /usr/share/phpmyadmin>
<IfModule mod_authn_file.c>
AuthType Basic
AuthName "phpMyAdmin Login"
AuthUserFile /etc/phpmyadmin/htpasswd.login
</IfModule>
Require valid-user
</Directory>
Basic 認証パスワード
# cd /etc/phpmyadmin
# htpasswd -c htpasswd.login myadmin
New password: (そんなに強固でなくていい)
Re-type new password: (再度入力)
Adding password for user myadmin
Apache 再起動
# /etc/init.d/apache2 restart
[ ok ] Restarting web server: apache2...waiting.
デフォルトDBユーザ削除
DB ユーザ追加
新規 DB 作成
Debian の
WordPress
ファイル構造
本体
/usr/share/wordpress/
プラグイン /var/lib/wordpress/wp-content/
または
テーマ
/srv/www/wp-content/{HTTP_HOST}
設定
/etc/wordpress/
説明
/usr/share/doc/wordpress/
利点
WP のアップデートは aptitude
複数のサイトを作っても一括で更新
WP コアファイルが DocRoot 外
欠点
サブディレクトリに複数のサイト設
置が困難
サイト作成
今回のサイト
http://192.168.2.8/blog/
あくまで内側向けサイト
apache2 設定
# a2enmod rewrite
# cat > /etc/apache2/sites-available/wp
##Alias /blog /usr/share/wordpress
Alias /blog/wp-content /var/lib/wordpress/wp-content
Alias /blog /usr/share/wordpress
<Directory /usr/share/wordpress>
Options FollowSymLinks
AllowOverride Limit Options FileInfo
DirectoryIndex index.php
Order allow,deny
Allow from all
</Directory>
<Directory /var/lib/wordpress/wp-content>
Options FollowSymLinks
Order allow,deny
Allow from all
</Directory>
# a2ensite wp
# /etc/init.d/apache2 restart
/usr/share/doc/wordpress/examples/apache.conf 参照
wp-config 作成
# cp /usr/share/wordpress/wp-config-sample.php \
/etc/wordpress/config-192.168.2.8.php
# vi /etc/wordpress/config-192.168.2.8.php
define('DB_NAME', 'lily_wp');^M
define('DB_USER', 'lily');^M
define('DB_PASSWORD', 'password_here');^M
define('AUTH_KEY',
'Ge,]iLN`-O9w:`uQ}mJ^kV>ejJ:=!PG<1|Oe4thQmT|,5UAEv{}!VYkFV5Y.tbW$');
define('SECURE_AUTH_KEY', ' i0qQ8$jG}ue*{c!G`>65Bn+qj+mfi-<~CL&eI@/@RIxu]Rq.6OWj`;n5]OE+1dS');
define('LOGGED_IN_KEY',
'OApp;rL~}yvD`Tun%}{x~y%_);!8$6-L0JD *T50$=+5oKO&B3bAQrpk@KBQ+-?8');
define('NONCE_KEY',
'S5nO-[xfeP>^~,Uhu9>(R{p>V3|?G?9DTn;4H~&5GXK<[Zl%[qQz95ww|#tgd;l#');
define('AUTH_SALT',
'CV0]bRO3nE]@?L1Q3O[GOQl5S^adJ|UahYU8P,DAv+yJzz8tZ,4{j3mZoUmkkqj6');
define('SECURE_AUTH_SALT', '^uHI80H=xNSsABn5oPNU)KNyYO2D^I2}F*(#!3xB*C7A{vk&ZTTU=%C6+5$#(PU ');
define('LOGGED_IN_SALT',
'(B.fL1Waab(QS.S`QY:l27)H8Cnl+#u?-q;)}T`psj>kbQu~ q+*I(l%`ph9%b!]');
define('NONCE_SALT',
' }3`+:m3}@UE=MCbkguwlF{a3? VKA9EPedhc 8.*qSj#^AhBe%JJ956L.#:c]eR');
define('WPLANG', 'ja');^M
define('WP_CONTENT_DIR', '/var/lib/wordpress/wp-content');
※2,3回リロードして使う
※値コピー後も2,3回リロード
https://api.wordpress.org/
secret-key/1.1/salt/
WP インストール
インストール完了
ログイン
管理パネル
フロントページ
テーマ・プラグイン
管理パネルでのインストールができ
ない……
/var/lib/wordpress/wp-content/themes 等に scp
sudo chown -R www-data /var/lib/wordpress/\
wp-content
これでもダメなら define('FS_METHOD','direct');
追加作業
OS ユーザ追加
/etc/skel, /etc/profile, /etc/adduser.conf,
/etc/sudoers 修正
update-alternatives --config editor
avahi 設定
メール設定
iptables 設定
参考サイト
Raspberry Pi メモ
http://www.mztn.org/rpi/rpi00.html
Raspberry Pi Wiki
http://elinux.org/JP:R-Pi_Hub
Japan Raspberry Pi ユーザーグループ
https://groups.google.com/forum/#!forum/
japanese-raspberry-pi-users-group
おまけ:
Raspberry Pi
のはじめかた
必要なもの
Raspberry Pi 本体 (必須)
USB セルフパワーHUB
USB キーボード
USB マウス
HDMI-DVI/HDMI-VGA アダプタ
本体の入手
RS オンライン
納期がかなり遅い
ModMyPi
ケースとセット購入が必要
Adafruit
Starter Pack の購入が必要
CPC
英国外は法人取引が中心。個人販売は困難。
お願い
若松通商さんあたりがCPCと取引し
ていただければ……
Fly UP