
Arch LinuxがインストールされたRaspberry Pi B +があり、起動時にApache Webサーバーが起動しません。
[xxx@rpi ~]# systemctl status -l httpd
* httpd.service - Apache Web Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 1970-01-01 01:00:23 CET; 45 years 0 months ago
Process: 177 ExecStart=/usr/bin/apachectl start (code=exited, status=134)
Jan 01 01:00:23 rpi apachectl[177]: Assertion 'canonical' failed at src/nss-myhostname/nss-myhostname.c:204, function fill_in_hostent(). Aborting.
Jan 01 01:00:23 rpi apachectl[177]: /usr/bin/apachectl: line 79: 185 Aborted (core dumped) $HTTPD -k $ARGV
Jan 01 01:00:23 rpi systemd[1]: httpd.service: control process exited, code=exited status=134
Jan 01 01:00:23 rpi systemd[1]: Failed to start Apache Web Server.
Jan 01 01:00:23 rpi systemd[1]: Unit httpd.service entered failed state.
Jan 01 01:00:23 rpi systemd[1]: httpd.service failed.
Jan 01 01:00:24 rpi systemd-coredump[208]: Process 185 (httpd) of user 0 dumped core.
[xxx@rpi ~]#
ただし、SSH端末でApacheを再起動すると(システムを再起動してSSHログイン後)、Apacheは正常に実行されます。
[xxx@rpi ~]# systemctl restart httpd && systemctl status -l httpd
* httpd.service - Apache Web Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2015-01-05 02:48:46 CET; 336ms ago
Process: 420 ExecStart=/usr/bin/apachectl start (code=exited, status=0/SUCCESS)
Main PID: 424 (httpd)
CGroup: /system.slice/httpd.service
|-424 /usr/bin/httpd -k start
|-426 /usr/bin/httpd -k start
|-427 /usr/bin/httpd -k start
|-428 /usr/bin/httpd -k start
|-429 /usr/bin/httpd -k start
`-430 /usr/bin/httpd -k start
Jan 05 02:48:44 rpi apachectl[420]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 192.168.0.154. Set the 'ServerName' directive globally to suppress this message
Jan 05 02:48:45 rpi systemd[1]: PID file /run/httpd/httpd.pid not readable (yet?) after start.
Jan 05 02:48:46 rpi systemd[1]: Started Apache Web Server.
[xxx@rpi ~]#
何が起こりましたか(Linux octopustest 3.12.35-1-ARCH #1 PREEMPT Tue Dec 23 07:14:51 MST 2014 armv6l GNU/Linux
カーネルと実行中Apache/2.4.10
)?
答え1
私に役立つ非常に簡単な修正があります。 / etc / hostsファイルを編集する必要がありますが、可能であれば常に避ける必要がありますが、私が持っているすべての問題を解決しました。このエラーは、Apache、Eclipse、その他のアプリケーションなど、プログラムがインターネットにアクセスして情報を取得しようとした場合に発生します。これはアプリケーション自体のバグによって発生することがありますが、/ etc / hostsファイルにプログラムに必要な特定の要素が欠落しているために発生するローカルの問題かもしれません。
sudoers
これらの手順のいくつかを完了するには、管理者アクセス権が必要か、このグループに属している必要があります。
まず、次のコマンドを使用してホストファイルを開きます。sudo nano /etc/hosts
。ホストファイルは次のようにする必要があります。これは私のファイルの直接コピーです。
#
# /etc/hosts: static lookup table for host names
#
#<ip-address> <hostname.domain.org> <hostname>
127.0.0.1 localhost.localdomain localhost BEN-PC-ARCH
::1 localhost.localdomain localhost BEN-PC-ARCH
# End of file
localhost.localdomainに127.0.0.1を反映していることを除いて、同じことを行う2行目があります。理由が何であれ、/etc/hosts
ファイルに追加すると問題が解決します。