« PHP4からPHP5への移行・アップグレード | メイン | MySQLデータの引越し (mysqldumpで梃子摺る) »

サーバーマシンの変更

■VineLinux4.2 をDELLマシンにインストール。
 ・「boot: linux noapic」 http://vinelinux.org/vine26.html
 ・http://vine.1-max.net/vine4-install.html


■DELL AMD マシンへのインストールがうまくいかず、FedoraCore6をインストール。
 ・通常のインストールで最初からApache2が入る。
 ・残作業: http://honana.com/apache/22/documentroot.htmlでapache設定、http://wlines.net/でwebmin(済) SSH(済) phpmyadmin(済) MySQL[diet-s、ranking-s、womanlink、kozai]を移植、MT[categoryjp、diet-s、ranking-s、womanlink]移植 CRON(済) postfix(済)、php(済) pear(Services_Amazon)(済) mysql(済) dice(済) image::magick(済) CPAN(済)、ログ・ローテート、AWStats、Xvfbのインストール
 ・diceはダウンロードして解凍
 ・php5は「yum install gcc」「yum install libxml2-devel」「yum install libxslt-devel」「yum install mysql-devel」「yum -y install httpd-devel」「yum -y install libpng-devel」「yum -y install curl curl-devel(追加08.05.16)」「#yum -y install php-gd(2008.5.26 追加)」「#yum -y install php-mbstring(2008.6.2 追加)」
  の後、「
  ./configure --enable-ftp --enable-mbstring --enable-zend-multibyte --with-apxs2 --with-mysql --with-gd --with-mysqli --with-curl(追加08.05.16)
  」で「make && make install」
 ・MySQLは「yum -y install mysql-server」http://fedorasrv.com/mysql.shtml http://www.jitaku-server.net/mt_mysql.html
 ・image::magickは「yum -y install ImageMagick-perl」
 ・CPANは最初のログイン時に初期設定を行う(perl -MCPAN -e shell)http://www.omakase.org/perl_module.htm
  ↓
  サーバの応答にエラーがある場合、再試行を繰り返すが、最後に他のFTPサイトを指定できる(http://tomo.ac/goodstream/perl/tips/cpanerr.html
  CPANでインストールするモジュール「LWP::Simple」「XML::Parser」「XML::Simple」「Jcode」「WWW::Google::PageRank」
 ・phpmyadminは「yum -y install php-mysql」(・・・旧サーバーからのディレクトリごとコピーでもOK)(config.inc.phpの設定でハマったら、「phpMyAdmin 2.*.* へようこそ」の画面で右下「別ウィンドウで開く」を押してみるべし)
 ・postfixはWebminでインストール。http://wlines.net/postfix_install.html
 ・Dovecotも上記と同様インストールしたが起動せず(Portの問題?)→SELINUXの所為
 ・postfix 送受信テスト http://www.shitomi.jp/fc6/postfix.html
 ・postfix バーチャルドメイン設定はここ参照→http://www.gside.org/Gentoo/postfix/virtualdomain.html
  ①main.cfの編集virtual_alias_domains、virtual_alias_maps)、
  ②/etc/postfix/virtual の編集、
  ③コマンド「postmap /etc/postfix/virtual」でvirtual.db作成、
  ④postfix 再起動。

◎/home/以下のHTML等がウェブで表示されない問題
→→FedoraではSELinuxが働いており、file_contextsファイルに従うセキュリティコンテキストが各ディレクトリ・ファイルに付与されている。SeLINUX参考サイト
→→「chconコマンド」で/home/test.comのタイプを「user_u:object_r:user_home_t」から「user_u:object_r:httpd_sys_content_t」に変えれば表示できるようになる!
→SELINUX参考サイト http://itpro.nikkeibp.co.jp/article/COLUMN/20070828/280518/?P=2
→結局SELINUXは無効にした。(dovecotが起動しなかったりするので)


postfix
http://fedorasrv.com/postfix.shtml
http://yokensaka.com/fedora/index.php?catid=18&blogid=1

・ログ・ローテート
 http://memorva.jp/memo/linux/apache_logrotate.php

・AWStats(アクセス解析)
 http://www.mitsuki.no-ip.com/~seagull/diary/000203.html
 上記サイト、テスト実行まで済み(/usr/share/awstats/wwwroot/cgi-bin/awstats.pl -config=abc-search.com を実行で /var/lib/awstats 内に出力ファイルが生成される)(outputオプションをつけて /usr/share/awstats/wwwroot/cgi-bin/awstats.pl -config=abc-search.com -output > /home/abc.com/awstats.html を実行で awstats.htmlにHTML出力が生成される

①/etc/httpd/conf.d/virtualhost.conf にドメインごとのアクセスログ出力先を指定する。(例:CustomLog logs/abc.com-access_log)
②/etc/awstats/ 内にconfファイルを作成(既存ファイルをコピーして、LogFile="/etc/httpd/logs/abc.com-access_log"の部分を①に合わせる)
③ブラウザでアクセス(http://サーバー名/awstats/awstats.pl?month=12&year=2008&output=main&config=abc.com)

(備考)便利なコマンド
■ユーザでリモートサーバーにログインしてrsyncする
# rsync -avz --delete -e ssh /home/user1/ user1@192.168.0.30:/home/user1/
■sshでログインする
# ssh user1@192.168.0.30


About

2008年03月31日 12:26に投稿されたエントリーのページです。

ひとつ前の投稿は「PHP4からPHP5への移行・アップグレード」です。

次の投稿は「MySQLデータの引越し (mysqldumpで梃子摺る)」です。

他にも多くのエントリーがあります。メインページアーカイブページも見てください。