5
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ラズパイをいじる ~LAMP環境編~

Last updated at Posted at 2019-02-03

前書き

前回のOSインストール編からの続きです。
Teratermでつないだ状態から始めます。

■LAMP環境構築編

□参考記事

インストール内容

  • Apache2.4
  • PHP7.0
  • MySQL

手順

1.Apache

インストール

sudo apt-get install apache2

バージョン確認

apache2 -v
Server version: Apache/2.4.25 (Raspbian)

デフォルトのドキュメントルート

/var/www/html

Apacheの自動起動確認

sudo ls /etc/rc2.d/

2. PHP7

インストール

sudo apt-get install php7.0 libapache2-mod-php7.0 php7.0-mbstring php7.0-gettext php7.0-mysql

バージョン確認

php -v

php.iniを2か所編集

mbstring.language = Japanese
mbstring.internal_encoding = UTF-8

3. MySQL

インストール

sudo apt-get install mysql-serever

文字コードの設定

sudo vi /etc/mysql/my.conf
# 設定ファイルに以下を追加
[mysqld]
character-set-server=utf8 # デフォルトの文字コードをutf-8
skip-character-set-client-handshake # クライアントのリクエストが何であれutf-8で返す

あとがき

ラズパイならではの情報が特にあるわけではなく、
debianのサーバー立てるみたいになってしまってますね。
途中省略しましたがvim入れたり、rootにパスワードを設定したりしてます。
次回はUSBからbootとストレージの拡張とかやろうかと思います。

補足・修正等ございましたらお知らせください。

5
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?