サーバー設定 · 3 min read · Jan 16, 2026
完璧なサーバー - Fedora 10 [ISPConfig 3] - ページ 5
14 MySQLのパスワードを設定し、phpMyAdminを構成する
MySQLを起動します:
chkconfig --levels 235 mysqld on
/etc/init.d/mysqld start次に、MySQLのrootアカウントのパスワードを設定します:
mysqladmin -u root password yourrootsqlpassword
mysqladmin -h server1.example.com -u root password yourrootsqlpassword最後のコマンドがエラーを返した場合…
[root@server1 i386]# mysqladmin -h server1.example.com -u root password howtoforge
mysqladmin: connect to server at 'server1.example.com' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
[root@server1 i386]#…次のようにしてパスワードを設定できます: MySQLに接続します:
mysql -u root -pMySQLのrootユーザーのパスワードを入力します。その後、MySQLシェルで次のようにします:
mysql> USE mysql;mysql> UPDATE user SET Password = password('yourrootsqlpassword') WHERE Host = 'server1.example.com' AND User = 'root';mysql> UPDATE user SET Password = password('yourrootsqlpassword') WHERE Host = '127.0.0.1' AND User = 'root';実行します
mysql> SELECT * FROM user;すべての行でユーザーがrootであることを確認し、パスワードが設定されていることを確認します。
すべてが正常に見える場合は、実行します
mysql> FLUSH PRIVILEGES;…そしてMySQLシェルを終了します:
mysql> quit;次に、phpMyAdminを構成します。phpMyAdminがlocalhostからの接続だけでなく、他の接続も許可するようにApacheの設定を変更します(
vi /etc/httpd/conf.d/phpMyAdmin.conf| # phpMyAdmin - Web based MySQL browser written in php # # Allows only localhost by default # # But allowing phpMyAdmin to anyone other than localhost should be considered # dangerous unless properly secured by SSL Alias /phpMyAdmin /usr/share/phpMyAdmin Alias /phpmyadmin /usr/share/phpMyAdmin # |
次に、Apacheのシステム起動リンクを作成し、起動します:
chkconfig --levels 235 httpd on
/etc/init.d/httpd startこれで、ブラウザをhttp://server1.example.com/phpmyadmin/またはhttp://192.168.0.100/phpmyadmin/に向け、ユーザー名rootと新しいroot MySQLパスワードでログインできます。
15 Amavisd-new、SpamAssassin、およびClamAVをインストールする
amavisd-new、spamassassin、およびclamavをインストールするには、次のコマンドを実行します:
yum install amavisd-new spamassassin clamav clamav-data clamav-server clamav-update unzip bzip2 perl-DBD-mysqlClamAVをインストールすると、3時間ごとにClamAVウイルスデータベースを更新しようとするcronジョブがインストールされます。しかし、これは/etc/sysconfig/freshclamおよび/etc/freshclam.confで有効にする必要があります:
vi /etc/sysconfig/freshclam最後のFRESHCLAM_DELAY行をコメントアウトします:
| ## When changing the periodicity of freshclam runs in the crontab, ## this value must be adjusted also. Its value is the timespan between ## two subsequent freshclam runs in minutes. E.g. for the default ## ## | 0 */3 * * * ... ## ## crontab line, the value is 180 (minutes). # FRESHCLAM_MOD= ## A predefined value for the delay in seconds. By default, the value is ## calculated by the 'hostid' program. This predefined value guarantees ## constant timespans of 3 hours between two subsequent freshclam runs. ## ## This option accepts two special values: ## 'disabled-warn' ... disables the automatic freshclam update and ## gives out a warning ## 'disabled' ... disables the automatic freshclam silently # FRESHCLAM_DELAY= ### !!!!! REMOVE ME !!!!!! ### REMOVE ME: By default, the freshclam update is disabled to avoid ### REMOVE ME: network access without prior activation #FRESHCLAM_DELAY=disabled-warn # REMOVE ME |
vi /etc/freshclam.confExample行をコメントアウトします:
| [...] # Comment or remove the line below. #Example [...] |
次に、freshclam、amavisd、およびclamdを起動します…
chkconfig --levels 235 amavisd on
chkconfig --levels 235 clamd.amavisd on
/usr/bin/freshclam
/etc/init.d/amavisd start
/etc/init.d/clamd.amavisd start…そして、いくつかのディレクトリの所有権を変更します:
chown amavis /var/run/amavisd /var/spool/amavisd /var/spool/amavisd/tmp /var/spool/amavisd/db16 mod_php、mod_fcgi/PHP5、およびsuPHPを使用したApache2のインストール
ISPConfig 3では、mod_php、mod_fcgi/PHP5、cgi/PHP5、およびsuPHPをウェブサイトごとに使用できます。
mod_php5、mod_fcgid、およびPHP5を使用してApache2をインストールするには、次のようにします:
yum install php php-devel php-gd php-imap php-ldap php-mysql php-odbc php-pear php-xml php-xmlrpc php-eaccelerator php-mbstring php-mcrypt php-mhash php-mssql php-snmp php-soap php-tidy curl curl-devel perl-libwww-perl ImageMagick libxml2 libxml2-devel mod_fcgid php-cli httpd-devel 次に、/etc/php.iniを開きます…
vi /etc/php.ini…エラーレポートを変更し(通知が表示されないように)、ファイルの最後にcgi.fix_pathinfo = 1を追加します:
| [...] ;error_reporting = E_ALL error_reporting = E_ALL & ~E_NOTICE [...] cgi.fix_pathinfo = 1 |
次に、suPHPをインストールします:
cd /tmp
wget http://www.suphp.org/download/suphp-0.7.0.tar.gz
tar xvfz suphp-0.7.0.tar.gz
cd suphp-0.7.0/
./configure --prefix=/usr --sysconfdir=/etc --with-apr=/usr/bin/apr-1-config --with-apxs=/usr/sbin/apxs --with-apache-user=apache --with-setid-mode=owner --with-php=/usr/bin/php-cgi --with-logfile=/var/log/httpd/suphp_log --enable-SUPHP_USE_USERGROUP=yes
make
make install次に、suPHPモジュールをApacheの設定に追加します…
vi /etc/httpd/conf.d/suphp.conf| LoadModule suphp_module modules/mod_suphp.so |
…そして、/etc/suphp.confというファイルを次のように作成します:
vi /etc/suphp.conf| [global] ;Path to logfile logfile=/var/log/httpd/suphp.log ;Loglevel loglevel=info ;User Apache is running as webserver_user=apache ;Path all scripts have to be in docroot=/ ;Path to chroot() to before executing script ;chroot=/mychroot ; Security options allow_file_group_writeable=true allow_file_others_writeable=false allow_directory_group_writeable=true allow_directory_others_writeable=false ;Check wheter script is within DOCUMENT_ROOT check_vhost_docroot=true ;Send minor error messages to browser errors_to_browser=false ;PATH environment variable env_path=/bin:/usr/bin ;Umask to set, specify in octal notation umask=0077 ; Minimum UID min_uid=100 ; Minimum GID min_gid=100 [handlers] ;Handler for php-scripts x-httpd-suphp="php:/usr/bin/php-cgi" ;Handler for CGI-scripts x-suphp-cgi="execute:!self" |
最後に、Apacheを再起動します:
/etc/init.d/httpd restart17 PureFTPdをインストールする
PureFTPdは次のコマンドでインストールできます:
yum install pure-ftpd次に、システム起動リンクを作成し、PureFTPdを起動します:
chkconfig --levels 235 pure-ftpd on
/etc/init.d/pure-ftpd start18 MyDNSをインストールする
MyDNSは次のようにインストールできます:
wget http://mydns.bboy.net/download/mydns-mysql-1.1.0-1.i386.rpm
rpm -ivh mydns-mysql-1.1.0-1.i386.rpmシステムが起動するとき、MyDNSはMySQLの後に起動する必要があります。MySQLの起動リンクはFedora 10で優先度64を持っているため、MyDNSの起動リンクは65から99の間の優先度を持つ必要があります。したがって、MyDNSのinitスクリプトを開きます…
vi /etc/init.d/mydns…そして変更します
| [...] # chkconfig: 345 52 50 [...] |
次のように
| [...] # chkconfig: 345 65 50 [...] |
次に、起動リンクを作成します:
chkconfig --levels 235 mydns on今はMyDNSを起動しません。最初に構成する必要があります - これは後でISPConfig 3インストーラーによって自動的に行われます。
19 VloggerとWebalizerをインストールする
Vloggerとwebalizerは次のようにインストールできます:
yum install webalizer perl-DateTime-Format-HTTP perl-DateTime-Format-Buildercd /tmp
wget http://n0rp.chemlab.org/vlogger/vlogger-1.3.tar.gz
tar xvfz vlogger-1.3.tar.gz
mv vlogger-1.3/vlogger /usr/sbin/
rm -rf vlogger*新しい投稿を受信箱で受け取る
スパムはありません。いつでも購読を解除できます。