スキップしてメイン コンテンツに移動

投稿

10月, 2012の投稿を表示しています

CentOS 6.3 最小構成からのスタート
(3)インストール済みパッケージ

2012/10/30 1:45 JST 現在 # yum -y update ... # rpm -qa | sort MAKEDEV-3.24-6.el6.x86_64 acl-2.2.49-6.el6.x86_64 aic94xx-firmware-30-2.el6.noarch atmel-firmware-1.3-7.el6.noarch attr-2.4.44-7.el6.x86_64 audit-2.2-2.el6.x86_64 audit-libs-2.2-2.el6.x86_64 authconfig-6.1.12-10.el6.x86_64 b43-openfwwf-5.2-4.el6.noarch basesystem-10.0-4.el6.noarch bash-4.1.2-9.el6_2.x86_64 bfa-firmware-3.0.0.0-1.el6.noarch binutils-2.20.51.0.2-5.34.el6.x86_64 bzip2-1.0.5-7.el6_0.x86_64 bzip2-libs-1.0.5-7.el6_0.x86_64 ca-certificates-2010.63-3.el6_1.5.noarch centos-release-6-3.el6.centos.9.x86_64 checkpolicy-2.0.22-1.el6.x86_64 chkconfig-1.3.49.3-2.el6.x86_64 coreutils-8.4-19.el6.x86_64 coreutils-libs-8.4-19.el6.x86_64 cpio-2.10-10.el6.x86_64 cracklib-2.8.16-4.el6.x86_64 cracklib-dicts-2.8.16-4.el6.x86_64 cronie-1.4.4-7.el6.x86_64 cronie-anacron-1.4.4-7.el6.x86_64 crontabs-1.10-33.el6.noarch curl-7.19.7-26.el6_2.4.x86_64 cyrus-sasl-2.1.23-13.el6.x86_64 cyrus-sasl-lib-2.1.23-13.el6.x86_64 dash-0.5.5.1-3.1.el6.x...

Windows 2003 R2 で MicrosoftUpdate がループする

当方、元々はWindowsサーバー管理者でした。 1000人規模のAD構築して、グループポリシーでガチガチに環境固めて運用してたときが、サーバー管理者って感じだったなぁ... スクリプト組んで、いろいろ自動化したりもしたし... あー懐かし。 でね、久しぶりにWindows OS インストールして使うことになった。 2003 R2。今更か! まぁいい。 で、OS入れてMicrosoft Update したら... http://update.microsoft.com/windowsupdate/v6/default.aspx?ln=ja ↓ http://www.update.microsoft.com/windowsupdate/v6/default.aspx?ln=ja ↓ http://update.microsoft.com/windowsupdate/v6/default.aspx?ln=ja ↓ ... と、無限ループし出した。 最初は、IE6だからか?と思ってIE8ダウンロード & インストールして、さてもう一回... http://update.microsoft.com/windowsupdate/v6/default.aspx?ln=ja ↓ http://www.update.microsoft.com/windowsupdate/v6/default.aspx?ln=ja ↓ http://update.microsoft.com/windowsupdate/v6/default.aspx?ln=ja ↓ ... 状況変わらず。 で、検索したらこれを見つけた。 ■Windows Uptdate のコンポーネントをリセットする方法 http://support.microsoft.com/kb/971058/ja ここの手順3.までやって、もう一回Microsoft Updateしたら、今度は正常に動作した。 今から、121個の重要な更新をインストールしなければ... しゃーない。朝まで放置。

CentOS 5.8 に OpenSSH 5.8p2 を入れる

大変お世話になりました。 ■CentOS5.5にOpenSSH5.8p2を入れる http://d.hatena.ne.jp/erio_nk/20121005/1349437604 ちなみに、CentOS6.3を最小構成でインストールすると、OpenSSHは5.3p1がインストールされる。 このバージョンでも、chrootできるからいいっちゃいいんだが...

CentOS 5.8 を ゼロから LAMP サーバーにする(8)サービスを起動する

インストール直後はサービスが起動していない。 # chkconfig --list ... httpd           0:off 1:off 2:off 3:off 4:off 5:off 6:off ... mysqld         0:off 1:off 2:off 3:off 4:off 5:off 6:off ... # service httpd status httpd は停止しています # service mysqld status mysqld は停止しています # なので起動する。 # service httpd start httpd を起動中:               [  OK  ] # service mysqld start MySQL を起動中:               [  OK  ] # ついでに自動起動設定もする。 # chkconfig httpd on # chkconfig mysqld on # chkconfig --list ... httpd           0:off 1:off 2:on  3:on  4:on 5:on 6:off ... mysqld          0:off 1:off 2:on 3:on 4:on 5:on 6:off ... これでとりあえずLAMPサーバーとして動く。

公開鍵認証とSFTP

お客さんから指摘された内容があまりにもあまりにもだったので、愚痴ってみる。 『公開鍵認証用の公開鍵を勝手に追加できてしまうということは、SFTPにしている意味がない。』 ?がいくつ欲しい? まず、公開鍵認証について。 公開鍵認証は、単なる「認証方式」の一つ。 クライアントでキーペアを生成し、公開鍵をログイン先サーバーへ適切な方法で設定しておくことで、その秘密鍵を持っているクライアントからログインできるというもの。 そう。ログイン時に使用する認証方式。 SFTP は、SSHの上で動くFTP(に似たプロトコル)。「ファイル転送方式」の一つ。 SFTP自体は、ファイル転送をSSH上で暗号化して行うことを目的にしているので、ログイン認証方式は、ぶっちゃけ何でもいい。だから、別にアイパス使ってログインしてもいい。SSHですらアイパスでログインできてしまう(設定次第だが...) なので、公開鍵認証とSFTPはセットみたいな言われ方をされてカチンときたが、お客さんと喧嘩してもいいことないので、ここで愚痴ってみた。 所詮、客先のIT担当なんて、いつも偉そうな口叩きやがるくせして、こんなもんかと。

cron で実行されたコマンドから出力されたメッセージをメールで送信する方法

本題に入る前に、まずは、sh/bash系のシェルで標準出力と標準エラー出力をリダイレクトする方法から。 現在使用中のシェルを確認するには、 # echo $SHELL とすれば確認できる。 その他、利用できるシェルを確認するには # cat /etc/shells とする。 ■リダイレクトについて commandコマンドが出力を伴うコマンドの場合、commandコマンドの出力をresult.txtへ出力するには # command > result.txt コマンドの実効結果を別のコマンドの入力値とする場合は、|(パイプ)でつなげる。 # command1 | command2 ■標準出力と標準エラー出力について ・標準出力 正常結果やコマンド実行途中に出力されるメッセージの出力先。 ・標準エラー出力 異常終了時のメッセージやエラーメッセージなど、ユーザーに気づいてほしいメッセージの出力先。 ■標準出力と標準エラー出力の両方をリダイレクトする 先のcommandコマンドのリダイレクト例のうち、result.txtへのリダイレクトは、標準出力をリダイレクトしている。そのため、標準エラー出力はリダイレクトされず、仮にcommandコマンドが標準エラー出力へメッセージを出力した場合は、result.txtではなくコンソールへ出力(表示)される。 標準出力と標準エラー出力の両方をリダイレクトして、result.txtへ出力するには、 # command > result.txt 2>&1 とする。 なお、上の例を省略なしで記述すると # command 1> result.txt 2>&1 となる。 この「1」「2」の番号について。 ・1:標準出力。通常はコンソール画面。 ・2:標準エラー出力。通常はコンソール画面。 となっている。 ちなみに、「0」は「標準入力」。通常はキーボードからの入力。 例:標準エラー出力を error.log へ出力する。標準出力はコンソールへ表示する。 # command 2> error.log 例:標準出力は result.log 、標準エラー出力は error.log へ...

CentOS 5.8 を ゼロから LAMP サーバーにする(5)my.cnf

例によって、CentOS 5.8へMySQLインストール直後の /etc/my.cnf。 [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock user=mysql # Default to using old password format for compatibility with mysql 3.x # clients (those using the mysqlclient10 compatibility package). old_passwords=1 # Disabling symbolic-links is recommended to prevent assorted security risks; # to do so, uncomment this line: # symbolic-links=0 [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid

CentOS 5.8 を ゼロから LAMP サーバーにする(4)php.ini

インストール直後の /etc/php.ini 。64bit環境。 [PHP] ;;;;;;;;;;;;;;;;;;; ; About php.ini ; ;;;;;;;;;;;;;;;;;;; ; PHP's initialization file, generally called php.ini, is responsible for ; configuring many of the aspects of PHP's behavior. ; PHP attempts to find and load this configuration from a number of locations. ; The following is a summary of its search order: ; 1. SAPI module specific location. ; 2. The PHPRC environment variable. (As of PHP 5.2.0) ; 3. A number of predefined registry keys on Windows (As of PHP 5.2.0) ; 4. Current working directory (except CLI) ; 5. The web server's directory (for SAPI modules), or directory of PHP ; (otherwise in Windows) ; 6. The directory from the --with-config-file-path compile time option, or the ; Windows directory (C:\windows or C:\winnt) ; See the PHP docs for more specific information. ; http://www.php.net/manual/en/configuration.file.php ; The syntax of the file is extremely simple. Whitespace and Lines ; beginning with a semicolon...

CentOS 5.8 を ゼロから LAMP サーバーにする(3)httpd.conf

インストール直後の /etc/httpd/ ディレクトリ。64bit環境。 [root@localhost ~]# cd /etc/httpd/ [root@localhost httpd]# ls -l drwxr-xr-x 2 root root 4096 10月 12 09:48 conf drwxr-xr-x 2 root root 4096 10月 12 09:48 conf.d lrwxrwxrwx 1 root root   19 10月 12 09:48 logs -> ../../var/log/httpd lrwxrwxrwx 1 root root   29 10月 12 09:48 modules -> ../../usr/lib64/httpd/modules lrwxrwxrwx 1 root root   13 10月 12 09:48 run -> ../../var/run [root@localhost httpd]# cd conf [root@localhost conf]# ls -l -rw-r--r-- 1 root root 33726 6月 6 23:04 httpd.conf -rw-r--r-- 1 root root 13139 6月 6 23:04 magic [root@localhost conf]# cd ../conf.d/ [root@localhost conf.d]# ls -l -rw-r--r-- 1 root root 392 6月 6 23:04 README -rw-r--r-- 1 root root 674 6月 28 01:30 php.conf -rw-r--r-- 1 root root 566 6月 6 23:04 proxy_ajp.conf -rw-r--r-- 1 root root 299 6月 6 23:04 welcome.conf [root@localhost conf.d]# で、本題の インストール直後の httpd.conf はこれ。 # # This is the main Apache server configuration file. It contains t...