サーバー設定 · 3 min read · Jan 04, 2026
CentOS 5.1 における Virtualmin を使用した仮想ホスティングの手順 - ページ 2
サービスを無効にする
セキュリティを強化し、システムリソースを解放するために、必要のないサービスを無効にする必要があります。このスクリプトを実行して、これを行うことができます。
- acpid
- anacron
- apmd
- autofs
- bluetooth
- cups
- firstboot
- gpm
- haldaemon
- messagebus
- mdmonitor
- hidd
- ip6tables
- kudzu
- lvm2-monitor
- netfs
- nfslock
- pcscd
- portmap
- rpcgssd
- rpcidmapd
- sendmail
- smartd
- yum-updatesd
基本
システムを構成するために、いくつかの問題を修正する必要があります。
- 更新をインストールする
yum upgrade- mta を postfix に切り替える
alternatives --config mta2 つのプログラムが 'mta' を提供しています。
選択 コマンド
-----------------------------------------------
1 /usr/sbin/sendmail.postfix
*+ 2 /usr/sbin/sendmail.sendmail
現在の選択を保持するには Enter を押すか、選択番号を入力してください: 1- caching-nameserver 設定をインストールする:
yum install caching-nameserver- ビルドツールをインストールする:
yum install gcc cpp gcc-c++ automake automake14 automake15 automake16 automake17 openssl-devel subversion ncurses-devel -yネットワークエイリアスを構成する
cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0:1ファイル /etc/sysconfig/network-scripts/ifcfg-eth0:1 を次のように修正します:
DEVICE=eth0:1
BOOTPROTO=static
BROADCAST=192.168.1.255
IPADDR=192.168.1.6
NETMASK=255.255.255.0
NETWORK=192.168.1.0
ONBOOT=yes
Webmin / Virtualmin をインストールする
- webmin pgp キーをインポートする:
wget http://www.webmin.com/jcameron-key.asc
rpm --import jcameron-key.asc- rpm をダウンロードする:
wget http://prdownloads.sourceforge.net/webadmin/webmin-1.390-1.noarch.rpm- rpm を検証する(OK と表示されるべき、そうでなければ再度ダウンロードする):
rpm --checksig webmin-1.390-1.noarch.rpm- rpm をインストールする:
rpm -Uvh webmin-1.390-1.noarch.rpm初期 Webmin 設定
/etc/webmin/miniserv.conf を編集して Webmin を保護し、次の変更を行う必要があります:
- SSL のみを使用:
ssl=1
- ポートを 443 に変更し、2 番目の NIC のみバインドする:
port=443
bind=192.168.1.6
- UDP ブロードキャストを無効にする:
#listen=10000
- ログイン失敗時のホストロックアウトを 3 に変更:
blockhost_failures=3
- ホストロックアウトのタイムアウトを 120 に増加:
blockhost_time=120
- ログイン失敗時のユーザーロックアウトを 3 に変更:
blockuser_failures=3
- ユーザーロックアウトのタイムアウトを 120 に変更:
blockuser_time=120
- レルムを別のものに変更:
realm=cpanel
- ログインを utmp に記録:
utmp=1
Webmin Tiger テーマをインストールする:
- https://192.168.1.5:10000 から root とパスワードを使用して Webmin にログインします。
- Webmin ? 設定 ? Webmin テーマに移動します。
- FTP または HTTP URL から選択し、http://www.stress-free.co.nz/files/theme-stressfree.tar.gz を入力します。
- テーマをインストールをクリックします。
- テーマリストに戻るをクリックします。
- 現在のテーマとして StressFree を選択し、変更をクリックします。
php-pear モジュールをインストールする:
- Webmin ? Webmin 設定 ? Webmin モジュールに移動します。
- サードパーティモジュールを選択し、http://www.webmin.com/download/modules/php-pear.wbm.gz を入力します。
- モジュールをインストールをクリックします。
Virtualmin をインストールする:
- Webmin ? Webmin 設定 ? Webmin モジュールに移動します。
- FTP または HTTP URL からインストールを選択し、http://download.webmin.com/download/virtualmin/virtual-server-3.51.gpl.wbm.gz を入力します。
- モジュールをインストールをクリックします。
不要なモジュールを削除する Webmin ? Webmin 設定 ? 削除に移動し、次のものを選択します:
- ADSL クライアント
- Bacula バックアップシステム
- CD バーナー
- CVS サーバー
- クラスター パスワード変更
- クラスター ファイルコピー
- クラスター cron ジョブ
- クラスター シェルコマンド
- クラスター ソフトウェアパッケージ
- クラスター usermin サーバー
- クラスター ユーザーとグループ
- クラスター webmin サーバー
- コマンドシェル
- 設定エンジン
- カスタムコマンド
- DHCP サーバー
- Fetchmail メール取得
- ファイルマネージャー
- Frox ftp プロキシ
- HTTP トンネル
- ハートビートモニター
- IPsec VPN
- Jabber IM サーバー
- LDAP サーバー
- 論理ボリューム管理
- Majordomo リストマネージャー
- NFS エクスポート
- NIS クライアントとサーバー
- OpenSLP サーバー
- PPP ダイヤルインサーバー
- PPP ダイヤルアップクライアント
- PPTP vpn サーバー
- PPTP vpn クライアント
- Postgresql データベースサーバー
- プリンタ管理
- ProFTPD サーバー
- QMAIL メールサーバー
- SMART ドライブステータス
- SSH / Telnet ログイン
- SSL トンネル
- SAMBA Windows ファイル共有
- スケジュールされたコマンド
- Sendmail メールサーバー
- Shoreline ファイアウォール
- Squid 分析レポート生成器
- Squid プロキシサーバー
- ボイスメールサーバー
- WU-FTP サーバー
- Idmapd サーバー
Webmin を再起動する:
service webmin restartRpmforge リポジトリを構成する
rpm -Uhv http://packages.sw.be/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm注: 異なるアーキテクチャを使用している場合は、正しい rpm を確認するために https://rpmrepo.org/RPMforge/Using を確認してください
- リポジトリを無効にする(基本パッケージが上書きされないように) /etc/yum.d/rpmforge.repo を編集し、次のオプションを設定します:
enabled = 0
追加の必要なパッケージをインストールする
- clamav をインストールする:
yum --enablerepo=rpmforge install clamav clamav-db clamav-milter clamd -y
wget http://www.topdog-software.com/files/clamav-milter.patch
patch /etc/init.d/clamav-milter < clamav-milter.patch
chkconfig --del clamd
freshclam- sanesecurity シグネチャをインストールする:
wget http://www.sanesecurity.co.uk/clamav/update_sanesecurity.txt -O /usr/local/bin/update_sanesecurity.sh
chmod +x /usr/local/bin/update_sanesecurity.sh
ln -s /usr/local/bin/update_sanesecurity.sh /etc/cron.hourly/
/usr/local/bin/update_sanesecurity.sh- PHP eaccelerator をインストールする:
yum --enablerepo=rpmforge install php-eaccelerator- rpmforge から新しい spamassassin パッケージをインストールする:
yum --enablerepo=rpmforge upgrade spamassassin- spamass-milter をインストールする:
yum --enablerepo=rpmforge install spamass-milter- spamassassin に必要な perl モジュールをインストールする:
perl -MCPAN -e 'install Mail::SPF'
perl -MCPAN -e 'install Mail::SPF::Query'
perl -MCPAN -e 'install Net::Ident'
perl -MCPAN -e 'install IP::Country::Fast'
perl -MCPAN -e 'install Mail::DomainKeys'
perl -MCPAN -e 'install Mail::DKIM'- fuzzyOCR をインストールする:
yum --enablerepo=rpmforge install netpbm-progs ocrad gocr gifsicle giflib-utils giflib -y
svn co https://svn.own-hero.net/fuzzyocr/trunk/devel/
cd devel/
perl -MCPAN -e 'install String::Approx'
perl -MCPAN -e 'install Time::HiRes'
perl -MCPAN -e 'install Log::Agent'
cp -rv {FuzzyOcr.cf,FuzzyOcr.scansets,FuzzyOcr.preps,FuzzyOcr.pm,FuzzyOcr.words,FuzzyOcr/} /etc/mail/spamassassin
chcon -R system_u:object_r:etc_mail_t /etc/mail/spamassassin/{FuzzyOcr.cf,FuzzyOcr.scansets,FuzzyOcr.preps,FuzzyOcr.pm,FuzzyOcr.words,FuzzyOcr/}
wget http://www.gbnetwork.co.uk/mailscanner/FuzzyOcr.words -O /etc/mail/spamassassin/FuzzyOcr.words- Razor をインストールする:
yum --enablerepo=rpmforge install razor-agents -y- roundcube をインストールする:
yum install php-imap
rpm -Uvh http://www.topdog-software.com/oss/roundcube/roundcube-0.1-rc2.noarch.rpm- imapproxy をインストールする:
wget http://imapproxy.org/downloads/up-imapproxy-1.2.6.tar.gz
rpmbuild -tb up-imapproxy-1.2.6.tar.gz
rpm -Uvh /usr/src/redhat/RPMS/i386/up-imapproxy-1.2.6-1.i386.rpm- サービスを有効にする:
chkconfig --level 345 httpd on
chkconfig --level 345 postfix on
chkconfig --level 345 spamassassin on
chkconfig --level 345 spamass-milter on
chkconfig --level 345 clamav-milter on
chkconfig --level 345 mysqld on
chkconfig --level 345 named on
chkconfig --level 345 vsftpd on
chkconfig --level 345 dovecot on
chkconfig --level 345 imapproxy on新しい投稿を受信箱で受け取る
スパムはありません。いつでも購読を解除できます。