すべてのファイルを 1 つのパーティションに (初心ユーザ者には推奨)
SCSI8 (0,0,0) (sda) - 1.0 TB ATA Hitachi HDT72101 > 1. 基本 995.9 GB B f ext4 / > 2. 倫理 4.3 GB f スワップ スワップ SCSI9 (0,0,0) (sdb) - 1.0 TB ATA Hitachi HDT72101 > 1. 基本 995.9 GB f ext4 /bk > 2. 倫理 4.3 GB f スワップ スワップ
既に記述されているものに以下の記述を追加
deb http://dennou-k.gfd-dennou.org/debian/ wheezy main contrib non-free deb-src http://dennou-k.gfd-dennou.org/debian/ wheezy main contrib non-free deb http://security.debian.org/ wheezy/updates main contrib non-free deb-src http://security.debian.org/ wheezy/updates main contrib non-free deb http://dennou-k.gfd-dennou.org/debian/ wheezy-updates main contrib non-free deb-src http://dennou-k.gfd-dennou.org/debian/ wheezy-updates main contrib non-free
基本的にいらない.管理者の任意
# aptitude update # aptitude install ****インストールすべきパッケージ ※ただしデフォルトでインストールされているものもある(今回デフォルトでInstall されているものは,パッケージ名の前に$ が記入してある.インストールしていないものは# . )
# vi /etc/ssh/sshd_config
PermitRootLogin no
/etc/locale.gen で ja_JP.EUC-JP, ja_JP.UTF-8 のコメントアウトをはずす.
# vi /etc/locale-gen
環境変数 LANG の設定(ssh をいれて以下のURL にあるファイルをコピーすれば楽)
# vi .bash_profile
--------
# ~/.bash_profile: executed by bash(1) for login shells.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
export LANG=ja_JP.UTF-8
export LC_ALL=ja_JP.UTF-8
# the default umask is set in /etc/login.defs
umask 022
# include .bashrc if it exists
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# set PATH so it includes user's private bin if it exists
if [ -d ~/bin ] ; then
PATH=~/bin:"${PATH}"
fi
-------
変更を反映
$ source ~/.bash_profile
log を保存する期間(日数)をデフォルトの 7 から 90 に変更する.
# vi /etc/cron.daily/sysklogd
test -x /usr/sbin/syslogd-listfiles || exit 0
test -x /sbin/syslogd || exit 0
test -f /usr/share/sysklogd/dummy || exit 0
set -e
cd /var/log
logs=$(syslogd-listfiles)
test -n "$logs" || exit 0
for LOG in $logs
do
if [ -s $LOG ]; then
savelog -g adm -m 640 -u root -c 90 $LOG >/dev/null
fi
done
# Restart syslogd
#
/etc/init.d/sysklogd reload-or-restart > /dev/null同様に, log を保存する期間(週数)をデフォルトの 4 から 12 に変更する.
# vi /etc/cron.weekly/sysklogd savelog -g adm -m 640 -u root -c 12 $LOG >/dev/null
インストールは os インストールのときにやった
!注意! 結局失敗した. やり直したログは apache2 インストール を参照のこと.
/etc/apache/apache2.conf を設定する.
$ cd /etc/apache2 # vi apache2.conf
/etc/apache2/site-available/default の設定
$ cd /etc/apache2/sites-available # vi default
/etc/apache2/mods-available/dir.conf の設定
$ cd /etc/apache2/mods-available # vi dir.conf
userdir モジュールと dir モジュールを有効化
# a2enmod userdir # a2enmod dir os インストールと同時に apache をインストールした場合, dir は既に有効化されている.
apache の再起動
# /etc/init.d/apache2 restart
Openssl.cnf の編集
# vi /etc/ssl/openssl.cnf
default_days = 400 # how long to certify for
nsCertType=server のコメントアウトを外す
nsCertType=sslCA, emailCA のコメントアウトを外す
countryName_default = JA stateOrProvinceName_default = Hokkaido organizationName_default = Department of Science organizationalUnitName_default = Earth and Planetary science
証明書の発行
# cd /usr/lib/ssl/misc # ./CA.sh -newca
Making CA certificate ... Generating a 1024 bit RSA private key .++++++ ..............++++++ writing new private key to './demoCA/private/./cakey.pem' Enter PEM pass phrase: Verifying - Enter PEM pass phrase: ----- 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) [JA]: State or Province Name (full name) [Hokkaido]: Locality Name (eg, city) []:Sapporo Organization Name (eg, company) [Department of Science]: Organizational Unit Name (eg, section) [Earth and Planetary science]: Common Name (eg, YOUR name) []:www.ep.sci.hokudai.ac.jp Email Address []:epwww.ep.sci.hokudai.ac.jp
Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []: An optional company name []: Using configuration from /usr/lib/ssl/openssl.cnf Enter pass phrase for ./demoCA/private/./cakey.pem: 10797:error:28069065:lib(40):UI_set_result:result too small:ui_lib.c:850:You must type in 4 to 8191 characters Enter pass phrase for ./demoCA/private/./cakey.pem: Check that the request matches the signature Signature ok Certificate Details:
Serial Number:
f1:44:1b:72:4d:69:8d:0a
Validity
Not Before: Sep 25 11:21:49 2011 GMT
Not After : Sep 24 11:21:49 2014 GMT
Subject:
countryName = JA
stateOrProvinceName = Hokkaido
organizationName = Department of Science
organizationalUnitName = Earth and Planetary science
commonName = www.ep.sci.hokudai.ac.jp
emailAddress = epwww.ep.sci.hokudai.ac.jp
X509v3 extensions:
X509v3 Subject Key Identifier:
0A:D6:3A:35:F0:2A:08:0A:15:99:8F:5D:36:24:E2:72:0C:8D:63:F1
X509v3 Authority Key Identifier:
keyid:0A:D6:3A:35:F0:2A:08:0A:15:99:8F:5D:36:24:E2:72:0C:8D:63:F1
DirName:/C=JA/ST=Hokkaido/O=Department of Science/OU=Earth and Planetary science/CN=www.ep.sci.hokudai.ac.jp/emailAddress=epwww.ep.sci.hokudai.ac.jp
serial:F1:44:1B:72:4D:69:8D:0A
X509v3 Basic Constraints:
CA:TRUE
Netscape Cert Type:
SSL CA, S/MIME CA
Certificate is to be certified until Sep 24 11:21:49 2014 GMT (1095 days)
Write out database with 1 new entries Data Base Updated
パスフレーズの消去
# openssl rsa -in ./demoCA/private/cakey.pem -out ./demoCA/private/cakey.pem
証明書の作成
# openssl x509 -in ./demoCA/cacert.pem -out ./demoCA/cacert.crt
ブラウザに import する der の作成
# openssl x509 -inform pem -in ./demoCA/cacert.pem -outform der -out ./demoCA/ca.der
apache2 の ssl の設定
# mkdir /etc/apache2/ssl # cp ./demoCA/cacert.crt /etc/apache2/ssl # mkdir /etc/apache2/ssl/private # cp ./demoCA/private/cakey.pem /etc/apache2/ssl/private/ # cd /etc/apache2/sites-available/ # cp /usr/share/doc/apache2.2-common/examples/apache2/extra/httpd-ssl.conf.gz . # gzip -d httpd-ssl.conf.gz # mv httpd-ssl.conf ssl
/etc/apache2/sites-available/default-ssl を以下のように変更.
SSLCertificateFile /etc/apache2/ssl/apache.pem SSLCertificateKeyFile /etc/apache2/ssl/apache.pem #SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem #SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
/etc/apache2/ssl/cacert.crt を登録
SSLCertificateFile /etc/apache2/ssl/cacert.crt
/etc/apache2/ssl/private/cakey.pem を登録
SSLCertificateKeyFile /etc/apache2/ssl/private/cakey.pem
VirtualHost や ServerName 等を設定
DocumentRoot "/var/www/" ServerName sango.ep.sci.hokudai.ac.jp ServerAdmin epwww@ep.sci.hokudai.ac.jp
/etc/apache2/sites-available/ssl の修正
# /usr/sbin/make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /etc/apache2/ssl/apa che.pem
ホスト名をきかれるので
sango.ep.sci.hokudai.ac.jp
と記入
# vi /etc/apache2/sites-available/ssl
#SSLCertificateFile "/etc/apache2/ssl/cacert.crt" SSLCertificateFile "/etc/apache2/ssl/apache.pem" #SSLCertificateKeyFile "/etc/apache2/ssl/private/cakey.pem SSLCertificateKeyFile "/etc/apache2/ssl/apache.pem"
設定をチェックして, モジュールとサイトを有効化し再起動
# apache2ctl -t
| 最終更新: 2013/09/17 (渡辺 健介), 作成日: 2013/09/17 (渡辺 健介) | epwww © 2013 |