超便利なWebminなのですが最新版が意外に使い勝手がいいのでAWSのものも最新版にしようとコントロールパネルからアップデートをしてもエラーになるので一旦削除してからインストールしなおしてみる。
1)まずはアンインストール
ubuntu@ip-:~$ sudo /etc/webmin/uninstall.sh Are you sure you want to uninstall Webmin? (y/n) : y Removing Webmin package .. (Reading database ... 176675 files and directories currently installed.) Removing webmin (1.955) ... Done!
これでアンインストールできる。
で、webmin.comから最新版をDLする
ダウンロードしたらサーバにwinSCPでアップロード。で、インストール
root@ip-:~# dpkg -i /home/ubuntu/data/webmin_1.955_all.deb (Reading database ... 118656 files and directories currently installed.) Preparing to unpack .../data/webmin_1.955_all.deb ... Port 10000 is already in use dpkg: error processing archive /home/ubuntu/data/webmin_1.955_all.deb (--install): new webmin package pre-installation script subprocess returned error exit status 2 Errors were encountered while processing: /home/ubuntu/data/webmin_1.955_all.deb
10000ポートが使われているのでインストールできないって。
なので何が使っているんか見てみる。
root@ip-:~# lsof -i -P | grep "LISTEN" .. miniserv. 1255 root 5u IPv4 21215 0t0 TCP *:10000 (LISTEN) ..
pid:1255が使っているみたいなので終わらせる
root@ip-:~# kill 1255
で、10000が使われてないのを確認してインストールする。
root@ip-:~# dpkg -i /home/ubuntu/data/webmin_1.955_all.deb (Reading database ... 118656 files and directories currently installed.) Preparing to unpack .../data/webmin_1.955_all.deb ... Unpacking webmin (1.955) ... dpkg: dependency problems prevent configuration of webmin: webmin depends on unzip; however: Package unzip is not installed. dpkg: error processing package webmin (--install): dependency problems - leaving unconfigured Processing triggers for systemd (237-3ubuntu10.19) ... Processing triggers for ureadahead (0.100.0-20) ... Errors were encountered while processing: webmin
こんどはunzipが必要なのにないと。
なのでunzipをaptでインストールしてみる。
root@ip-:~# apt-get install zip Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package zip
インストールできない。なのでunzipもダウンロードして手動でインストールする。
で、WinSCPでサーバに転送する。
で、unzipをインストール。
root@ip-:~# dpkg -i /home/ubuntu/data/unzip_6.0-25ubuntu1_amd64.deb Selecting previously unselected package unzip. (Reading database ... 176678 files and directories currently installed.) Preparing to unpack .../unzip_6.0-25ubuntu1_amd64.deb ... Unpacking unzip (6.0-25ubuntu1) ... Setting up unzip (6.0-25ubuntu1) ... Processing triggers for mime-support (3.60ubuntu1) ... Processing triggers for man-db (2.8.3-2) ...
で、再度チャレンジ
そしたらapt-show-versionsがおかしいと
The following packages are only half configured, probably due to problems configuring them the first time. The configuration should be retried using dpkg --configure <package> or the configure menu option in dselect: apt-show-versions lists available package versions with distribution
なので修正「/var/lib/dpkg/info」の中にある
apt-show-versions.postinst apt-show-versions.prerm
の2つを削除
root@ip-:/var/lib/dpkg/info# rm apt-show-versions.postinst root@ip-:/var/lib/dpkg/info# rm apt-show-versions.prerm
で再構築
root@ip-:/var/lib/dpkg/info# dpkg --configure apt-show-versions Setting up apt-show-versions (0.22.7ubuntu1) ...
これでapt-show-versionsは解決。ではあらためてWebminインストール
root@ip-:~# dpkg -i /home/ubuntu/data/webmin_1.955_all.deb (Reading database ... 176696 files and directories currently installed.) Preparing to unpack .../data/webmin_1.955_all.deb ... Unpacking webmin (1.955) over (1.955) ... Setting up webmin (1.955) ... Installing new version of config file /etc/init.d/webmin ... /var/lib/dpkg/info/webmin.postinst: 4: /var/lib/dpkg/info/webmin.postinst: cannot create /etc/webmin/stop: Directory nonexistent Webmin install complete. You can now login to https://ip-172-31-39-46:10000/ as root with your root password, or as any user who can use sudo to run commands as root. Processing triggers for systemd (237-3ubuntu10.19) ... Processing triggers for ureadahead (0.100.0-20) ...
インストールできました。
で、設定しないとアクセスできません。
ubuntu@ip-:~$ sudo vi /etc/webmin/miniserv.conf port=10000 root=/usr/share/webmin mimetypes=/usr/share/webmin/mime.types addtype_cgi=internal/cgi realm=Webmin Server logfile=/var/webmin/miniserv.log errorlog=/var/webmin/miniserv.error pidfile=/var/webmin/miniserv.pid logtime=168 ssl=0 no_ssl2=1
ssl=1をssl=0へすればOK
そしたらWebminを再起動
root@ip-:/var/lib/dpkg/info# systemctl restart webmin