らずぱい日記

定年したので日記でもかくか。って感じ

apache入らんがな

■apache2がインストールできない。

httpサーバはファイルアクセスの窓口として使うつもりがインストールできない。

いろいろ試して2度ほど環境が壊れてしもた。

やったことをメモしておこう。

 

$sudo apt update
$sudo apt upgrade

ファイアウォールの調整
$sudo ufw app list
  Available applications:
  Apache ※1
  Apache Full ※2
  Apache Secure ※3
  OpenSSH
  Samba

※1 Apache: WWW、ポート80 のみを聞く
※2 Apache Full: このプロファイルは、ポート80とポート443の両方を開く
※3 Apache Secure: このプロファイルは、ポート443 のみを聞く

今回は80と443両方だな。

$sudo ufw allow 'Apache Full'

$sudo ufw enable

$ sudo ufw status
Status: active
To      Action    From
--      ------     ----
Apache    ALLOW    Anywhere
Apache Full  ALLOW    Anywhere
OpenSSH   ALLOW    Anywhere
Samba    ALLOW    Anywhere
Apache (v6)  ALLOW    Anywhere (v6)
Apache Full (v6) ALLOW   Anywhere (v6)
OpenSSH (v6)  ALLOW   Anywhere (v6)
Samba (v6)   ALLOW   Anywhere (v6)

■apache2のインストール
$sudo apt install apache2
Do you want to continue? [Y/n] Y

ここでエラーで入らない。

Setting up apache2 (2.4.46-1ubuntu1) ...
Can't locate if.pm in @INC (you may need to install the if module) (@INC contains: /etc/perl /usr/local/lib/aarch64-linux-gnu/perl/5.30.3 /usr/local/share/perl/5.30.3 /usr/lib/aarch64-linux-gnu/perl5/5.30 /usr/share/perl5 /usr/lib/aarch64-linux-gnu/perl-base /usr/lib/aarch64-linux-gnu/perl/5.30 /usr/share/perl/5.30 /usr/local/lib/site_perl) at /usr/sbin/a2enmod line 15.
BEGIN failed--compilation aborted at /usr/sbin/a2enmod line 15.
dpkg: error processing package apache2 (--configure):
installed apache2 package post-installation script subprocess returned error exit status 2
Processing triggers for ufw (0.36-7) ...
Rules updated for profile 'Apache'
Rules updated for profile 'Apache Full'
Rules updated for profile 'OpenSSH'
Rules updated for profile 'Samba'
Skipped reloading firewall
Processing triggers for systemd (246.6-1ubuntu1.1) ...
Processing triggers for man-db (2.9.3-2) ...
Processing triggers for libc-bin (2.32-0ubuntu3) ...
Errors were encountered while processing:
apache2
E: Sub-process /usr/bin/dpkg returned an error code (1)Setting up apache2 (2.4.46-1ubuntu1) ...
Can't locate if.pm in @INC (you may need to install the if module) (@INC contains: /etc/perl /usr/local/lib/aarch64-linux-gnu/perl/5.30.3 /usr/local/share/perl/5.30.3 /usr/lib/aarch64-linux-gnu/perl5/5.30 /usr/share/perl5 /usr/lib/aarch64-linux-gnu/perl-base /usr/lib/aarch64-linux-gnu/perl/5.30 /usr/share/perl/5.30 /usr/local/lib/site_perl) at /usr/sbin/a2enmod line 15.
BEGIN failed--compilation aborted at /usr/sbin/a2enmod line 15.
dpkg: error processing package apache2 (--configure):
installed apache2 package post-installation script subprocess returned error exit status 2
Processing triggers for ufw (0.36-7) ...
Rules updated for profile 'Apache'
Rules updated for profile 'Apache Full'
Rules updated for profile 'OpenSSH'
Rules updated for profile 'Samba'
Skipped reloading firewall
Processing triggers for systemd (246.6-1ubuntu1.1) ...
Processing triggers for man-db (2.9.3-2) ...
Processing triggers for libc-bin (2.32-0ubuntu3) ...
Errors were encountered while processing:
apache2
E: Sub-process /usr/bin/dpkg returned an error code (1)

perlとかに問題あるの・・・?

/usr/sbin/a2enmod line 15.って。。。

なにやらa2enmodがperl使ってるな?今回は深追いするの疲れたので
ペンディングにするわ。うまくいったら続きを。。。

 a2enmod  は、apache2構成内で指定されたモジュールを有効にするスクリプトです。
これは、/ etc / apache2 / mods-enabled内にシンボリックリンクを作成することに
よって行われます。
同様に、a2dismodこれらのシンボリックリンクを削除して、モジュールを無効にします。
モジュールを有効にすることはエラーではありません。
はすでに有効になっている、またはすでに無効になっているものを無効にする。
多くのモジュールには、.loadファイルに加えて、関連する.confファイルがあることに注意してください。
モジュールを有効にすると、構成ディレクティブが.confファイルにディレクティブとして配置されます。

いったん削除しておこう

$ sudo apt remove apache2
$ sudo apt autoremove
$ cd /var/lib/dpkg/info
$ ls apache*
apache2.list apache2.postrm

$sudo mv apache* /tmp
$ sudo dpkg --configure -a

 ※これって綺麗に消えてるのかな?

 2回目インストールしても設定ファイルとかが入らないのだが。。

 

ちなみに設定しようと思っているメモは残しておこう。

httpd.conf

oresamaにアクセスするとIDとパスワードを聞いてくる

oresama以下のシンボリックリンクもアクセスできるようにする
 これでNASサーバのファイルをブラウザ経由でアクセスできるので。。

<Directory "/var/www/html/oresama/">
   AllowOverride None
   Order allow,deny
   Allow from all
   Options FollowSymlinks
   Options Indexes FollowSymLinks
   IndexOptions +FancyIndexing +NameWidth=* +Charset=UTF-8
   AuthType Basic
   AuthName "erina Please input ID & Password"
   AuthUserFile /var/www/.htpasswd
   AuthGroupFile /dev/null
<Limit GET POST>
   require valid-user
</Limit>
</Directory>

 

apache2インストールの解決方法を探すか。。