サーバー設定 · 2 min read · Dec 04, 2025

完璧なセットアップ - Mandriva 2006 フリーエディション - ページ 5

MySQL (4.1)

*urpmi MySQL MySQL-client libmysql14-devel

    • /etc/init.d/mysqld start*

今、ネットワークが有効になっているか確認します。次のコマンドを実行します。

netstat -tap

次のような行が表示されるはずです:

| tcp 0 0 *:mysql *:* LISTEN 6621/mysqld |

もし表示されない場合は、/etc/sysconfig/mysqldを編集し、変数MYSQLD_OPTIONSから–skip-networkingを削除します:

| # (oe) Remove --skip-networking to enable network access from # non local clients. Access from localhost will still work. MYSQLD_OPTIONS="" # (oe) set TMPDIR and TMP environment variables TMPDIR="${datadir}/.tmp" TMP="${TMPDIR}" |

そしてMySQLサーバーを再起動します:

/etc/init.d/mysqld restart

次のコマンドを実行します。

mysqladmin -u root password yourrootsqlpassword
mysqladmin -h server1.example.com -u root password yourrootsqlpassword

ユーザーrootのパスワードを設定します(そうしないと誰でもあなたのMySQLデータベースにアクセスできてしまいます!)。

Postfix With SMTP-AUTH And TLS

urpmi cyrus-sasl libsasl2 libsasl2-devel libsasl2-plug-plain libsasl2-plug-anonymous libsasl2-plug-crammd5 libsasl2-plug-digestmd5 libsasl2-plug-gssapi libsasl2-plug-login postfix imap

postconf -e ‘smtpd_sasl_local_domain =’
postconf -e ‘smtpd_sasl_auth_enable = yes’
postconf -e ‘smtpd_sasl_security_options = noanonymous’
postconf -e ‘broken_sasl_auth_clients = yes’
postconf -e ‘smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination’
postconf -e ‘inet_interfaces = all’
postconf -e ‘mydomain = example.com’
postconf -e ‘myhostname = server1.$mydomain’
postconf -e ‘mydestination = /etc/postfix/local-host-names, localhost.example.com’

touch /etc/postfix/local-host-names

/etc/postfix/sasl/smtpd.confを編集します。次のようになります:

| # SASL library configuration file for postfix # all parameters are documented into: # /usr/share/doc/cyrus-sasl-2.*/options.html # The mech_list parameters list the sasl mechanisms to use, # default being all mechs found. mech_list: plain login # To authenticate using the separate saslauthd daemon, (e.g. for # system or ldap users). Also see /etc/sysconfig/saslauthd. pwcheck_method: saslauthd saslauthd_path: /var/lib/sasl2/mux # To authenticate against users stored in sasldb. #pwcheck_method: auxprop #auxprop_plugin: sasldb #sasldb_path: /var/lib/sasl2/sasldb2 |

mkdir /etc/postfix/ssl
cd /etc/postfix/ssl/
openssl genrsa -des3 -rand /etc/hosts -out smtpd.key 1024
chmod 600 smtpd.key
openssl req -new -key smtpd.key -out smtpd.csr
openssl x509 -req -days 3650 -in smtpd.csr -signkey smtpd.key -out smtpd.crt
openssl rsa -in smtpd.key -out smtpd.key.unencrypted
mv -f smtpd.key.unencrypted smtpd.key
openssl req -new -x509 -extensions v3_ca -keyout cakey.pem -out cacert.pem -days 3650

postconf -e ‘smtpd_tls_auth_only = no’
postconf -e ‘smtp_use_tls = yes’
postconf -e ‘smtpd_use_tls = yes’
postconf -e ‘smtp_tls_note_starttls_offer = yes’
postconf -e ‘smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key’
postconf -e ‘smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt’
postconf -e ‘smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem’
postconf -e ‘smtpd_tls_loglevel = 1’
postconf -e ‘smtpd_tls_received_header = yes’
postconf -e ‘smtpd_tls_session_cache_timeout = 3600s’
postconf -e ‘tls_random_source = dev:/dev/urandom’

今、Postfix、saslauthd、imap、pop3を起動します:

chkconfig imap on
chkconfig imaps on
chkconfig ipop3 on
chkconfig pop3s on
/etc/init.d/postfix restart
/etc/init.d/saslauthd restart
/etc/init.d/xinetd restart

SMTP-AUTHとTLSが正しく機能しているか確認するために、次のコマンドを実行します:

telnet localhost 25

Postfixメールサーバーへの接続が確立されたら、次のように入力します。

ehlo localhost

次の行が表示される場合:

250-STARTTLS

および

250-AUTH

すべて正常です。

quitと入力してシステムのシェルに戻ります。

Apache2 With PHP5

urpmi apache2-mod_php libphp5_common5 php-bz2 php-calendar php-ctype php-curl php-date_time php-devel php-dio php-dom php-eaccelerator php-enchant php-esmtp php-event php-exif php-fam php-ffmpeg php-fileinfo php-filepro php-ftp php-gd php-gettext php-gmp php-iconv php-id3 php-idn php-imap php-imlib2 php-mailparse php-mbstring php-mcache php-mcrypt php-mhash php-ming php-mysql php-mysqli php-ncurses php-newt php-odbc php-oggvorbis php-pam_auth php-pcntl php-pcre php-pear-Net_IDNA php-posix php-pspell php-readline php-recode php-session php-shmop php-simplexml php-snmp php-soap php-sockets php-sqlite php-ssh2 php-sysvmsg php-sysvsem php-sysvshm php-tclink php-tcpwrap php-tidy php-xml php-xmlrpc php-zip php5-ini curl libcurl3-devel perl-libwww-perl ImageMagick (1行!)

次のようなメッセージが表示された場合:

Missing signature ((no key found) OK)
Do you want to continue installation ? (y/N)

yと答えても安全です。

次に、ISPConfigを後でインストールするために、PHPをグローバルに無効にする必要があります。ISPConfigでは、サイトごとにPHPを有効/無効にできます。今PHPをグローバルに無効にしないと、ISPconfigで指定したことに関係なく、PHPは常に有効になります!ISPConfigをインストールしない場合は、Apache/PHP5のインストールと設定はこれで終了です!

/etc/httpd/modules.d/70_mod_php.confを編集し、AddTypeの行をコメントアウトします:

| LoadModule php5_module extramodules/mod_php5.so PHPINIDir /etc # AddType application/x-httpd-php .php # AddType application/x-httpd-php .php3 # AddType application/x-httpd-php .php4 # AddType application/x-httpd-php .php5 # AddType application/x-httpd-php .phtml # AddType application/x-httpd-php-source .phps DirectoryIndex index.php index.phtml index.php3 index.php4 index.php5 |

/etc/httpd/conf/mime.typesを編集し、次の行をコメントアウトします:

| #application/x-perl perl pl #application/x-php php php3 php4 |

/etc/httpd/conf/httpd.confを編集し、LoadModuleセクションに次の行を追加します:

| LoadModule php5_module extramodules/mod_php5.so |

(この行はすでに/etc/httpd/modules.d/70_mod_php.confにありますが、これは非常に重要です。そうしないと、ISPConfigによって作成された仮想ホストにphp_admin_flag safe_mode Onのような行が含まれている場合、コマンドhttpd -tSyntax OKではなくエラーを報告します!)

注意: ISPConfig 2.1.1以前をインストールする場合は、次の行を/etc/httpd/conf/httpd.confの最後に追加することをお勧めしますが、必須ではありません。)

| Options +Includes -Indexes AllowOverride None AllowOverride Indexes AuthConfig Limit FileInfo Order allow,deny Allow from all Deny from all |

Apacheを再起動します:

/etc/init.d/httpd restart

Share: X/Twitter LinkedIn

新しい投稿を受信箱で受け取る

スパムはありません。いつでも購読を解除できます。