ブログ - Raspberry PiにApache2をインストールしてみた
apacheをインストールしてみる.
合計7MB.yを入力して続行.
関連するパッケージもインストールされた模様.
インストールしたパッケージのファイル一覧から,設定ファイルのある場所を調べる.
apachectlの場所.
設定をテストしてみる.
ServerNameが設定されてないとエラーがでているので確認.
何も無い模様.サンプルも無い. 設定を入れる.
再度設定のテスト.
OKがでたので,Apache httpdを起動してみる.
プロセスもある.Webブラウザで接続してみると,次の様なページが表示される.

これで終了.
ujpadmin@commet:~ $ sudo apt-get install apache2
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています
状態情報を読み取っています... 完了
以下の追加パッケージがインストールされます:
apache2-bin apache2-data apache2-utils libapr1 libaprutil1
libaprutil1-dbd-sqlite3 libaprutil1-ldap liblua5.1-0 ssl-cert
提案パッケージ:
apache2-doc apache2-suexec-pristine apache2-suexec-custom openssl-blacklist
以下のパッケージが新たにインストールされます:
apache2 apache2-bin apache2-data apache2-utils libapr1 libaprutil1
libaprutil1-dbd-sqlite3 libaprutil1-ldap liblua5.1-0 ssl-cert
アップグレード: 0 個、新規インストール: 10 個、削除: 0 個、保留: 47 個。
1,747 kB のアーカイブを取得する必要があります。
この操作後に追加で 5,236 kB のディスク容量が消費されます。
続行しますか? [Y/n] y
取得:1 http://mirrordirector.raspbian.org/raspbian/ jessie/main libapr1 armhf 1.5.1-3 [77.1 kB]
取得:2 http://mirrordirector.raspbian.org/raspbian/ jessie/main libaprutil1 armhf 1.5.4-1 [75.9 kB]
取得:3 http://mirrordirector.raspbian.org/raspbian/ jessie/main libaprutil1-dbd-sqlite3 armhf 1.5.4-1 [17.7 kB]
取得:4 http://mirrordirector.raspbian.org/raspbian/ jessie/main libaprutil1-ldap armhf 1.5.4-1 [16.7 kB]
取得:5 http://mirrordirector.raspbian.org/raspbian/ jessie/main liblua5.1-0 armhf 5.1.5-7.1 [83.7 kB]
取得:6 http://mirrordirector.raspbian.org/raspbian/ jessie/main apache2-bin armhf 2.4.10-10+deb8u4 [893 kB]
取得:7 http://mirrordirector.raspbian.org/raspbian/ jessie/main apache2-utils armhf 2.4.10-10+deb8u4 [194 kB]
取得:8 http://mirrordirector.raspbian.org/raspbian/ jessie/main apache2-data all 2.4.10-10+deb8u4 [162 kB]
取得:9 http://mirrordirector.raspbian.org/raspbian/ jessie/main apache2 armhf 2.4.10-10+deb8u4 [205 kB]
取得:10 http://mirrordirector.raspbian.org/raspbian/ jessie/main ssl-cert all 1.0.35 [20.9 kB]
1,747 kB を 5秒 で取得しました (325 kB/s)
パッケージを事前設定しています ...
以前に未選択のパッケージ libapr1:armhf を選択しています。
(データベースを読み込んでいます ... 現在 118447 個のファイルとディレクトリがインストールされています。)
.../libapr1_1.5.1-3_armhf.deb を展開する準備をしています ...
libapr1:armhf (1.5.1-3) を展開しています...
以前に未選択のパッケージ libaprutil1:armhf を選択しています。
.../libaprutil1_1.5.4-1_armhf.deb を展開する準備をしています ...
libaprutil1:armhf (1.5.4-1) を展開しています...
以前に未選択のパッケージ libaprutil1-dbd-sqlite3:armhf を選択しています。
.../libaprutil1-dbd-sqlite3_1.5.4-1_armhf.deb を展開する準備をしています ...
libaprutil1-dbd-sqlite3:armhf (1.5.4-1) を展開しています...
以前に未選択のパッケージ libaprutil1-ldap:armhf を選択しています。
.../libaprutil1-ldap_1.5.4-1_armhf.deb を展開する準備をしています ...
libaprutil1-ldap:armhf (1.5.4-1) を展開しています...
以前に未選択のパッケージ liblua5.1-0:armhf を選択しています。
.../liblua5.1-0_5.1.5-7.1_armhf.deb を展開する準備をしています ...
liblua5.1-0:armhf (5.1.5-7.1) を展開しています...
以前に未選択のパッケージ apache2-bin を選択しています。
.../apache2-bin_2.4.10-10+deb8u4_armhf.deb を展開する準備をしています ...
apache2-bin (2.4.10-10+deb8u4) を展開しています...
以前に未選択のパッケージ apache2-utils を選択しています。
.../apache2-utils_2.4.10-10+deb8u4_armhf.deb を展開する準備をしています ...
apache2-utils (2.4.10-10+deb8u4) を展開しています...
以前に未選択のパッケージ apache2-data を選択しています。
.../apache2-data_2.4.10-10+deb8u4_all.deb を展開する準備をしています ...
apache2-data (2.4.10-10+deb8u4) を展開しています...
以前に未選択のパッケージ apache2 を選択しています。
.../apache2_2.4.10-10+deb8u4_armhf.deb を展開する準備をしています ...
apache2 (2.4.10-10+deb8u4) を展開しています...
以前に未選択のパッケージ ssl-cert を選択しています。
.../ssl-cert_1.0.35_all.deb を展開する準備をしています ...
ssl-cert (1.0.35) を展開しています...
man-db (2.7.0.2-5) のトリガを処理しています ...
systemd (215-17+deb8u4) のトリガを処理しています ...
libapr1:armhf (1.5.1-3) を設定しています ...
libaprutil1:armhf (1.5.4-1) を設定しています ...
libaprutil1-dbd-sqlite3:armhf (1.5.4-1) を設定しています ...
libaprutil1-ldap:armhf (1.5.4-1) を設定しています ...
liblua5.1-0:armhf (5.1.5-7.1) を設定しています ...
apache2-bin (2.4.10-10+deb8u4) を設定しています ...
apache2-utils (2.4.10-10+deb8u4) を設定しています ...
apache2-data (2.4.10-10+deb8u4) を設定しています ...
apache2 (2.4.10-10+deb8u4) を設定しています ...
Enabling module mpm_event.
Enabling module authz_core.
Enabling module authz_host.
Enabling module authn_core.
Enabling module auth_basic.
Enabling module access_compat.
Enabling module authn_file.
Enabling module authz_user.
Enabling module alias.
Enabling module dir.
Enabling module autoindex.
Enabling module env.
Enabling module mime.
Enabling module negotiation.
Enabling module setenvif.
Enabling module filter.
Enabling module deflate.
Enabling module status.
Enabling conf charset.
Enabling conf localized-error-pages.
Enabling conf other-vhosts-access-log.
Enabling conf security.
Enabling conf serve-cgi-bin.
Enabling site 000-default.
ssl-cert (1.0.35) を設定しています ...
libc-bin (2.19-18+deb8u4) のトリガを処理しています ...
systemd (215-17+deb8u4) のトリガを処理しています ...
ujpadmin@commet:~ $
インストールしたパッケージのファイル一覧から,設定ファイルのある場所を調べる.
ujpadmin@commet:~ $ dpkg -L apache2|grep apache2.conf
/etc/apache2/conf-enabled
/etc/apache2/apache2.conf
/etc/apache2/conf-available
/etc/apache2/conf-available/security.conf
/etc/apache2/conf-available/localized-error-pages.conf
/etc/apache2/conf-available/serve-cgi-bin.conf
/etc/apache2/conf-available/charset.conf
/etc/apache2/conf-available/other-vhosts-access-log.conf
ujpadmin@commet:~ $
ujpadmin@commet:~ $ dpkg -L apache2|grep apachectl
/usr/share/man/man8/apachectl.8.gz
/usr/sbin/apachectl
ujpadmin@commet:~ $
ujpadmin@commet:~ $ /usr/sbin/apachectl configtest
AH00558: apache2: Could not reliably determine the server's fully qualified
domain name, using 192.168.20.141. Set the 'ServerName' directive globally to suppress this message
Syntax OK
ujpadmin@commet:~ $
ujpadmin@commet:~ $ grep ServerName /etc/apache2/apache2.conf
ujpadmin@commet:~ $
ujpadmin@commet:~ $ su
パスワード:
root@commet:/home/ujpadmin# echo "ServerName commet" >> /etc/apache2/apache2.conf
root@commet:/home/ujpadmin# grep ServerName /etc/apache2/apache2.conf
ServerName commet
root@commet:/home/ujpadmin#
root@commet:/home/ujpadmin# /usr/sbin/apachectl configtest
Syntax OK
root@commet:/home/ujpadmin#
root@commet:/home/ujpadmin# /usr/sbin/apachectl start
root@commet:/home/ujpadmin#
root@commet:/home/ujpadmin# ps -ef|grep httpd
root 2871 2796 0 02:29 pts/0 00:00:00 grep httpd
root@commet:/home/ujpadmin#

これで終了.