Table of Contents
1 webminのインストール
webminのリポジトリを追加します。
> sudo su -c ‘cat <<EOF > /etc/zypp/repos.d/webmin.repo[Webmin]name=Webmin Distribution Neutral#baseurl=http://download.webmin.com/download/yummirrorlist=http://download.webmin.com/download/yum/mirrorlistenabled=1EOF’> wget -q ; sudo rpm –import jcameron-key.asc
webminをインストールします。
> sudo zypper -n in webmin> sudo systemctl enable webmin
10000/tcpを開放します。
> firewall_open_tcp(){ for t in FW_SERVICES_EXT_TCP FW_SERVICES_DMZ_TCP FW_SERVICES_INT_TCP; do sudo sed -e “s/^${t}=”(.*)”/${t}=”1 $1″/g” -i /etc/sysconfig/SuSEfirewall2 done sudo systemctl restart SuSEfirewall2}> firewall_open_tcp 10000
rootユーザのパスワードを設定します。
> ROOT_PASSWD=password> sudo /usr/libexec/webmin/changepass.pl /etc/webmin root ${ROOT_PASSWORD}
マシンを再起動します。
> sudo reboot
1.1 ポートの変更
ポートを変更するには/etc/webmin/miniserv.confのportとlistenを変更して、sudo systemctl restart webminを実行します。
> sudo sed -e ‘s/^port=.*/port=10002/g’ -e ‘s/^listen=.*/listen=10002/g’ -i /etc/webmin/miniserv.conf> sudo systemctl restart webmin
2 webminへアクセス
httpsで10000/tcpへアクセスします。
https://<server>:10000
webminはhttpsを利用する一方、当然ブラウザには証明書がインポートされていません。一度例外としてアクセスすることで解消されます。
Chromeの場合はADVANCEDを表示させて”Proceed to xxx”をクリックします。
rootユーザとしてログインします。
ダッシュボードが表示されます。
3 webminをインストールするスクリプト
以下のスクリプトでwebminをインストールできます。rootのパスワードはpasswordです。
#!/bin/shROOT_PASSWORD=”password”TMP=`mktemp -t opensuse-setup-webmin.sh.XXXXXX`trap “rm $TMP* 2>/dev/null” 0sudo su -c ‘cat <<EOF > /etc/zypp/repos.d/webmin.repo[Webmin]name=Webmin Distribution Neutral#baseurl=http://download.webmin.com/download/yummirrorlist=http://download.webmin.com/download/yum/mirrorlistenabled=1EOF’wget -q http://www.webmin.com/jcameron-key.asc -O ${TMP}sudo rpm –import ${TMP}sudo zypper -n in webminsudo /usr/libexec/webmin/changepass.pl /etc/webmin root ${ROOT_PASSWORD}sudo systemctl enable webminfirewall_open_tcp(){ for t in FW_SERVICES_EXT_TCP FW_SERVICES_DMZ_TCP FW_SERVICES_INT_TCP; do sudo sed -e “s/^${t}=”(.*)”/${t}=”1 $1″/g” -i /etc/sysconfig/SuSEfirewall2 done sudo systemctl restart SuSEfirewall2}firewall_open_tcp 10000sudo reboot