HomeServer5
の編集
index.php?HomeServer5
[
トップ
] [
編集
|
差分
|
履歴
|
添付
|
リロード
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
]
-- 雛形とするページ --
(no template pages)
#contents(); * インストールの準備 [#idb3f37e] - colinux 0.74 - Win Pcap - image (zip 圧縮済) -- Ubuntu 9.04 image ( 1G 標準版)---> &ref(); -- Ubuntu 9.04 image (10G 拡張版)---> &ref(); -- swap ---> &ref(); ** windows 側の設定ファイルの準備 [#f50bdedb] - /dev/cobd0 => root file system (Ubuntu image) - /dev/cobd1 => swap - /dev/cofs0 => windows shared area - eth0 (slirp) => colinux ---> 外部ネットワーク (一方通行) - eth1 (TAP) => colinux と ホスト間専用ホットライン kernel=vmlinux cobd0="c:\coLinux\Ubuntu-9.04.ext3.1gb.fs" cobd1="c:\coLinux\fs_768Mb" cofs0="c:\colinux_winshare" root=/dev/cobd0 ro #initrd=initrd.gz mem=512 cocon=120x38 # Slirp for internet connection (outgoing) # Inside running coLinux configure eth0 with this static settings: # ipaddress 10.0.2.15 broadcast 10.0.2.255 netmask 255.255.255.0 # gateway 10.0.2.2 nameserver 10.0.2.3 eth0=slirp # Tuntap as private network between guest and host on second linux device eth1=tuntap # Setup for serial device #ttys0=COM1,"BAUD=115200 PARITY=n DATA=8 STOP=1 dtr=on rts=on" # Run an application on colinux start (Sample Xming, a Xserver) #exec0=C:\Programs\Xming\Xming.exe,":0 -clipboard -multiwindow -ac" * colinux を一度起動できたら colinux 環境の設定 [#i4b0cd1d] ** ネットワーク設定 ( /etc/network/interface の編集 ) [#ff084614] - 起動時に lo(loop), eth0(slirp), eth1(TAP) の3つを有効 - eth0、eth1 ともに Static にアドレスを付与する -- eth0 の slirp のアドレスは決まっている(変更できない) -- eth1 の TAP のアドレスは Windows 側の TAP の設定とあわせる *** 会社ネットワークなど Proxy を跨ぐ必要のある場合には [#w8def8db] - colinux に root でログインした状態で .bashrc に以下を追加する - この設定で apt-get コマンドでパッケージをメンテできるようになった root@colinuc:~# echo "export proxy='http://(proxy server):(port)'" > .bash_prifile root@colinuc:~# source .bash_profile ** マウントの設定 [#xcae176f] *** SWAP の設定 [#ea5b64b4] *** windows 共有ファイル(cofs 利用) [#x12b8498] ** その他の初期設定 [#o91f3204] *** timezone の設定 [#cb5d50aa] root@colinuc:~# ln -sf /usr/share/zoneinfo/Japan /etc/localtime *** keytable の設定 [#m755562f] root@colinuc:~# apt-get console-data - 表示されたメニュから Standalone(一番下)-> Standalone/Japanese/standard を選択すると jp106 になる - .bash_profile に loadkeys jp106 を設定 *** その他パッケージとしてインストールしたもの [#a6b19f34] - vim - nano - ssh ( rsync の接続でも利用する ) - ftp (slirp 場合には pftp というパッシブモードの接続を利用する必要がある) - gcc (PC 用の native コンパイラ) ** 英語辞書を使えるように [#b7f3c55e] ー 辞書ビューワーには Ubuntu のパッケージとして提供される EBView というアプリを利用した - 辞書データは 英辞郎 バージョン116 を利用 ーー PDIC Unicode 版(5.3.4) の辞書設定(詳細)から辞書を指定し、右クリックで変換を行う。PDIC 一行テキスト形式でファイルを生成 -- エディタでファイルを開きファイル形式を UTF16 から Shift-JIS 形式に変更してファイルを保存 -- [[EVStudio:http://www31.ocn.ne.jp/~h_ishida/EBStudio.html]] というソフトを利用して、ファイルを PDIC 1行形式でJIS-X4081(EPWINGのサブセット)ファイルを生成させる、ここまでは windows での作業 ---- &ref(ebstd170b.exe); --- EBStudioを開いたら,<ファイル>の<開く>で好きな形式のebsファイルを開く(どれでもよい) --- &color(red){ただし,入力ファイル名ペインにあるファイル名は右クリックして<修正>で,PDIC 1行テキスト形式を選び,入力ファイル名も適当なものにする}; -- 生成したファイルを Ubuntu にコピーし、EBView で辞書を指定する --- この時 UTF-8 にコード変換する必要はない - http://euda.cocolog-nifty.com/scosco/2008/09/ebview-4ca6.html * メールサーバー証明書作成 ーーーー web は公式証明書だが、メールは独自(なんちゃって)で十分 [#db6d8747] *** 参考 URL = http://www.kazutoyo.com/ubuntu/ [#scaa20ce] *** デフォルト環境の初期化 [#cf4b423f] root@spirit:/root# sudo -s root@spirit:/root# cd /etc/ssl/CA root@spirit:/etc/ssl/CA# cat /dev/null > index.txt root@spirit:/etc/ssl/CA# echo '01' > serial root@spirit:/etc/ssl/CA# echo '01' > crlnumber *** 秘密鍵の作成 [#vdca07f7] root@spirit:/etc/ssl/CA# openssl genrsa -out private/cakey.pem 1024 Generating RSA private key, 1024 bit long modulus ......................................................................................................................... ++++++ ...............++++++ e is 65537 (0x10001) root@spirit:/etc/ssl/CA# ls -l private/ 合計 4 -rw-r--r-- 1 root root 887 2010-03-21 10:59 cakey.pem *** 秘密鍵を使って証明書を作成 [#q39d98ea] - -daysオプションで有効期限を10年と設定 root@spirit:/etc/ssl/CA# openssl req -new -x509 -days 3560 -key private/cakey.pem -out cacert.pem You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [JP]:JP State or Province Name (full name) [Kanagawa]:Kanagawa Locality Name (eg, city) []:Yokohama Organization Name (eg, company) [IT admin]:hmuna Organizational Unit Name (eg, section) [IT]: Common Name (eg, YOUR name) []:mail.hmuna.com Email Address []:server-admin@hmuna.com *** サーバ証明書の作成 [#n0c4fcb9] - サーバ証明書作成はまず署名リクエスト(CSR)を作成し、それをCAで署名して作ります - 場所は /etc/ssl/Server にします (Ubuntu のデフォルト) ーー 秘密鍵の作成 root@spirit:/etc/ssl/Servr# openssl genrsa -out private.pem 1024 Generating RSA private key, 1024 bit long modulus ........................++++++ .......++++++ e is 65537 (0x10001) ーー 認証局に署名してもらう為リクエストを作成 root@spirit:/etc/ssl/Servr# openssl req -new -key private.pem -out request.pem You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [JP]:JP State or Province Name (full name) [Kanagawa]:Kanagawa Locality Name (eg, city) []:Yokohama Organization Name (eg, company) [IT admin]: Organizational Unit Name (eg, section) [IT]: Common Name (eg, YOUR name) []:mail.hmuna.com Email Address []:server-admin@hmuna.com Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []: <-------- 空でエンター An optional company name []: <-------- 空でエンター ーー CAで署名 root@spirit:/etc/ssl/Servr# cp /etc/ssl/openssl.cnf ./. root@spirit:/etc/ssl/Servr# openssl ca -config openssl.cnf -policy policy_anything -out ./cert-ca.pem -infiles request.pem Using configuration from openssl.cnf Check that the request matches the signature Signature ok Certificate Details: Serial Number: 1 (0x1) Validity Not Before: Mar 21 02:03:39 2010 GMT Not After : Mar 18 02:03:39 2020 GMT Subject: countryName = JP stateOrProvinceName = Kanagawa localityName = Yokohama organizationName = IT admin organizationalUnitName = IT commonName = mail.hmuna.com emailAddress = server-admin@hmuna.com X509v3 extensions: X509v3 Basic Constraints: CA:FALSE Netscape Cert Type: SSL Server Netscape Comment: OpenSSL Generated Certificate X509v3 Subject Key Identifier: BF:B1:75:09:3E:34:61:DF:40:BC:CE:1B:A9:92:48:9A:C9:17:89:F7 X509v3 Authority Key Identifier: keyid:98:A8:56:F1:51:52:00:91:29:4B:CA:FA:62:BF:4B:BB:ED:15:A7:11 Certificate is to be certified until Mar 18 02:03:39 2020 GMT (3650 days) Sign the certificate? [y/n]:y 1 out of 1 certificate requests certified, commit? [y/n]y Write out database with 1 new entries Data Base Updated *** メールサーバ用の証明書はサーバ証明書だけ抜き取る [#x295fff2] root@spirit:/etc/ssl/Servr# openssl x509 -in cert-ca.pem -out cert.pem *** MUA用には証明書と秘密鍵から作成 [#y4df0316] root@spirit:/etc/ssl/Servr# cat private.pem cert.pem > mail.pem *** 作成したサーバ証明書とCA証明書が正常に作成できたか確認 [#dea55b06] root@spirit:/etc/ssl/Servr# openssl verify -CAfile /etc/ssl/CA/cacert.pem cert-ca.pem cert-ca.pem: OK root@spirit:/etc/ssl/Servr# openssl verify -CAfile /etc/ssl/CA/cacert.pem cert.pem cert.pem: OK *** Windowsなどのクライアントに証明書をインストールするための ca.der を作成 ----> &ref(ca.der); [#x5927841] - メールの送受信も暗号化された通信を使えません - クライアントからWebにアクセスしようとするとブラウザーの警告メッセージが毎回表示される root@spirit:/etc/ssl/Servr# cd /etc/ssl/CA root@spirit:/etc/ssl/CA# openssl x509 -inform pem -in cacert.pem -out ca.der -outform der *** tsl key 作成 [#p1ec3fb7] - 鍵と証明書の作成 root@spirit:/etc/ssl/tlskey# openssl req -new -x509 -days 3650 -nodes -out shoumei.pem -keyout himitsu.key Generating a 1024 bit RSA private key ..++++++ ...........++++++ writing new private key to 'himitsu.key' ----- You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [JP]:JP State or Province Name (full name) [Kanagawa]:Kanagawa Locality Name (eg, city) []:Yokohama Organization Name (eg, company) [IT admin]:IT admin Organizational Unit Name (eg, section) [IT]:IT Common Name (eg, YOUR name) []:mail.hmuna.com Email Address []:server-admin@hmuna.com root@spirit:/etc/ssl/tlskey# ls -l 合計 8 -rw-r--r-- 1 root root 887 2010-05-03 14:39 himitsu.key -rw-r--r-- 1 root root 1350 2010-05-03 14:39 shoumei.pem - クライアント証明書の作成 root@spirit:/etc/ssl/tlskey# openssl x509 -inform pem -outform der -in shoumei.pem -out shoumei.der root@spirit:/etc/ssl/tlskey# ls -l 合計 12 -rw-r--r-- 1 root root 887 2010-05-03 14:39 himitsu.key -rw-r--r-- 1 root root 955 2010-05-03 14:42 shoumei.der -rw-r--r-- 1 root root 1350 2010-05-03 14:39 shoumei.pem - 鍵と証明書の統合 root@spirit:/etc/ssl/tlskey# cat shoumei.pem himitsu.key > courier.pem
タイムスタンプを変更しない
#contents(); * インストールの準備 [#idb3f37e] - colinux 0.74 - Win Pcap - image (zip 圧縮済) -- Ubuntu 9.04 image ( 1G 標準版)---> &ref(); -- Ubuntu 9.04 image (10G 拡張版)---> &ref(); -- swap ---> &ref(); ** windows 側の設定ファイルの準備 [#f50bdedb] - /dev/cobd0 => root file system (Ubuntu image) - /dev/cobd1 => swap - /dev/cofs0 => windows shared area - eth0 (slirp) => colinux ---> 外部ネットワーク (一方通行) - eth1 (TAP) => colinux と ホスト間専用ホットライン kernel=vmlinux cobd0="c:\coLinux\Ubuntu-9.04.ext3.1gb.fs" cobd1="c:\coLinux\fs_768Mb" cofs0="c:\colinux_winshare" root=/dev/cobd0 ro #initrd=initrd.gz mem=512 cocon=120x38 # Slirp for internet connection (outgoing) # Inside running coLinux configure eth0 with this static settings: # ipaddress 10.0.2.15 broadcast 10.0.2.255 netmask 255.255.255.0 # gateway 10.0.2.2 nameserver 10.0.2.3 eth0=slirp # Tuntap as private network between guest and host on second linux device eth1=tuntap # Setup for serial device #ttys0=COM1,"BAUD=115200 PARITY=n DATA=8 STOP=1 dtr=on rts=on" # Run an application on colinux start (Sample Xming, a Xserver) #exec0=C:\Programs\Xming\Xming.exe,":0 -clipboard -multiwindow -ac" * colinux を一度起動できたら colinux 環境の設定 [#i4b0cd1d] ** ネットワーク設定 ( /etc/network/interface の編集 ) [#ff084614] - 起動時に lo(loop), eth0(slirp), eth1(TAP) の3つを有効 - eth0、eth1 ともに Static にアドレスを付与する -- eth0 の slirp のアドレスは決まっている(変更できない) -- eth1 の TAP のアドレスは Windows 側の TAP の設定とあわせる *** 会社ネットワークなど Proxy を跨ぐ必要のある場合には [#w8def8db] - colinux に root でログインした状態で .bashrc に以下を追加する - この設定で apt-get コマンドでパッケージをメンテできるようになった root@colinuc:~# echo "export proxy='http://(proxy server):(port)'" > .bash_prifile root@colinuc:~# source .bash_profile ** マウントの設定 [#xcae176f] *** SWAP の設定 [#ea5b64b4] *** windows 共有ファイル(cofs 利用) [#x12b8498] ** その他の初期設定 [#o91f3204] *** timezone の設定 [#cb5d50aa] root@colinuc:~# ln -sf /usr/share/zoneinfo/Japan /etc/localtime *** keytable の設定 [#m755562f] root@colinuc:~# apt-get console-data - 表示されたメニュから Standalone(一番下)-> Standalone/Japanese/standard を選択すると jp106 になる - .bash_profile に loadkeys jp106 を設定 *** その他パッケージとしてインストールしたもの [#a6b19f34] - vim - nano - ssh ( rsync の接続でも利用する ) - ftp (slirp 場合には pftp というパッシブモードの接続を利用する必要がある) - gcc (PC 用の native コンパイラ) ** 英語辞書を使えるように [#b7f3c55e] ー 辞書ビューワーには Ubuntu のパッケージとして提供される EBView というアプリを利用した - 辞書データは 英辞郎 バージョン116 を利用 ーー PDIC Unicode 版(5.3.4) の辞書設定(詳細)から辞書を指定し、右クリックで変換を行う。PDIC 一行テキスト形式でファイルを生成 -- エディタでファイルを開きファイル形式を UTF16 から Shift-JIS 形式に変更してファイルを保存 -- [[EVStudio:http://www31.ocn.ne.jp/~h_ishida/EBStudio.html]] というソフトを利用して、ファイルを PDIC 1行形式でJIS-X4081(EPWINGのサブセット)ファイルを生成させる、ここまでは windows での作業 ---- &ref(ebstd170b.exe); --- EBStudioを開いたら,<ファイル>の<開く>で好きな形式のebsファイルを開く(どれでもよい) --- &color(red){ただし,入力ファイル名ペインにあるファイル名は右クリックして<修正>で,PDIC 1行テキスト形式を選び,入力ファイル名も適当なものにする}; -- 生成したファイルを Ubuntu にコピーし、EBView で辞書を指定する --- この時 UTF-8 にコード変換する必要はない - http://euda.cocolog-nifty.com/scosco/2008/09/ebview-4ca6.html * メールサーバー証明書作成 ーーーー web は公式証明書だが、メールは独自(なんちゃって)で十分 [#db6d8747] *** 参考 URL = http://www.kazutoyo.com/ubuntu/ [#scaa20ce] *** デフォルト環境の初期化 [#cf4b423f] root@spirit:/root# sudo -s root@spirit:/root# cd /etc/ssl/CA root@spirit:/etc/ssl/CA# cat /dev/null > index.txt root@spirit:/etc/ssl/CA# echo '01' > serial root@spirit:/etc/ssl/CA# echo '01' > crlnumber *** 秘密鍵の作成 [#vdca07f7] root@spirit:/etc/ssl/CA# openssl genrsa -out private/cakey.pem 1024 Generating RSA private key, 1024 bit long modulus ......................................................................................................................... ++++++ ...............++++++ e is 65537 (0x10001) root@spirit:/etc/ssl/CA# ls -l private/ 合計 4 -rw-r--r-- 1 root root 887 2010-03-21 10:59 cakey.pem *** 秘密鍵を使って証明書を作成 [#q39d98ea] - -daysオプションで有効期限を10年と設定 root@spirit:/etc/ssl/CA# openssl req -new -x509 -days 3560 -key private/cakey.pem -out cacert.pem You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [JP]:JP State or Province Name (full name) [Kanagawa]:Kanagawa Locality Name (eg, city) []:Yokohama Organization Name (eg, company) [IT admin]:hmuna Organizational Unit Name (eg, section) [IT]: Common Name (eg, YOUR name) []:mail.hmuna.com Email Address []:server-admin@hmuna.com *** サーバ証明書の作成 [#n0c4fcb9] - サーバ証明書作成はまず署名リクエスト(CSR)を作成し、それをCAで署名して作ります - 場所は /etc/ssl/Server にします (Ubuntu のデフォルト) ーー 秘密鍵の作成 root@spirit:/etc/ssl/Servr# openssl genrsa -out private.pem 1024 Generating RSA private key, 1024 bit long modulus ........................++++++ .......++++++ e is 65537 (0x10001) ーー 認証局に署名してもらう為リクエストを作成 root@spirit:/etc/ssl/Servr# openssl req -new -key private.pem -out request.pem You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [JP]:JP State or Province Name (full name) [Kanagawa]:Kanagawa Locality Name (eg, city) []:Yokohama Organization Name (eg, company) [IT admin]: Organizational Unit Name (eg, section) [IT]: Common Name (eg, YOUR name) []:mail.hmuna.com Email Address []:server-admin@hmuna.com Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []: <-------- 空でエンター An optional company name []: <-------- 空でエンター ーー CAで署名 root@spirit:/etc/ssl/Servr# cp /etc/ssl/openssl.cnf ./. root@spirit:/etc/ssl/Servr# openssl ca -config openssl.cnf -policy policy_anything -out ./cert-ca.pem -infiles request.pem Using configuration from openssl.cnf Check that the request matches the signature Signature ok Certificate Details: Serial Number: 1 (0x1) Validity Not Before: Mar 21 02:03:39 2010 GMT Not After : Mar 18 02:03:39 2020 GMT Subject: countryName = JP stateOrProvinceName = Kanagawa localityName = Yokohama organizationName = IT admin organizationalUnitName = IT commonName = mail.hmuna.com emailAddress = server-admin@hmuna.com X509v3 extensions: X509v3 Basic Constraints: CA:FALSE Netscape Cert Type: SSL Server Netscape Comment: OpenSSL Generated Certificate X509v3 Subject Key Identifier: BF:B1:75:09:3E:34:61:DF:40:BC:CE:1B:A9:92:48:9A:C9:17:89:F7 X509v3 Authority Key Identifier: keyid:98:A8:56:F1:51:52:00:91:29:4B:CA:FA:62:BF:4B:BB:ED:15:A7:11 Certificate is to be certified until Mar 18 02:03:39 2020 GMT (3650 days) Sign the certificate? [y/n]:y 1 out of 1 certificate requests certified, commit? [y/n]y Write out database with 1 new entries Data Base Updated *** メールサーバ用の証明書はサーバ証明書だけ抜き取る [#x295fff2] root@spirit:/etc/ssl/Servr# openssl x509 -in cert-ca.pem -out cert.pem *** MUA用には証明書と秘密鍵から作成 [#y4df0316] root@spirit:/etc/ssl/Servr# cat private.pem cert.pem > mail.pem *** 作成したサーバ証明書とCA証明書が正常に作成できたか確認 [#dea55b06] root@spirit:/etc/ssl/Servr# openssl verify -CAfile /etc/ssl/CA/cacert.pem cert-ca.pem cert-ca.pem: OK root@spirit:/etc/ssl/Servr# openssl verify -CAfile /etc/ssl/CA/cacert.pem cert.pem cert.pem: OK *** Windowsなどのクライアントに証明書をインストールするための ca.der を作成 ----> &ref(ca.der); [#x5927841] - メールの送受信も暗号化された通信を使えません - クライアントからWebにアクセスしようとするとブラウザーの警告メッセージが毎回表示される root@spirit:/etc/ssl/Servr# cd /etc/ssl/CA root@spirit:/etc/ssl/CA# openssl x509 -inform pem -in cacert.pem -out ca.der -outform der *** tsl key 作成 [#p1ec3fb7] - 鍵と証明書の作成 root@spirit:/etc/ssl/tlskey# openssl req -new -x509 -days 3650 -nodes -out shoumei.pem -keyout himitsu.key Generating a 1024 bit RSA private key ..++++++ ...........++++++ writing new private key to 'himitsu.key' ----- You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [JP]:JP State or Province Name (full name) [Kanagawa]:Kanagawa Locality Name (eg, city) []:Yokohama Organization Name (eg, company) [IT admin]:IT admin Organizational Unit Name (eg, section) [IT]:IT Common Name (eg, YOUR name) []:mail.hmuna.com Email Address []:server-admin@hmuna.com root@spirit:/etc/ssl/tlskey# ls -l 合計 8 -rw-r--r-- 1 root root 887 2010-05-03 14:39 himitsu.key -rw-r--r-- 1 root root 1350 2010-05-03 14:39 shoumei.pem - クライアント証明書の作成 root@spirit:/etc/ssl/tlskey# openssl x509 -inform pem -outform der -in shoumei.pem -out shoumei.der root@spirit:/etc/ssl/tlskey# ls -l 合計 12 -rw-r--r-- 1 root root 887 2010-05-03 14:39 himitsu.key -rw-r--r-- 1 root root 955 2010-05-03 14:42 shoumei.der -rw-r--r-- 1 root root 1350 2010-05-03 14:39 shoumei.pem - 鍵と証明書の統合 root@spirit:/etc/ssl/tlskey# cat shoumei.pem himitsu.key > courier.pem
テキスト整形のルールを表示する
添付ファイル:
ebstd170b.exe
65件
[
詳細
]
ca.der
31件
[
詳細
]