投稿者の投稿
Windows2003 Server ドメインコントローラ1台の環境にWindows 2008 R2 Server をバックアップドメインコントローラを設置する
1.Enterprise Admins、Schema Admins、Domain Admins グループのメンバとして、Windows2003 Server にログオンします。
2.Windows Server 2008 DVD を、CD または DVD ドライブに挿入します。\sources\adprep フォルダの内容を、スキーマ マスタ上の Adprep フォルダにコピーします。
3.コマンド プロンプトを開き、ディレクトリを Adprep フォルダに移動します。
4.コマンド プロンプトで次のコマンドを入力し、Enter キーを押します。
adprep /forestprep
5.コマンド プロンプトで次のコマンドを入力し、Enter キーを押します。
adprep32 /domainprep /gpprep
CentOS 5に yum でzabbix エージェントをインストールする方法
ZabbixのYumリポジトリのインストール
[text]
wget http://www.zabbix.jp/binaries/relatedpkgs/rhel5Client/i386/zabbix-jp-release-5-3.noarch.rpm
rpm -ivh zabbix-jp-release-5-3.noarch.rpm <—- yumリポジトリ登録用RPMのインストール
[/text]
Zabbixのインストールから設定まで
[text]
alternatives –config zabbix-jp-release <—- ZABBIXバージョンを選択する
yum clean all <—- yumのリポジトリのキャッシュを削除します
yum -y install zabbix-agent <—- zabbix エージェントをインストール
chkconfig zabbix-agent on <—- OS起動時に起動する設定
[/text]
— ここで、/etc/zabbix/zabbix_agentd.conf を修正する —
[text]
Server=zabbixサーバのipアドレス
HostName=このサーバのホスト名
ListenIP=このサーバのipアドレス(zabbixサーバからの問い合わせを受け付けるipアドレス) コメントにするとすべてを受け付ける
[/text]
[text]
# service zabbix-agent start <—- zabbix エージェントをスタートする
[/text]
Javascript で日付の文字列をチェックをする(yyyy/mm/dd)
function checkDate(p_date)
{
if (!p_date.match(/^(2[0-9]{3})\/([0-9]{1,2})\/([0-9]{1,2})$/)) {
return false;
}
var yyyy = Number(RegExp.$1);
var mm = Number(RegExp.$2);
var dd = Number(RegExp.$3);
var ymd = new Date(yyyy, mm – 1, dd);
var ymd_yyyy = ymd.getYear();
if (ymd_yyyy < 1900) ymd_yyyy += 1900;
if (yyyy != ymd_yyyy || mm != (ymd.getMonth() + 1) || dd != ymd.getDate()) {
return false;
}
return true;
}
Windows 7の「識別されていないネットワーク」はADOBE CS3の問題だった
はまりにはまった一日・・・・・・・
- 管理者権限でスタート->実行->cmdを開きます。
- “C:\Program Files\Bonjour\mDNSResponder.exe” -remove と入力すると一旦サービスが削除されますが、完全には消えません。
- C:\Program Files\Bonjourにある「mdnsNSP.dll」の名前を「mdnsNSP_____.dll」に変更します。
- 再起動します。
ここの方には感謝します↓↓↓↓↓↓
http://www.kanotype.net/dnn/BLOG/tabid/65/EntryId/6/Windows-7.aspx
本当にありがとう
CentOS5.6 サーバをいつも最新の状態にする
サーバーをいつも最新の状態に保つには、
yum -y update yumコマンドでモジュールを最新にする
後は再起動するだけ
shutdown -r now
これを毎週土曜日にやることにした
yumupdateall.sh を作って、crontabで起動する
#!/bin/sh
nowtime=”$(date +%Y%m%d%H%M%S)”
logfile=”yumlog/yum_log_$nowtime.log”
cd /backup
yum -y update > $logfile
shutdown -r now
#crontab -e
0 8 * * 6 /backup/yumupdateall.sh
CentOS5.6 Sendmail 設定について
サーバをマルチドメインで運用し、procmail を使用する場合のsendmail.mc。
localhost.locahdomain がいたる所に出て、中継時に他のサーバにrejectされてしまっていた。
あと、/etc/hosts ファイルに以下の記述を忘れないように。
127.0.0.1 hogehoge.jp localhost.localdomain localhost
sendmail.mc の記述は以下の通り。
↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
divert(-1)dnl dnl # dnl # This is the sendmail macro config file for m4. If you make changes to dnl # /etc/mail/sendmail.mc, you will need to regenerate the dnl # /etc/mail/sendmail.cf file by confirming that the sendmail-cf package is dnl # installed and then performing a dnl # dnl # make -C /etc/mail dnl # include(`/usr/share/sendmail-cf/m4/cf.m4')dnl VERSIONID(`setup for linux')dnl OSTYPE(`linux')dnl dnl # dnl # Do not advertize sendmail version. dnl # dnl define(`confSMTP_LOGIN_MSG', `$j Sendmail; $b')dnl dnl # dnl # default logging level is 9, you might want to set it higher to dnl # debug the configuration dnl # dnl define(`confLOG_LEVEL', `9')dnl dnl # dnl # Uncomment and edit the following line if your outgoing mail needs to dnl # be sent out through an external mail server: dnl # dnl define(`SMART_HOST', `smtp.your.provider')dnl dnl # define(`confDEF_USER_ID', ``8:12'')dnl dnl define(`confAUTO_REBUILD')dnl define(`confTO_CONNECT', `1m')dnl define(`confTRY_NULL_MX_LIST', `True')dnl define(`confDONT_PROBE_INTERFACES', `True')dnl define(`PROCMAIL_MAILER_PATH', `/usr/bin/procmail')dnl define(`ALIAS_FILE', `/etc/aliases')dnl define(`STATUS_FILE', `/var/log/mail/statistics')dnl define(`UUCP_MAILER_MAX', `2000000')dnl define(`confUSERDB_SPEC', `/etc/mail/userdb.db')dnl define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl define(`confAUTH_OPTIONS', `A')dnl define(`confDOMAIN_NAME', `mail.hogehoge.jp')dnl dnl # dnl # The following allows relaying if the user authenticates, and disallows dnl # plaintext authentication (PLAIN/LOGIN) on non-TLS links dnl # dnl define(`confAUTH_OPTIONS', `A p')dnl dnl # dnl # PLAIN is the preferred plaintext authentication method and used by dnl # Mozilla Mail and Evolution, though Outlook Express and other MUAs do dnl # use LOGIN. Other mechanisms should be used if the connection is not dnl # guaranteed secure. dnl # Please remember that saslauthd needs to be running for AUTH. dnl # TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl dnl # dnl # Rudimentary information on creating certificates for sendmail TLS: dnl # cd /etc/pki/tls/certs; make sendmail.pem dnl # Complete usage: dnl # make -C /etc/pki/tls/certs usage dnl # define(`confCACERT_PATH', `/etc/pki/CA')dnl define(`confCACERT', `/etc/pki/CA/cacert.pem')dnl define(`confSERVER_CERT', `/etc/pki/dovecot/certs/dovecot.pem')dnl define(`confSERVER_KEY', `/etc/pki/dovecot/private/dovecot.pem')dnl dnl # dnl # This allows sendmail to use a keyfile that is shared with OpenLDAP's dnl # slapd, which requires the file to be readble by group ldap dnl # dnl define(`confDONT_BLAME_SENDMAIL', `groupreadablekeyfile')dnl dnl # dnl define(`confTO_QUEUEWARN', `4h')dnl dnl define(`confTO_QUEUERETURN', `5d')dnl dnl define(`confQUEUE_LA', `12')dnl dnl define(`confREFUSE_LA', `18')dnl define(`confTO_IDENT', `0')dnl dnl FEATURE(delay_checks)dnl FEATURE(`no_default_msa', `dnl')dnl FEATURE(`smrsh', `/usr/sbin/smrsh')dnl FEATURE(`mailertable', `hash -o /etc/mail/mailertable.db')dnl FEATURE(`virtusertable', `hash -o /etc/mail/virtusertable.db')dnl FEATURE(redirect)dnl FEATURE(always_add_domain)dnl FEATURE(use_cw_file)dnl FEATURE(use_ct_file)dnl dnl # dnl # The following limits the number of processes sendmail can fork to accept dnl # incoming messages or process its message queues to 20.) sendmail refuses dnl # to accept connections once it has reached its quota of child processes. dnl # dnl define(`confMAX_DAEMON_CHILDREN', `20')dnl dnl # dnl # Limits the number of new connections per second. This caps the overhead dnl # incurred due to forking new sendmail processes. May be useful against dnl # DoS attacks or barrages of spam. (As mentioned below, a per-IP address dnl # limit would be useful but is not available as an option at this writing.) dnl # dnl define(`confCONNECTION_RATE_THROTTLE', `3')dnl dnl # dnl # The -t option will retry delivery if e.g. the user runs over his quota. dnl # FEATURE(local_procmail, `', `procmail -t -Y -a $h -d $u')dnl FEATURE(`access_db', `hash -T -o /etc/mail/access.db')dnl FEATURE(`blacklist_recipients')dnl EXPOSED_USER(`root')dnl dnl # dnl # For using Cyrus-IMAPd as POP3/IMAP server through LMTP delivery uncomment dnl # the following 2 definitions and activate below in the MAILER section the dnl # cyrusv2 mailer. dnl # dnl define(`confLOCAL_MAILER', `cyrusv2')dnl dnl define(`CYRUSV2_MAILER_ARGS', `FILE /var/lib/imap/socket/lmtp')dnl dnl # dnl # The following causes sendmail to only listen on the IPv4 loopback address dnl # 127.0.0.1 and not on any other network devices. Remove the loopback dnl # address restriction to accept email from the internet or intranet. dnl # DAEMON_OPTIONS(`Port=smtp, Name=MTA')dnl dnl # dnl # The following causes sendmail to additionally listen to port 587 for dnl # mail from MUAs that authenticate. Roaming users who can't reach their dnl # preferred sendmail daemon due to port 25 being blocked or redirected find dnl # this useful. dnl # DAEMON_OPTIONS(`Port=submission, Name=MSA, M=Ea')dnl dnl # dnl # The following causes sendmail to additionally listen to port 465, but dnl # starting immediately in TLS mode upon connecting. Port 25 or 587 followed dnl # by STARTTLS is preferred, but roaming clients using Outlook Express can't dnl # do STARTTLS on ports other than 25. Mozilla Mail can ONLY use STARTTLS dnl # and doesn't support the deprecated smtps; Evolution <1.1.1 uses smtps dnl # when SSL is enabled-- STARTTLS support is available in version 1.1.1. dnl # dnl # For this to work your OpenSSL certificates must be configured. dnl # DAEMON_OPTIONS(`Port=smtps, Name=TLSMTA, M=s')dnl dnl # dnl # The following causes sendmail to additionally listen on the IPv6 loopback dnl # device. Remove the loopback address restriction listen to the network. dnl # dnl DAEMON_OPTIONS(`port=smtp,Addr=::1, Name=MTA-v6, Family=inet6')dnl dnl # dnl # enable both ipv6 and ipv4 in sendmail: dnl # dnl DAEMON_OPTIONS(`Name=MTA-v4, Family=inet, Name=MTA-v6, Family=inet6') dnl # dnl # We strongly recommend not accepting unresolvable domains if you want to dnl # protect yourself from spam. However, the laptop and users on computers dnl # that do not have 24x7 DNS do need this. dnl # FEATURE(`accept_unresolvable_domains')dnl dnl # dnl FEATURE(`relay_based_on_MX')dnl dnl # dnl # Also accept email sent to "localhost.localdomain" as local email. dnl # dnl LOCAL_DOMAIN(`localhost.localdomain')dnl dnl LOCAL_DOMAIN(`hogehoge.jp')dnl dnl # dnl # The following example makes mail from this host and any additional dnl # specified domains appear to be sent from mydomain.com dnl # dnl MASQUERADE_AS(`hogehoge.jp')dnl dnl # dnl # masquerade not just the headers, but the envelope as well dnl # dnl FEATURE(masquerade_envelope)dnl dnl # dnl # masquerade not just @mydomainalias.com, but @*.mydomainalias.com as well dnl # FEATURE(masquerade_entire_domain)dnl dnl FEATURE(`limited_masquerade')dnl dnl # dnl MASQUERADE_DOMAIN(localhost)dnl dnl MASQUERADE_DOMAIN(localhost.localdomain)dnl dnl MASQUERADE_DOMAIN(mydomainalias.com)dnl dnl MASQUERADE_DOMAIN(mydomain.lan)dnl MAILER(smtp)dnl MAILER(procmail)dnl dnl MAILER(cyrusv2)dnl define(`confSMTP_LOGIN_MSG',`unknown')dnl define(`confRECEIVED_HEADER',`$?sfrom $s $.$?_($?s$|from $.$_) $.$?{auth_type}(authenticated$?{auth_ssf} bits=${auth_ssf}$.) $.by $j (unknown)$?r with $r$. id $i$?{tls_version} (version=${tls_version} cipher=${cipher} bits=${cipher_bits} verify=${verify})$.$?u for $u; $|; $.$b')dnl
CentOS5.6 でFTP /etc/xinetd.d/gssftp
# default: off
# description: The kerberized FTP server accepts FTP connections \
# that can be authenticated with Kerberos 5.
service ftp
{
flags = REUSE
socket_type = stream
wait = no
user = root
server = /usr/kerberos/sbin/ftpd
server_args = -l # server_args = -l -a から -a をはずす
log_on_failure += USERID
disable = no
}
gssftp を使うより vsftpdを使うほうがいいです。
CentOS5 で自前のCA(認証局)を作り証明書を作成する
CAを作る
- openssl.cnfを修正するのでオリジナルを保存する#cp /etc/pki/tls/openssl.cnf /etc/pki/tls/openssl.cnf.org
- /etc/pki/tls/openssl.cnfを編集する
[ req ]
default_bits = 2048 # 1024->2048
[ usr_cert ]
basicConstraints=CA:TRUE # FALSE ->TRUEへ変更
nsCertType = server # サーバー証明書を作成します
[ v3_ca ]
nsCertType = sslCA, emailCA # SSLおよび電子メール認証サーバーを作成します
- 証明書作成用のスクリプトのオリジナルを保存する
#cd /etc/pki/tls/misc
#cp CA CA.org
- 証明書作成用のスクリプトを修正する
if [ -z “$OPENSSL” ]; then OPENSSL=openssl; fi
SSLEAY_CONFIG=”-config ../openssl.cnf” # コンフィグレーションファイルの位置を修正
DAYS=”-days 7300″ # 有効期間を20年に変更
CADAYS=”-days 7300″ # 有効期間を20年に変更
REQ=”$OPENSSL req $SSLEAY_CONFIG”
- CA(スクリプト)を実行する
#./CA -newca
必要な情報入れたら出来上がり
/etc/pki/CA フォルダーが出来ています
- opensslの設定を元に戻しておきます
#cp /etc/pki/tls/openssl.cnf.org /etc/pki/tls/openssl.cnf
- CAの秘密鍵のパーミッションを変更する
#chmod 0400 /etc/pki/CA/private/cakey.pem
- 認証局の証明書を作成する(配布用)
cd /etc/pki/CA/
# openssl x509 -inform PEM -in cacert.pem -outform DER -out cacert.der
CAができたら
- サーバ証明書要求を作成する
# cd /etc/pki/tls/misc/
# ./CA -newreqnewkey.pem
newreq.pemができる
- サインする
# ./CA -sign
newcert.pemができる
- キーファイルのパスフレーズを解除する
# openssl rsa -in newkey.pem -out newkey.pem
- 出来上がった証明書のファイルの名前を変えて配備する
CentOS5 に root権限でX サーバに接続するには
/etc/gdm/custom.conf に以下の2行を入れるだけ
[security]
AllowRemoteRoot=true
[xdmcp]
Enable=true
後は、cygwin で
X -query 192.168.0.10
これでつながる
つながらない場合は、ファイアウォールを疑おう
CentOS <—— TCP ポート6000 ——> Cygwin