Linux

April 01, 2009

Postfixでエイリアスを設定

postfixのエイリアスを追加して、rootに届くメールをadminユーザに転送するように試みた。

[root@server root]# cd /etc/postfix
[root@server postfix]# vi aliases
[root@server postfix]# cat aliases
……中略……
# Person who should get root's mail
#root: marc
[root@server postfix]#

と上記のように、最後の行にroot宛てのメールを受け取るユーザを指定するようにコメントがあった。

rootだけで止めておけばいいのに、ついでにwebmaster宛てのメールも受け取るように設定した。

# Person who should get root's mail
#root: marc
root: tarou
webmaster: tarou

newaliasesコマンドを実行して設定を/etc/postfix/aliases.dbに書き込もうとしたところ

[root@server postfix]# newaliases
postalias: warning: /etc/postfix/aliases.db: duplicate entry: "webmaster"

と警告を受けた。rootだけに訂正して、Postfixを再起動した。

[root@server postfix]# newaliases
[root@server postfix]# service postfix restart
Postfixを停止中: [ OK ]
Postfixを起動中: [ OK ]
[root@server postfix]#

これでいいかな。

| | TrackBack (0)

March 14, 2009

VineLinuxにpukiwikiをインストール

ダウンロードしてきたファイルを展開して、展開したフォルダごとリネーム。apacheの実行ユーザとグループに変更する。

[root@server root]# cd /var/www/html
[root@server html]# tar xzvf pukiwiki-1.4.7_notb.tar.gz
[root@server html]# mv pukiwiki-1.4.7_notb ./pukiwiki
[root@server html]# chown -R nobody:nobody ./pukiwiki

マニュアルでは必要なフォルダだけコピーするようになっているが手を抜いて展開したフォルダをそのまま保存した。

[root@server html]# cd pukiwiki
[root@server pukiwiki]# ls -l
合計 208
-rw-r--r-- 1 nobody nobody 18009  8月29日  2004 COPYING.txt
-rw-r--r-- 1 nobody nobody  9134 12月 6日  2005 INSTALL.txt
-rw-r--r-- 1 nobody nobody  2661  5月30日  2006 README.en.txt.gz
-rw-r--r-- 1 nobody nobody 12096  5月30日  2006 README.txt
-rw-r--r-- 1 nobody nobody   934  6月12日  2006 UPDATING.en.txt.gz
-rw-r--r-- 1 nobody nobody 10901  6月12日  2006 UPDATING.txt
drwxrwxrwx 2 nobody nobody  4096 10月22日  2006 attach/
drwxrwxrwx 2 nobody nobody  4096 10月22日  2006 backup/
drwxrwxrwx 2 nobody nobody  4096 10月22日  2006 cache/
drwxrwxrwx 2 nobody nobody  4096 10月22日  2006 counter/
-rw-r--r-- 1 nobody nobody  6767 12月20日  2005 default.ini.php
drwxrwxrwx 2 nobody nobody  4096 10月22日  2006 diff/
-rw-r--r-- 1 nobody nobody 16489  4月11日  2006 en.lng.php
drwxr-xr-x 3 nobody nobody  4096 10月22日  2006 image/
-rw-r--r-- 1 nobody nobody   708  5月13日  2006 index.php
-rw-r--r-- 1 nobody nobody 16598  4月11日  2006 ja.lng.php
-rw-r--r-- 1 nobody nobody 13249 12月10日  2005 keitai.ini.php
drwxr-xr-x 2 nobody nobody  4096 10月22日  2006 lib/
drwxr-xr-x 2 nobody nobody  4096 10月22日  2006 plugin/
-rw-r--r-- 1 nobody nobody 18123  6月11日  2006 pukiwiki.ini.php
-rw-r--r-- 1 nobody nobody  1386 10月 4日  2005 rules.ini.php
drwxr-xr-x 2 nobody nobody  4096 10月22日  2006 skin/
drwxrwxrwx 2 nobody nobody  4096 10月22日  2006 trackback/
drwxrwxrwx 2 nobody nobody  4096 10月22日  2006 wiki/
-rw-r--r-- 1 nobody nobody  6944 10月22日  2006 wiki.en.tgz

パスワードをMD5という方式で生成

[root@server pukiwiki]# echo -n 'password' | md5sum
f562fc3fddec0ea904281c6619501deb  -

pukiwikiの設定ファイルで管理者ユーザ、管理者ホームページのURL、管理者パスワード、3か所を訂正。

[root@server pukiwiki]# vi pukiwiki.ini.php


// Site admin's name (CHANGE THIS)
$modifier = 'user';


// Site admin's Web page (CHANGE THIS)
$modifierlink = 'http://server.mydns.jp/';


/////////////////////////////////////////////////
// Admin password for this Wikisite
// Default: always fail
//$adminpass = '{x-php-md5}!';
$adminpass = '{x-php-md5}f562fc3fddec0ea904281c6619501deb'; // md5('password')

お世話になりましたconfident

> http://pukiwiki.sourceforge.jp/
> http://itpro.nikkeibp.co.jp/article/COLUMN/20060228/231198/

| | TrackBack (0)

March 07, 2009

Vine Linux に SSL接続を導入

認証局の構築

通常は第三者機関に認証してもらうが、有料なので自分で認証局をつくり、自分を認証する

mod_sslのインストール

[root@server root]# apt-get install mod_ssl-apache2
パッケージリストを読みこんでいます... 完了
依存情報ツリーを作成しています... 完了
* mod_ssl-apache2 は既に最新バージョンがインストールされています。
アップグレード: 0 個, 新規インストール: 0 個, 削除: 0 個, 保留: 29 個
[root@server root]#

秘密鍵と証明書の作成

[root@server root]# /usr/share/ssl/misc/CA -newca
CA certificate filename (or enter to create)

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) [AU]:JP
State or Province Name (full name) [Some-State]:Kumamoto
Locality Name (eg, city) []:Kumamoto city
Organization Name (eg, company) [Internet Widgits Pty Ltd]:server's Laboratory
Organizational Unit Name (eg, section) []:Technology department
Common Name (eg, YOUR name) []:server.mydns.jp
Email Address []:owner@server.mydns.jp
[root@server root]# ls
Desktop/ backup.sh* demoCA/ rpm/ upgrade-log
Xrootenv.0 backup.sh~ install.log server.csr www.req
anaconda-ks.cfg backuplist install.log.syslog server.key
backup.list backupnolist mbox serverca.crt
[root@server root]# cd demoCA
[root@server demoCA]# ls -l
合計 24
-rw-r--r-- 1 root root 1468 3月 7日 13:22 cacert.pem ←自己署名型証明書
drwxr-xr-x 2 root root 4096 3月 7日 13:18 certs/
drwxr-xr-x 2 root root 4096 3月 7日 13:18 crl/
-rw-r--r-- 1 root root 0 3月 7日 13:18 index.txt
drwxr-xr-x 2 root root 4096 3月 7日 13:18 newcerts/
drwxr-xr-x 2 root root 4096 3月 7日 13:18 private/
-rw-r--r-- 1 root root 3 3月 7日 13:18 serial
[root@server demoCA]# ls -l private
合計 4
-rw-r--r-- 1 root root 963 3月 7日 13:22 cakey.pem ←秘密鍵

アクセス制限で保護

[root@server demoCA]# chmod 600 ./private/cakey.pem
[root@server demoCA]# chmod 700 ./private

証明書の確認

[root@server demoCA]# openssl x509 -in cacert.pem -text

SSLサーバの構築

サーバ秘密鍵の作成

[root@server demoCA]# cd
[root@server root]# openssl genrsa -out server.key 1024
Generating RSA private key, 1024 bit long modulus
...........................................++++++
........................++++++
e is 65537 (0x10001)
[root@server root]# ls -l server.key
-rw-r--r-- 1 root root 887 3月 7日 13:34 server.key

証明書署名要求(CSR)の作成

[root@server root]# openssl req -new -key server.key -out server.csr
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) [AU]:JP
State or Province Name (full name) [Some-State]:Kumamoto
Locality Name (eg, city) []:Kumamoto city
Organization Name (eg, company) [Internet Widgits Pty Ltd]:server's Laboratory
Organizational Unit Name (eg, section) []:Technology department
Common Name (eg, YOUR name) []:server.mydns.jp
Email Address []:owner@server.mydns.jp

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
[root@server root]# ls -l server.*
-rw-r--r-- 1 root root 757 3月 7日 13:50 server.csr ←証明書署名要求(CSR)
-rw-r--r-- 1 root root 887 3月 7日 13:34 server.key
[root@server root]#

証明書に自己署名
実際は第三者証明機関にCSRを送って署名してもらう

[root@server root]# openssl ca -out serverca.crt -infiles server.csr
Using configuration from /usr/share/ssl/openssl.cnf
Enter pass phrase for ./demoCA/private/cakey.pem:
Check that the request matches the signature
Signature ok
Certificate Details:
Serial Number: 1 (0x1)
Validity
Not Before: Mar 7 05:04:18 2009 GMT
Not After : Mar 7 05:04:18 2010 GMT
Subject:
countryName = JP
stateOrProvinceName = Kumamoto
organizationName = server's Laboratory
organizationalUnitName = Technology department
commonName = server.mydns.jp
emailAddress = owner@server.mydns.jp
X509v3 extensions:
X509v3 Basic Constraints:
CA:FALSE
Netscape Comment:
OpenSSL Generated Certificate
X509v3 Subject Key Identifier:
92:2D:E5:47:42:76:E2:B6:31:7C:3D:43:4F:03:08:B1:A0:1E:F2:F6
X509v3 Authority Key Identifier:
keyid:5F:E1:7A:66:65:3D:EB:7B:A9:4E:4F:F3:B4:A0:69:E6:C1:18:DD:99
DirName:/C=JP/ST=Kumamoto/L=Kumamoto city/O=server's Laboratory/OU=Technology department/CN=server.mydns.jp/emailAddress=owner@server.mydns.jp
serial:DF:6A:E3:03:D7:08:84:6A

Certificate is to be certified until Mar 7 05:04:18 2010 GMT (365 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
[root@server root]# ls -l server*.*
-rw-r--r-- 1 root root 761 3月 7日 14:03 server.csr
-rw-r--r-- 1 root root 887 3月 7日 13:34 server.key
-rw-r--r-- 1 root root 3922 3月 7日 14:04 serverca.crt ←サーバの証明書
[root@server root]# chmod 400 server*.*
[root@server root]# ls -l
合計 8
-r-------- 1 root root 887 3月 7日 13:34 server.key
-rw------- 1 root root 3922 3月 7日 14:04 serverca.crt
[root@server ssl]#

サーバ証明書を規定の場所に移動する

[root@server root]# mkdir /etc/apache2/conf/ssl
[root@server root]# mv server.key /etc/apache2/conf/ssl.key/
[root@server root]# mv serverca.crt /etc/apache2/conf/ssl.crt/seerver.crt
[root@server root]#

apache2を再起動

[root@server conf]# service apache2 restart
httpdを停止中:                                             [  OK  ]
httpdを起動中:                                             [  OK  ]
[root@server conf]# netstat -a | grep http*
tcp 0 0 *:http *:* LISTEN
tcp 0 0 *:https *:* LISTEN
[root@server conf]#

ブロードバンドルータのNAT指定とファイアウォールの設定。
テストはhttps://server.mydns.jp:443/にアクセス。

設定してページが表示できた。証明書も表示できた。期限も正しく設定されている。
これでいいっかな。(^-^;

| | TrackBack (0)

February 22, 2009

Vine Linux に MRTG を導入

Vine LinuxにMRTGを導入しようと試みた。


[root@xxxxx root]# apt-cache search mrtg
bmon - ネットワークインターフェースのモニタ
perl-File-Tail - Perl extension for reading from continously updated files
mrtg - Multi Router Traffic Grapher

パッケージが存在したのでパッケージからインストールする。

[root@xxxxx root]# apt-get install mrtg

インストールされた場所を探す

[root@xxxxx root]# find / -name mrtg.conf
/etc/apache2/conf.d/mrtg.conf

[root@xxxxx root]# # find / -name mrtg
/var/cache/mrtg
/var/www/mrtg
/var/lib/mrtg
/usr/share/doc/mrtg-2.16.1/contrib/mrtg-startup-script/mrtg
/usr/bin/mrtg
/home/mrtg

[root@xxxxx root]# find / -name cfgmaker
/usr/bin/cfgmaker

[root@xxxxx root]# find / -name mrtg.cfg
/etc/mrtg.cfg
/usr/share/doc/mrtg-2.16.1/contrib/TCH/mrtg.cfg
/usr/share/doc/mrtg-2.16.1/contrib/mrtgmk/cfg/mrtg.cfg
/usr/share/doc/mrtg-2.16.1/contrib/accesslistmon/mrtg.cfg
/usr/share/doc/mrtg-2.16.1/contrib/stat/mrtg.cfg

設定ファイルを自動作成

[root@xxxxx root]# /usr/bin/cfgmaker --output=/etc/mrtg.cfg --global "WorkDir: /var/www/html/mrtg" --global "Language: eucjp" --global "IconDir: ./icons" public@192.168.xxx.xxx

MRTGを起動

[root@xxxxx root]# /usr/bin/mrtg /etc/mrtg.cfg

SNMPが動いていなかったのでnet-snmpをパッケージからインストールして
MRTGの起動を確認

WEBブラウザで表示できない。エラーログの内容


[Wed Feb 18 22:04:37 2009] [error] [client xxx.xxx.xxx.xxx] client denied by server configuration: /var/www/mrtg/192.168.xxx.xxx_2.html

Apache が /etc/apache2/conf.d/mrtg.conf を読み込んでいた。
Allow from xxx.xxx.xxx.xxx を追加してOK。

お世話になりました。


> http://www.mrtg.jp/
> http://www.atmarkit.co.jp/flinux/rensai/root08/root08a.html
> http://www.aconus.com/~oyaji/mrtg/mrtg_linux.htm
> http://www.aconus.com/~oyaji/bbs/past/0004/B0002540.html
> http://vine.1-max.net/net-snmp+MRTG.html
> http://blog.goo.ne.jp/takawaguchi/e/01bc4f7426ebe80b97ed752d3024867a
> http://httpd.apache.org/docs/2.2/mod/mod_authz_host.html#allow

| | TrackBack (0)

October 03, 2008

メールサーバの構築

◆SMTPサーバの設定 Postfixのインストール

# apt-get -h
# apt-get install postfix
postfixの設定ファイルは/etc/postfixにある
# vi /etc/postfix/main.cf

ドメイン名やホスト名を設定する。

myhostname = myhost.mydns.jp
mydomain = myhost.mydns.jp
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, $mydomain

プロバイダのOutbound Port 25 Block対策としてMyDNS.JPのメールリレーサービス試験を利用させてもらうためにrelayhostを変更

relayhost = [auth.gate-on.net]:587

不正中継を避けるために以下のパラメータを最後に追加した。
「allow_percent_hack = yes」はエラーとなったのでとりあえずコメントアウトしている

smtpd_helo_required = yes
disable_vrfy_command = yes
strict_rfc821_envelopes = yes
#allow_percent_hack = yes
swap_bangpath = yes
allow_untrusted_routing = no
smtpd_client_restrictions = permit_mynetworks, reject_unknown_client, permit
smtpd_helo_restrictions = permit_mynetworks, reject_invalid_hostname, reject_unknown_client, permit
smtpd_recipient_restrictions = permit_mynetworks, reject_sender_login_mismatch, check_relay_domains
smtpd_sender_restrictions = reject_unknown_sender_domain, reject_sender_login_mismatch
smtpd_etrn_restrictions = permit_mynetworks, reject_invalid_hostname

postfixを起動

# /usr/sbin/postfix reload
postfix/postfix-script: refreshing the Postfix mail system
#
# chkconfig --list postfix
postfix 0:off 1:off 2:on 3:on 4:on 5:on 6:off
#

telnetで送信を試してみる

C:\> telnet myserver.mydns.jp 25
220 myserver.mydns.jp ESMTP Postfix
EHLO an-user
250-myserver.mydns.jp
250-PIPELINING
250-SIZE 10240000
250-ETRN
250 8BITMIME
MAIL FROM: 
250 Ok
RCPT TO: 250 Ok
DATA
354 Start mail input; end with .
Subject: これはテストメールです
From: an-user@myserver.mydns.jp
To: an-user@myserver.mydns.jp
こんにちは
私は人間です
ありがとう
.
250 Ok: queued as D1DDFB9DD0
QUIT
221 Bye
 
ホストとの接続が切断されました。
 
C:\>

【参考にしたページ】http://www.jitaku-server.net/postfix_setup.html

◆POPサーバの設定
xinetdとqpopperをインストールする

# apt-get install xinetd
パッケージリストを読みこんでいます... 完了
依存情報ツリーを作成しています... 完了
以下のパッケージが新たにインストールされます:
xinetd
アップグレード: 0 個, 新規インストール: 1 個, 削除: 0 個, 保留: 0 個
136kB のアーカイブを取得する必要があります。
展開後に 249kB のディスク容量が追加消費されます。
取得:1 http://updates.vinelinux.org 4.2/i386/plus xinetd 2.3.14-0vl2 [136kB]
136kB を 0s 秒で取得しました (270kB/s)
変更を適用しています...
準備中... ########################################### [100%]
1:xinetd ########################################### [100%]
完了
#

setupで「システムサービス設定」を選択しqpopperに*をつける。

# setup
Photo Qpopper

xinetdを再起動するとqpopperが動き始める。

# /sbin/service xinetd reload
設定を再読み込み: [ OK ]
#
# chkconfig --list qpopper
qpopper on
# chkconfig --list xinetd
xinetd 0:off 1:off 2:off 3:on 4:on 5:on 6:off
#

telnetで受信してみる

C:\>telnet myserver.mydns.jp 110
+OK Qpopper (version 4.0.9) at myserver.mydns.jp starting. <8916.1223014669@myserver.mydns.jp>
USER an-user
+OK Password required for an-user.
PASS ****************
+OK an-user has 1 visible message (0 hidden) in 602 octets.
RETR 1
+OK 602 octets
Return-Path: 
X-Original-To: an-user@myserver.mydns.jp
Delivered-To: an-user@myserver.mydns.jp
Received: from an-user (i125-206-43-171.s30.a048.ap.plala.or.jp [125.206.43.171])
by myserver.mydns.jp (Postfix) with ESMTP id D1DDFB9DD0
for ; Fri, 3 Oct 2008 15:12:59 +0900 (JST
Subject: これはテストメールです
From: an-user@myserver.mydns.jp
To: an-user@myserver.mydns.jp
Message-Id: <20081003061326.D1DDFB9DD0@myserver.mydns.jp>
Date: Fri, 3 Oct 2008 15:12:59 +0900 (JST)
X-UIDL: &B1"!Y[?"!:5%#!6"7"!
 
こんにちは
私は人間です
ありがとう
 
.
QUIT
+OK Pop myserver at myserver.mydns.jp signing off.
 
ホストとの接続が切断されました。
 
C:\>

メーラからも送受信してみる。うまくいった。とりあえずメールサーバとして機能するようになった。よかった。気を良くしてWEBサーバの設定に取り組もう。

【参考にしたページ】http://nlogn.ath.cx/archives/000917.html

| | TrackBack (0)

September 16, 2008

NTP(Network Time Protocol)

時刻合わせを自動的にできるように設定
NTPサーバは以下のURLで確認


http://www.venus.dti.ne.jp/~yoshi-o/NTP/NTP-Table.html

設定ファイルを編集
福岡大学のサーバ2つとOCNのサーバ1つを追加

# cat /etc/ntp.conf
 
#
# Undisciplined Local Clock. This is a fake driver intended for backup
# and when no outside source of synchronized time is available. The
# default stratum is usually 3, but in this case we elect to use stratum
# 0. Since the server line does not have the prefer keyword, this driver
# is never used for synchronization, unless no other other
# synchronization source is available. In case the local host is
# controlled by some external source, such as an external oscillator or
# another protocol, the prefer keyword would cause the local host to
# disregard all other synchronization sources, unless the kernel
# modifications are in use and declare an unsynchronized condition.
#
#server 127.127.1.0 # local clock ←コメントアウト
#fudge 127.127.1.0 stratum 10 ←コメントアウト
server clock.nc.fukuoka-u.ac.jp
server clock.tl.fukuoka-u.ac.jp
server ntp-os01.ocn.ad.jp
 
#
# Drift file. Put this in a directory which the daemon can write to.
# No symbolic links allowed, either, since the daemon updates the file
# by creating a temporary in the same directory and then rename()'ing
# it to the file.
#
driftfile /etc/ntp/drift
#multicastclient # listen on default 224.0.1.1 ←コメントアウト
broadcastdelay 0.008
 
#
# Keys file. If you want to diddle your server at run time, make a
# keys file (mode 600 for sure) and define the key number to be
# used for making requests.
#
# PLEASE DO NOT USE THE DEFAULT VALUES HERE. Pick your own, or remote
# systems might be able to reset your clock at will. Note also that
# ntpd is started with a -A flag, disabling authentication, that
# will have to be removed as well.
#
#keys /etc/ntp/keys ←コメントアウト
#

NTPを起動

#
# /etc/rc.d/init.d/ntpd start
ntpdを起動中: [ OK ]
#

NTPの同期状態を確認してみたが、まだ同期できていない。

#
# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
clock.nc.fukuok .GPS. 1 u 29 64 1 13.511 -56199. 0.004
clock.tl.fukuok .GPS. 1 u 27 64 1 383.488 -56053. 0.004
ntp-os01.ocn.ad 202.234.233.104 3 u 27 64 1 21.452 -56199. 0.004
#

しばらくして確認してみると同期できていた。

#
# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
*clock.nc.fukuok .GPS. 1 u 34 64 377 11.014 0.907 22.729
+clock.tl.fukuok .GPS. 1 u 97 1024 73 12.036 36.429 48.269
+ntp-os01.ocn.ad 202.234.233.104 3 u 488 512 37 17.803 -28.696 12.131
#

NTPを常に起動できるようにする。ランレベル2がoffだったのでonに設定。

#
# chkconfig ntpd on
# chkconfig --list ntpd
ntpd 0:off 1:off 2:off 3:on 4:on 5:on 6:off
# chkconfig --level 2 ntpd on
# chkconfig --list ntpd
ntpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
#

| | TrackBack (0)

August 31, 2008

DICEのインストール

サーバー公開の1段階としてieServerに登録した。
Vine Linux Box PC-VU50L25DにDiCE DynamicDNS Client (for Linux)をインストールしてIPアドレスが変わっても自動的にieServerに登録できるようにする。

#
# cd bin
# pwd
/usr/local/bin
#

ダウンロード先のアドレスはCGIでwgetコマンドではダウンロードできなかった。
http://www.hi-ho.ne.jp/cgi-bin/user/yoshihiro_e/download.cgi?p=diced019

WindowsでダウンロードしてFTPで転送した。

いつも動作していないFTPを起動

#
# /etc/init.d/proftpd start
ProFTPdを起動中: [ OK ]
#

ダウンロードしたDICEをFTPで転送

#
>ftp 192.168.xxx.xxx
Connected to 192.168.xxx.xxx.
220 FTP OK
User (192.168.xxx.xxx:(none)): muneyoshi
331 Password required for muneyoshi.
Password:
230 User muneyoshi logged in.
ftp> pwd
257 "/home/muneyoshi" is current directory.
ftp> bin
200 Type set to I
ftp> put diced01914.tar.gz .
200 PORT command successful
550 .: Not a regular file
ftp> put diced01914.tar.gz
200 PORT command successful
150 Opening BINARY mode data connection for diced01914.tar.gz
226 Transfer complete.
ftp: 1094082 bytes sent in 0.25Seconds 4358.89Kbytes/sec.
ftp> bye
221 Goodbye.
#

DICEをインストールするディレクトリにコピーして展開

#
# cp /home/muneyoshi/diced01914.tar.gz .
# ls -l
合計 1076
-rw-r--r-- 1 root root 1094082 8月31日 13:44 diced01914.tar.gz
# tar xzvf diced01914.tar.gz
#

DICEを実行

#
# /usr/local/bin/DiCE/diced
=-=-=- DiCE DynamicDNS Client -=-=-=
Version 0.19 for Japanese
Copyright(c) 2001 sarad

:?
*** 起動オプション ***

diced [-s|-d|-h|-e] [-b] [-l]

-s 起動と同時に開始します
-d 起動と同時にバックグラウンドで開始します
-h コマンドオプションを表示します
-b イベント実行時にビープ音を鳴らします
-l ログを作成します
-e 指定のイベントを実行して終了します


*** コマンド一覧 ***

exit DiCEを終了します
start DiCEを開始します
startd DiCEをバックグラウンドで開始します
setup DiCEの環境設定を行います
list 登録済のイベント一覧を表示します
add イベントを追加します
ed[it] <番号> イベントを編集します
del <番号> イベントを削除します
en[able] <番号> イベントを有効にします
dis[able] <番号> イベントを無効にします
ev[ent] <番号> イベントの情報を表示します
ex[ec] <番号> イベントを今すぐ実行します
logcr ログをクリアします
:setup
IPアドレスの検出方法を指定してください
(0) 自動検出
(1) ローカルのネットワークアダプタから検出
(2) 外部のスクリプトから検出
<現在:0>
(N)変更しない (P)戻る
>n
-------------------------------------------------
プライベートIPアドレスも検出対象ですか? (Y/N)
<現在:いいえ>
(P)戻る
>n
-------------------------------------------------
IPアドレスの検出をテストしますか? (Y/N)
(P)戻る
>y
検出IPアドレス>124.101.97.117
-------------------------------------------------
IPアドレスの検出をテストしますか? (Y/N)
(P)戻る
>n
-------------------------------------------------
IPアドレスをチェックする間隔を指定してください(分)
設定可能範囲は5分以上です
<現在:10>
(N)変更しない (P)戻る
>n
=================================================
DNSサーバーの負荷を軽減するために頻繁なDNS更新を防ぐ必要があります
前回の更新から一定時間DNS更新処理を行わないように保護時間を設定して
ください(分) 設定可能範囲は10分から1440分です
<現在:10>
(N)変更しない (P)戻る
>n
=================================================
設定を保存しますか? (Y/N)
(P)戻る
>y
設定を保存しました
=================================================
:

DICEにイベントを追加する

#
:add
新しくイベントを追加します

DynamicDNSサービス名を入力してください
"?"で対応しているサービスを一覧表示します
(P)戻る
>ieServer
-------------------------------------------------
<< ieServer Project >>
URL: http://www.ieserver.net/
*** 情報 ***
IPアドレスはサーバー側で自動検出します。
IPアドレスの指定は出来ません。
(入力しても無視されます)
=================================================
ドメイン名を入力してください
"?"でドメイン一覧を表示します
(P)戻る
>dip.jp
=================================================
ホスト名を入力してください
(P)戻る
>emkei
=================================================
ログインユーザ名を入力してください
(P)戻る
>********
=================================================
ログインパスワードを入力してください
(P)戻る
>********
=================================================
登録するIPアドレスを入力してください
空白にすると現在のIPアドレスを自動検出します
(P)戻る
>
=================================================
このイベントに題名を付けてください
(P)戻る
>emkei
=================================================
このイベントを実行するスケジュールを設定します
-------------------------------------------------
実行する頻度を指定してください (番号入力)
(0)1回のみ (1)1日1回 (2)1週間に1回 (3)1ヵ月に1回
(4)その他の周期 (5)IPアドレス変化時 (6)起動時
(P)戻る
>5
-------------------------------------------------
IPアドレスがあまり変化しない環境の場合、更新せずに一定期間を過ぎると
アカウントを削除されてしまうことがあります
IPアドレスの変化が無い時に実行する間隔を指定してください
(0)7日毎 (1)14日毎 (2)21日毎 (3)28日毎
(4)35日毎 (5)56日毎 (6)84日毎
(P)戻る
>0
=================================================
詳細オプションを設定します
-------------------------------------------------
[ オフライン ]
(0)No (1)Yes
番号>0
=================================================
このイベントを有効にしますか? (Y/N)
(イベントの有効/無効は"EN/DIS"コマンドで切替えられます)
>y
=================================================
イベントを保存しますか? (Y/N)
>y
イベント"emkei"を保存しました
=================================================
:exit


DICEを常駐

#
[root@altair bin]# /usr/local/bin/DiCE/diced -d -l
=-=-=- DiCE DynamicDNS Client -=-=-=
Version 0.19 for Japanese
Copyright(c) 2001 sarad

DiCE Daemon Started !!

常駐を確認

#
# ps -C diced
PID TTY TIME CMD
2494 ? 00:00:00 diced
#

サーバー起動時にDiCEが自動実行するように
/usr/local/bin/DiCE/diced -d -l
を/etc/rc.localの最後に追加した

#
# vi /etc/rc.local
# cat /etc/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.


#### Vine stuff: still generate /etc/issue* here

if [ -f /etc/vine-release ]; then
R=$(cat /etc/vine-release)

arch=$(uname -m)
a="a"
case "_$arch" in
_a*) a="an";;
_i*) a="an";;
esac

NUMPROC=`egrep -c "^cpu[0-9]+" /proc/stat`
if [ "$NUMPROC" -gt "1" ]; then
SMP="$NUMPROC-processor "
if [ "$NUMPROC" = "8" -o "$NUMPROC" = "11" ]; then
a="an"
else
a="a"
fi
fi

# This will overwrite /etc/issue at every boot. So, make any changes you
# want to make to /etc/issue here or you will lose them when you reboot.
echo "" > /etc/issue
echo "$R" >> /etc/issue
echo "Kernel $(uname -r) on $a $SMP$(uname -m)" >> /etc/issue

cp -f /etc/issue /etc/issue.net
echo >> /etc/issue
fi

#### Vine stuff ends here


touch /var/lock/subsys/local
/usr/local/bin/DiCE/diced -d -l
#

再起動してDICEが常駐していることを確認

$
$ ps -f -C diced
UID PID PPID C STIME TTY TIME CMD
root 1914 1 0 14:38 ? 00:00:00 /usr/local/bin/DiCE/diced -d -l
$

| | TrackBack (0)

August 09, 2008

Webmin

Linux BOX NEC VU50L/2にインストールしたVineLinuxのGUIはマシンスペック不足で動作がのろい。
WebminをインストールしてWEBブラウザから操作するとグラフィック処理の負荷が少なくなり幾分ストレスが軽減できそうだ。
ファイアウォールを忘れずに許可しておく。

Webminはextras扱いなのでsources.listを編集してアップデートする。

#cp /etc/apt/sources.list /etc/apt/sources.list.org
#vi /etc/apt/sources.list
#cat /etc/apt/sources.list
…略…
# (masters)
rpm [vine] http://updates.vinelinux.org/apt 3.1/$(ARCH) main devel plus extras updates
rpm-src [vine] http://updates.vinelinux.org/apt 3.1/$(ARCH) main devel plus extras updates
…略…
# apt-get update
# apt-get install webmin
# cp /etc/apt/sources.list.org /etc/apt/sources.list

| | TrackBack (0)

SSHクライアントの設定

SSHクライアントはPuTTY(パティ)とPoderosa(ポデローサ)を使う。

FTPでGetした秘密鍵をPuTTYGENで変換してPuTTYにロード

同じ秘密鍵をPoderosaにもロードしようと試みたがうまくゆかない。
Poderosaで公開鍵と秘密鍵を作成して公開鍵をに送り追加して利用できるようにした。

ひょっとして秘密鍵は1つのクライアントにつき1つだけ。
秘密鍵を複数のパソコンで共有することはできないのかしら。

それはさておき、LinuxボックスはCTUに接続しアダプタモードで接続しているIP電話対応ルータに接続している。同じネットワークにあるWindowsパソコンからはSSHで接続できるようになったが、CTUに直接接続しているWindowsパソコンからは接続できない。

ルーティングテーブルにルートを追加してやる必要がある。

このパソコンはWindoows Vistaで、ルーティングテーブルの追加コマンド ROUTE ADD コマンドは一般ユーザでは実行できないので、コマンドプロンプトを右ボタンでクリックし管理者として開いて実行した。-pは再起動してもルートが保持されるように指定するオプション。デフォルトではパソコンを再起動すると追加したルートは消えてしまう。

C:\>
C:\>route -p ADD 192.168.xxx.0 MASK 255.255.255.0 192.168.24.xxx METRIC 3
OK!
C:\>

これでプライベートのネットワークからは接続できるようになった。

| | TrackBack (0)

July 18, 2008

FTPの起動

FTPの起動
SSHの秘密鍵をWindowsに持ってくる手段としてFTPを動かすことにした。
とりあえずファイアウォールはGUIで使うときだけ開けることにする。

まず、FTPのログローテートを設定する。

#
# su -
パスワード(P):
# mkdir /var/log/proftpd      … ログを保存するディレクトリを作成
# vi /etc/logrotate.d/proftpd   … ログローテートの設定
# cat /etc/logrotate.d/proftpd
/var/log/xferlog {
missingok
notifempty
postrotate
/usr/bin/kill -HUP `cat /var/run/proftpd.pid 2>/dev/null` 2>/dev/null || true
endscript
}
/var/log/proftpd/*.log {
missingok
notifempty
postrotate
/usr/bin/kill -HUP `cat /var/run/proftpd.pid 2>/dev/null` 2>/dev/null || true
endscript
}
[root]#

proftpdのコンフィグを書き換える。

#
# vi /etc/proftpd.conf
# cat /etc/proftpd.conf
# This is a basic ProFTPD configuration file (rename it to
# 'proftpd.conf' for actual use. It establishes a single server
# and a single anonymous login. It assumes that you have a user/group
# "nobody" and "ftp" for normal operation and anon.

#ServerName "ProFTPD Default Installation"
ServerName "FTP Server"
ServerType standalone
DefaultServer on

# FFFTPで.htaccess等の./等で始まるファイルを表示、削除できるようにする
ListOptions "-a"

# 接続された時に表示されるメッセージを記述
ServerIdent on "FTP OK"

# off にして高速に接続
UseReverseDNS off
IdentLookups off

# グループ"admin"以外は自分のホームディレクトリの/public_htmより上位層には行けないように設定
#DefaultRoot ~/public_html !admin

# Port 21 is the standard FTP port.
Port 21

# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask 022

# Use localtime
TimesGMT FALSE

# To prevent DoS attacks, set the maximum number of child processes
# to 30. If you need to allow more than 30 concurrent connections
# at once, simply increase this value. Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd).
MaxInstances 30

# パスワードの入力ミスは3回まで
MaxLoginAttempts 3

# Set the user and group under which the server will run.
User nobody
Group nobody

# iconv patch: set local/remote encoding
# http://www.hakusan.tsg.ne.jp/tjkawa/software/misc/proftpd-iconv/index.jsp
CharsetLocal EUC-JP-MS
# CharsetRemote CP932
CharsetRemote EUC-JP-MS

# Normally, we want files to be overwriteable.

AllowOverwrite on

# Anonymousの設定はすべてコメントアウト
# A basic anonymous configuration, no upload directories.
#

#User ftp
#Group ftp

# We want clients to be able to login with "anonymous" as well as "ftp"
#UserAlias anonymous ftp

# Limit the maximum number of anonymous logins
#MaxClients 10

# do not require shells listed in /etc/shells (user ftp do not have
# shell...)
#RequireValidShell no

# We want 'welcome.msg' displayed at login, and '.message' displayed
# in each newly chdired directory.
#DisplayLogin welcome.msg
#DisplayFirstChdir .message

# Limit WRITE everywhere in the anonymous chroot
#
#DenyAll
#


#



# for Log
LogFormat allinfo "%t : %u (%a [%h]) : [%s], %T, %m (%f)"
LogFormat write "%t : %u : %F (%a)"
LogFormat read "%t : %u : %F (%a)"
LogFormat auth "%t : %u (%a [%h])"

ExtendedLog /var/log/proftpd/all.log ALL allinfo
ExtendedLog /var/log/proftpd/write.log WRITE write
ExtendedLog /var/log/proftpd/read.log READ read
ExtendedLog /var/log/proftpd/auth.log AUTH auth
[root]#


FTPデーモンを起動
#
# /etc/rc.d/init.d/proftpd stop
ProFTPdを停止中: [ OK ]
ProFTPdを起動中: [ OK ]
#

SSHの設定

PuTTYGENで秘密鍵を変換
PuTTYにロードして接続OK

LinuxボックスはCTUに接続しアダプタモードで接続しているIP電話対応ルータに接続している。同じネットワークにあるWindowsパソコンからはSSHで接続できるようになったし、Webminも使えるようになったが、CTUに直接接続しているWindowsパソコンからは接続できない。

このパソコンはWindoows Vistaで、ルーティングテーブルの追加コマンド ROUTE ADD コマンドは一般ユーザでは実行できないので、コマンドプロンプトを右ボタンでクリックし管理者として開いて実行した。

C:\>
C:\>route -p ADD 192.168.xxx.0 MASK 255.255.255.0 192.168.24.xxx METRIC 3
OK!
C:\>

これでプライベートのネットワークからは接続できるようになった。

Webminのインストール
LinuxファイアウォールをGUIで許可
 

| | TrackBack (0)

July 01, 2008

はじめから

Vine Linux BoxであるVU50L/2にハードディスクを増設した。

ハードディスクは他のPCのプライマリ-マスタとしていたWindows98をインストール済みのものである。
デュアルブート構成にしようと試みたがMBRが思い通りに働いてくれない。

通常、Windowsマシンに後からLinuxをインストールしてデュアルブートにするので、マスタにWindows、スレーブにLinuxが入ることになるが、Linux専用機としたPCにWindowsをインストール済みのハードディスクを増設したため、マスタにLinux、スレーブにWindowsという通常とは異なる構成となっている。

グラブの情報を調べる。


 > info grub

以下のように設定したところ動作してデュアルブートが成功した。


 map (hd0) (hd1)
 map (hd1) (hd0)
 rootnoverify (hd0,0)
 makeactive
 chainloader +1

本来、3行目は(hd1,0)でうまく行くはずであるが、(hd0,0)でなくては動作しなかった。不思議だ。
英文読解力の問題か。間違いないと思うのだが、動いたので良しとする。問題があれば、そのとき考える。

Windowsのブートはうまくいったものの、ひとたび起動すると「新しいハードウェアを検出しました」の嵐。
一通り終わると起動したが、画面の解像度は640×480で、16色表示から変更できなくなった。
ドライバが見つからないようだ。Windows98のためかWindows Updateを試しても見つからない。

VU50L/2はWindowsのCDが付属していない。リカバリCDがあるのみ。
NECのサイトでもドライバはみつけることができなかった。

仕方ないので、リカバリーCDを使い工場出荷時の状態に再インストール。
つまり苦労してインストールしたVine Linux 4.2も消えてしまったため、再インストール。
初めからやり直しとなってしまった。やれやれ。

通常の構成でWindowsとLinuxのデュアルブートが完成した。

SSHで入れない。すっかり忘れてしまっているので復習だ。
Configを変更。ログインできるユーザを最後の行に追加。
/etc/ssh/ssh_config


AllowUsers pekepeke

PuTTY(パティ)で接続を試みる。しかし、応答がない。
セキュリティ対策ソフトのファイアウォールも疑ったが問題ない。
このブログに記録しておいたつもりだが見当たらない。

数日悩んで、Vine Linuxにもファイアウォールがあったのを思い出した。

Putty_security_alert
以前は、CUIからファイアウォールを設定しようと苦労した。
GUIからSSHを許可し、入れるようになった。

SSHでログインできるようになったところで、以下のようにセキュリティを強化した。

rootでのログインを拒否
パスワード方式のログインを拒否
パスワードなしのログイン禁止
X11転送を拒否する
rhosts-RSA認証を許可
暗号強度を1024ビットに変更
接続できるユーザを限定

/etc/ssh/ssh_config


PermitRootLogin no
PasswordAuthentication no
PermitEmptyPasswords no
X11Forwarding no
RhostsRSAAuthentication no
ServerKeyBits 1024
AllowUsers hoge

SSH を再起動


# /etc/rc.d/init.d/sshd restart

RSA認証鍵の作成


 鍵の作成
 .ssh/へ移動
公開鍵をauthorized_keysに追加
元の公開鍵を削除
公開鍵のパーミッションを自分のみアクセス可能に変更

$
$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/peke/.ssh/id_rsa):
Created directory '/home/peke/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/peke/.ssh/id_rsa.
Your public key has been saved in /home/peke/.ssh/id_rsa.pub.
The key fingerprint is:
fe:cb:d2:d7:52:a0:5b:d9:a3:fe:5d:1a:6a:84:ed:8a peke@altair
$ cd .ssh
$ cat id_rsa.pub >> authorized_keys
$ rm -f id_rsa.pub
$ chmod 600 authorized_keys
$

| | TrackBack (0)

January 27, 2008

FTP

SSHの秘密鍵を作ったがWindowsに秘密鍵を持ってくる手段がないのでFTPを動かすことにした。
将来的にはFTPは停止してSambaを動かしてみようと思う。

まず、FTPのログローテートを設定する。

[root]#
[user]$ su -
パスワード(P):
[root]# mkdir /var/log/proftpd      … ログを保存するディレクトリを作成
[root]# vi /etc/logrotate.d/proftpd   … ログローテートの設定
[root]# cat /etc/logrotate.d/proftpd
/var/log/xferlog {
missingok
notifempty
postrotate
/usr/bin/kill -HUP `cat /var/run/proftpd.pid 2>/dev/null` 2>/dev/null || true
endscript
}
/var/log/proftpd/*.log {
missingok
notifempty
postrotate
/usr/bin/kill -HUP `cat /var/run/proftpd.pid 2>/dev/null` 2>/dev/null || true
endscript
}
[root]#

proftpdのコンフィグを書き換える。

[root]#
[root]# vi /etc/proftpd.conf
[root]# cat /etc/proftpd.conf
# This is a basic ProFTPD configuration file (rename it to
# 'proftpd.conf' for actual use. It establishes a single server
# and a single anonymous login. It assumes that you have a user/group
# "nobody" and "ftp" for normal operation and anon.

#ServerName "ProFTPD Default Installation"
ServerName "FTP Server"
ServerType standalone
DefaultServer on

# FFFTPで.htaccess等の./等で始まるファイルを表示、削除できるようにする
ListOptions "-a"

# 接続された時に表示されるメッセージを記述
ServerIdent on "FTP OK"

# off にする事で高速に接続
UseReverseDNS off
IdentLookups off

# グループ"admin"以外は自分のホームディレクトリの/public_htmより上位層には行けないように設定
#DefaultRoot ~/public_html !admin

# Port 21 is the standard FTP port.
Port 21

# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask 022

# Use localtime
TimesGMT FALSE

# To prevent DoS attacks, set the maximum number of child processes
# to 30. If you need to allow more than 30 concurrent connections
# at once, simply increase this value. Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd).
MaxInstances 30

# パスワードの入力ミスは3回まで
MaxLoginAttempts 3

# Set the user and group under which the server will run.
User nobody
Group nobody

# iconv patch: set local/remote encoding
# http://www.hakusan.tsg.ne.jp/tjkawa/software/misc/proftpd-iconv/index.jsp
CharsetLocal EUC-JP-MS
# CharsetRemote CP932
CharsetRemote EUC-JP-MS

# Normally, we want files to be overwriteable.

AllowOverwrite on


# A basic anonymous configuration, no upload directories.
#

#User ftp
#Group ftp

# We want clients to be able to login with "anonymous" as well as "ftp"
#UserAlias anonymous ftp

# Limit the maximum number of anonymous logins
#MaxClients 10

# do not require shells listed in /etc/shells (user ftp do not have
# shell...)
#RequireValidShell no

# We want 'welcome.msg' displayed at login, and '.message' displayed
# in each newly chdired directory.
#DisplayLogin welcome.msg
#DisplayFirstChdir .message

# Limit WRITE everywhere in the anonymous chroot
#
#DenyAll
#


#



# for Log
LogFormat allinfo "%t : %u (%a [%h]) : [%s], %T, %m (%f)"
LogFormat write "%t : %u : %F (%a)"
LogFormat read "%t : %u : %F (%a)"
LogFormat auth "%t : %u (%a [%h])"

ExtendedLog /var/log/proftpd/all.log ALL allinfo
ExtendedLog /var/log/proftpd/write.log WRITE write
ExtendedLog /var/log/proftpd/read.log READ read
ExtendedLog /var/log/proftpd/auth.log AUTH auth
[root]#


FTPデーモンを起動
[root]#
[root]# /etc/rc.d/init.d/proftpd stop
ProFTPdを停止中: [ 失敗 ]
[root]# /etc/rc.d/init.d/proftpd start
ProFTPdを起動中: - getaddrinfo 'Altair' error: Name or service not known
- warning: unable to determine IP address of 'Altair'
- error: no valid servers configured
- Fatal: error processing configuration file '/etc/proftpd.conf'

[ 失敗 ]
[root]#


ホスト名からIPアドレスが引けない様子。

ProFTPdを起動中: - getaddrinfo 'Host' error: 名前またはサービスが不明
- 警告:'Host'のIPアドレスが解決できない
- エラー:サーバが正しく構築されていない
- 致命的:構築ファイル'/etc/proftpd.conf'を処理中のエラー


/etc/hostsファイルを編集・確認して再起動
[root]#
[root]# vi /etc/hosts
[root]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
192.168.24.55 Altair
[root]#
[root]# /etc/rc.d/init.d/proftpd start
ProFTPdを起動中: [ OK ]
[root]#

うまく行った。

| | TrackBack (0)

January 24, 2008

MySQL インストール その2

ソースからのインストールは諦めたが、インストール後にやってみたコマンドのログ。
注意事項が現れたので念のため記載しておく。

$ su -
パスワード(P):
# cd /usr/local/var/
# ls
lib/ mysql-5.0.51/ mysql-5.0.51.tar.gz rpm/
# cd mysql-5.0.51
# ./scripts/mysql_install_db
WARNING: The host '********' could not be looked up with resolveip.
This probably means that your libc libraries are not 100 % compatible
with this binary MySQL version. The MySQL daemon, mysqld, should work
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MySQL privileges !
Installing MySQL system tables...
OK
Filling help tables...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/local/bin/mysqladmin -u root password 'new-password'
/usr/local/bin/mysqladmin -u root -h Altair password 'new-password'

Alternatively you can run:
/usr/local/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd /usr/local ; /usr/local/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/local/bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
#

| | TrackBack (0)

January 23, 2008

Vine Linux

サービスの状態を確認

[root]# chkconfig --list
[root]#


ランレベルの確認
[root]# runlevel
N 3
[root]#


NTPの設定
[root]# vi /etc/ntp.conf
[root]# cat /etc/ntp.conf
[root]# /etc/rc.d/init.d/ntpd start
ntpdを起動中: [ OK ]
[root]# ntpq -p
[root]# date
[root]# chkconfig --list ntpd
[root]# chkconfig ntpd on
[root]# chkconfig --list ntpd
[root]# chkconfig --level 2 ntpd on
[root]# chkconfig --list ntpd
[root]# /etc/rc.d/init.d/ntpd stop
ntpdを停止中: [ OK ]
[root]# vi /etc/ntp.conf
[root]# cat /etc/ntp.conf
[root]# /etc/rc.d/init.d/ntpd start
ntpdを起動中: [ OK ]
[root]# ntpq -p
[root]# chkconfig --list ntpd
[root]# date


IPTABLEの設定と確認
[root]# iptables -L
[root]# iptables -P FORWARD DROP
[root]# iptables -F
[root]# iptables -A INPUT -p icmp -j ACCEPT
[root]# iptables -A INPUT -p tcp -j ACCEPT
[root]# iptables -A INPUT -p udp -j ACCEPT
[root]# iptables -A INPUT -i lo -j ACCEPT
[root]# iptables -A INPUT -s 192.168.24.0/24 -p tcp --dport 22 -j ACCEPT
[root]# iptables -A INPUT -s 192.168.24.0/24 -p tcp --sport 22 -j ACCEPT
[root]# iptables -A INPUT -p tcp --dport 80 -j ACCEPT
[root]# iptables -A INPUT -p tcp --sport 80 -j ACCEPT
[root]# iptables -A INPUT -p tcp --dport 25 -j ACCEPT
[root]# iptables -A INPUT -p tcp --sport 25 -j ACCEPT
[root]# iptables -A INPUT -i ppp+ -p tcp --syn -m limit --limit 1/s -j ACCEPT
[root]# iptables -A INPUT -i ppp+ -p icmp --icmp-type echo-request -m limit --limit 1/s -j ACCEPT
[root]# iptables -P INPUT DROP
[root]# iptables -A INPUT -i ppp+ -p icmp --icmp-type echo-request -m limit --limit 1/s -j AC
[root]# iptables -A INPUT -i ppp+ -p tcp --syn -m limit --limit 1/s -j ACCEPT
[root]# iptables -L
[root]# /etc/init.d/iptables save
現在のルールを/etc/sysconfig/iptablesに保存中: [ OK ]
[root]# service iptables restart
現在のすべてのルールとユーザ定義チェインを初期化中: [ OK ]
現在のすべてのルールとユーザ定義チェインを破棄中: [ OK ]
iptablesファイアウォールルールを適用中: [ OK ]
[ OK ]
[root]# iptables -L
[root]# netconfig
[root]# service network restart
インターフェース eth0を停止中: [ OK ]
ループバックインターフェースを停止中: [ OK ]
ネットワークパラメータを設定中: [ OK ]
ループバックインターフェースを活性化中: [ OK ]
インターフェース eth0を活性化中: [ OK ]
[root]#
[root]#
[root]#
[root]# ifconfig
[root]# netstat -nr
[root]# iptables -A INPUT -i ppp+ -p icmp --icmp-type echo-request -m limit --limit 1/s -j AC
[root]# iptables -A INPUT -i ppp+ -p tcp --syn -m limit --limit 1/s -j ACCEPT
[root]#

特定端末だけFTPの接続を許可しようと試みたが、コマンドの使い方がよく理解できていない。
闇雲にやっても結局うまく行かないのでファイアウォールはGUIから設定した。また、いつか再挑戦。

ユーザを作成するときにホームページ作成用のディレクトリを自動的に作るように設定

[root]# cd /etc/skel
[skel]# ls
lib/ rpm/
[skel]# mkdir public_html
[skel]# mkdir public_html/cgi-bin
[skel]#

| | TrackBack (0)

January 22, 2008

MySQL インストール

MySQLのインストールを試みる

ソースをwgetして展開する

[root]#
[root]# adduser -g mysql -d /usr/local/var mysql
[root]# su - mysql
[var]$ pwd
/usr/local/var
[var]$ wget http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.0.51.tar.gz/from/ftp://ftp.iij.ad.jp/pub/db/mysql/
--23:40:42-- http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.0.51.tar.gz/from/ftp://ftp.iij.ad.jp/pub/db/mysql/
=> `index.html'
dev.mysql.com をDNSに問いあわせています... 213.136.52.29
dev.mysql.com|213.136.52.29|:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 302 Found
場所: ftp://ftp.iij.ad.jp/pub/db/mysql/Downloads/MySQL-5.0/mysql-5.0.51.tar.gz [続く]
--23:40:43-- ftp://ftp.iij.ad.jp/pub/db/mysql/Downloads/MySQL-5.0/mysql-5.0.51.tar.gz
=> `mysql-5.0.51.tar.gz'
ftp.iij.ad.jp をDNSに問いあわせています... 202.232.140.139, 202.232.140.141, 202.232.140.138, ...
ftp.iij.ad.jp|202.232.140.139|:21 に接続しています... 接続しました。
anonymous としてログインしています... ログインしました!
==> SYST ... 完了しました。 ==> PWD ... 完了しました。
==> TYPE I ... 完了しました。 ==> CWD /pub/db/mysql/Downloads/MySQL-5.0 ... 完了しました。
==> PASV ... 完了しました。 ==> RETR mysql-5.0.51.tar.gz ... 完了しました。
長さ: 27,045,586 (26M) (確証はありません)
 
100%[=============================================================>] 27,045,586 1.65M/s ETA 00:00
 
23:40:56 (2.09 MB/s) - `mysql-5.0.51.tar.gz' を保存しました [27045586]
 
[var]$ tar xvfz mysql-5.0.51.tar.gz'


展開したフォルダに移動してコンフィグを実行する。

[mysql-5.0.51]$ cd mysql-5.0.51
[mysql-5.0.51]$ ./configure --with-charset=ujis -with-extra-charsets=all --with-mysqld-user=mysql
 
MySQL has a Web site at http://www.mysql.com/ which carries details on the
latest release, upcoming features, and other information to make your
work or play with MySQL more productive. There you can also find
information about mailing lists for MySQL discussion.
 
Remember to check the platform specific part of the reference manual for
hints about installing MySQL on your platform. Also have a look at the
files in the Docs directory.
 
Thank you for choosing MySQL!
 
[mysql-5.0.51]$

歓迎メッセージが表示されコンフィグは成功した模様。


MySQLにはhttp://www.mysql.com/にWebサイトがある。最新リリースについての詳細や開発中の機能、その他、詳細な情報が逐次発表されているので仕事や趣味にMySQLをより生産的に利用できる。
MySQLについて話し合うメーリングリストの情報も得られる。
 
あなたの環境にMySQLをインストールする際、リファレンスマニュアルの当該環境部分を確認することを忘れないように。Docsディレクトリのファイルも見るように。
 
MySQLを選んでくれてありがとう!


コンパイル

[mysql-5.0.51]$
[mysql-5.0.51]$ make
 
if g++ -DMYSQL_SERVER -DDEFAULT_MYSQL_HOME="\"/usr/local\"" -DDATADIR="\"/usr/local/var\"" -DSHAREDIR="\"/usr/local/share/mysql\"" -DHAVE_CONFIG_H -I. -I. -I../include -I../zlib -I../innobase/include -I../innobase/include -I../include -I../include -I../regex -I. -O3 -DDBUG_OFF -fno-implicit-templates -fno-exceptions -fno-rtti -MT item_sum.o -MD -MP -MF ".deps/item_sum.Tpo" -c -o item_sum.o item_sum.cc; \
then mv -f ".deps/item_sum.Tpo" ".deps/item_sum.Po"; else rm -f ".deps/item_sum.Tpo"; exit 1; fi
item.h: destructor 内の `virtual Item_sum_num::~Item_sum_num()':
item.h:446: internal compiler error: in convert_move, at expr.c:594
完全なバグ報告を送って下さい。
適切ならばプリプロセス後のソースをつけてください。
<URL:http://gcc.gnu.org/bugs.html>を見れば方法が書いてあります。
make[4]: *** [item_sum.o] エラー 1
make[4]: ディレクトリ `/usr/local/var/mysql-5.0.51/sql' から出ます
make[3]: *** [all-recursive] エラー 1
make[3]: ディレクトリ `/usr/local/var/mysql-5.0.51/sql' から出ます
make[2]: *** [all] エラー 2
make[2]: ディレクトリ `/usr/local/var/mysql-5.0.51/sql' から出ます
make[1]: *** [all-recursive] エラー 1
make[1]: ディレクトリ `/usr/local/var/mysql-5.0.51' から出ます
make: *** [all] エラー 2
[mysql-5.0.51]$

またもやエラー。再度"make"を実行すると少しずつコンパイルは先へすすむ。
何とか最後までやってインストール。
$ make install

でも、なんだか気持ち悪い。
日本MySQLユーザ会 http://www.mysql.gr.jp/ から日本語ドキュメント→日本語ドキュメント MySQL AB
とたどり「internal compiler error」をキーワードにサイト内検索したところ「2.3.5. MySQL のコンパイルに関する問題への対処」という文章が見つかった。「メモリまたはスワップ領域が不足している可能性がある」らしい。
コンフィグを以下のようにやり直すと良いとのこと
$ rm config.cache
$ make clean または $ make distclean
$ ./configure --with-low-memory

試してみた。でも同じだった。

VineLinux用のパッケージをインストールすることにする。
まず、MySQLをアンインストールし、-rオプションをつけてホームディレクトリごとMySQLユーザを削除する。
MySQLグループも削除。

[mysql-5.0.51]# make uninstall
[mysql-5.0.51]# cd ..
[var]# userdel -r mysql
[var]# groupdel mysql

# rpm -qa | grep MySQL
# apt-get install MySQL-server MySQL-Max MySQL-client MySQL-shared
パッケージリストを読みこんでいます... 完了
依存情報ツリーを作成しています... 完了
以下の追加パッケージがインストールされます:
perl-DBI
以下のパッケージが新たにインストールされます:
MySQL-Max MySQL-client MySQL-server MySQL-shared perl-DBI
アップグレード: 0 個, 新規インストール: 5 個, 削除: 0 個, 保留: 19 個
26.1MB のアーカイブを取得する必要があります。
展開後に 54.0MB のディスク容量が追加消費されます。
続行しますか? [Y/n]Y
取得:1 http://updates.vinelinux.org 4.2/i386/plus perl-DBI 1.53-0vl1 [658kB]
取得:2 http://updates.vinelinux.org 4.2/i386/plus MySQL-client 5.0.27-0vl3 [6419kB]
取得:3 http://updates.vinelinux.org 4.2/i386/plus MySQL-server 5.0.27-0vl3 [14.6MB]
取得:4 http://updates.vinelinux.org 4.2/i386/plus MySQL-Max 5.0.27-0vl3 [3162kB]
取得:5 http://updates.vinelinux.org 4.2/i386/plus MySQL-shared 5.0.27-0vl3 [1294kB]
26.1MB を 10s 秒で取得しました (2482kB/s)
変更を適用しています...
準備中... ########################################### [100%]
1:perl-DBI ########################################### [ 20%]
2:MySQL-client ########################################### [ 40%]
3:MySQL-server ########################################### [ 60%]
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h Altair password 'new-password'
See the manual for more instructions.

Please report any problems with the /usr/bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
Starting MySQL.....[ OK ]
4:MySQL-Max ########################################### [ 80%]
Restarting mysqld.
5:MySQL-shared ########################################### [100%]
完了
#

# rpm -qa | grep MySQL
MySQL-client-5.0.27-0vl3
MySQL-server-5.0.27-0vl3
MySQL-shared-5.0.27-0vl3
MySQL-Max-5.0.27-0vl3
#

# mysqladmin -u root password ********
# mysql -u root -p
Enter password: ********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 5.0.27-Max

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> exit
Bye
#

| | TrackBack (0)

January 09, 2008

Hello, Rails! その2

sayというコントローラを作成する

[demo]$
[demo]$ ruby script/generate controller say
exists app/controllers/
exists app/helpers/
create app/views/say
exists test/functional/
create app/controllers/say_controller.rb
create test/functional/say_controller_test.rb
create app/helpers/say_helper.rb
[demo]$

1つのディレクトリと3つのスクリプトが追加される

コントローラのソースファイルの場所
app/controllers/say_controller.rb

SayControllerクラスはApplicationControllerを継承したクラス

[demo]$ cat app/controllers/say_controller.rb
class SayController < ApplicationController
end
[demo]$


sayコントローラにhelloという何も行わないアクションを追加する
すなわちSayControllerクラスにhello()メソッドを記述する

class SayController < ApplicationController
def hello
end
end


class SayController < ApplicationController
def hello
 @time = Time.now
end
end

ビューのテンプレートを作成する
app/views/say/hello.rhtml

[demo]$ cat app/views/say/hello.rhtml
<html>
<head>
<title>Hello, Rails!</title>
</head>
<body>
<h1>Hello from Rails!</h1>
<p>
It is now <%= @time %>.
</p>
<p>
Time to say <%= link_to "Goodbye!", :action => "goodbye" %>
</p>
</body>
</html>
[demo]$

 
class SayController < ApplicationController
def hello
@time = Time.now
end
def goodbye
end
end

 
<html>
<head>
<title>Hello, Rails!</title>
</head>
<body>
<h1>Hello from Rails!</h1>
<p>
It is now <%= @time %>.
</p>
<p>
Time to say
<%= link_to "Goodbye!", :action => "goodbye" %>
</p>
</body>
</html>

 
<html>
<head>
<title>See You Later!</title>
</head>
<body>
<h1>Goodbye!</h1>
<p>
It was nice having you here.
</p>
<p>
Say <%= link_to "Hello", :action => "hello" %> again.
</p>
</body>
</html>

| | TrackBack (0)

January 07, 2008

Hello, Rails! その1

MyList「とりあえず積ん読」で紹介している「RailsによるアジャイルWebアプリケーション開発」にしたがって操作してみる
要点だけログを掲載し後の参考にする

Rubyのバージョンを確認

[~]$ ruby -v
ruby 1.8.5 (2006-08-25) [i386-linux]
[~]$

Rubyをソースからインストールする必要はないがダウンロードするなら以下のサイトから

http://www.ruby-lang.org/en/

コンパイルとインストールの手順

[~]$ tar xzf ruby-x.y.z.tar.gz
cd ruby-x.y.z.tar.gz
./confugure
make
make test
sudo make install

RubyGemsをインストール
http://rubygems.rubyforge.orgから適切なアーカイブをダウンロード

[~]$ tar zxf rubygems-0.9.1.tar.gz
[~]$ cd rubygems-0.9.1
[rubygems-0.9.1]$ sudo ruby setup.rb
Password:
---> bin
<--- bin
---> lib
---> lib/rbconfig
<--- lib/rbconfig
---> lib/rubygems
 
……略……
 
<--- lib/rubygems
<--- lib
Successfully built RubyGem
Name: sources
Version: 0.0.1
File: sources-0.0.1.gem
Removing old RubyGems RDoc and ri...
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- rdoc/rdoc (LoadError)
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
from /home/muneyoshi/rubygems-0.9.1/./post-install.rb:103:in `install_rdoc'
from /home/muneyoshi/rubygems-0.9.1/./post-install.rb:118:in `try_run_hook'
from setup.rb:584:in `run_hook'
from setup.rb:1322:in `exec_task_traverse'
from setup.rb:1175:in `exec_install'
from setup.rb:894:in `exec_install'
from setup.rb:712:in `invoke'
from setup.rb:681:in `invoke'
from setup.rb:1359
[rubygems-0.9.1]$ cd ..

sudoの設定はrootで

#find / -name sudoers
#vi /etc/sudoers

RubyGemsを利用してRailsをインストール

[~]$ sudo gem install rails --include-dependencies
Bulk updating Gem source index for: http://gems.rubyforge.org
Successfully installed rails-2.0.2
Successfully installed rake-0.8.1
Successfully installed activesupport-2.0.2
Successfully installed activerecord-2.0.2
Successfully installed actionpack-2.0.2
Successfully installed actionmailer-2.0.2
Successfully installed activeresource-2.0.2
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- rdoc/rdoc (LoadError)
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
from /usr/local/lib/site_ruby/1.8/rubygems/doc_manager.rb:71:in `load_rdoc'
from /usr/local/lib/site_ruby/1.8/rubygems/doc_manager.rb:41:in `generate_ri'
from /usr/local/lib/site_ruby/1.8/rubygems/gem_commands.rb:299:in `execute'
from /usr/local/lib/site_ruby/1.8/rubygems/gem_commands.rb:298:in `each'
from /usr/local/lib/site_ruby/1.8/rubygems/gem_commands.rb:298:in `execute'
from /usr/local/lib/site_ruby/1.8/rubygems/gem_commands.rb:236:in `each'
from /usr/local/lib/site_ruby/1.8/rubygems/gem_commands.rb:236:in `execute'
from /usr/local/lib/site_ruby/1.8/rubygems/command.rb:70:in `invoke'
from /usr/local/lib/site_ruby/1.8/rubygems/cmd_manager.rb:120:in `process_args'
from /usr/local/lib/site_ruby/1.8/rubygems/cmd_manager.rb:91:in `run'
from /usr/local/lib/site_ruby/1.8/rubygems/gem_runner.rb:30:in `run'
from /usr/bin/gem:23
[~]$

上の例ではバージョン2.0がインストールされている。参考にしている書籍のとおりにたどるには旧バージョンを使う必要があるとのこと。バージョンダウンするには以下のコマンドオプションを使う。
[~]$ sudo gem install rails --include-dependencies --version '< 2'
[~]$

MySQLがまだインストールされていない場合
http://dev.mysql.com/からダウンロードしてサイトの支持に従うとあるがまだインストールしていない

デモを動かす

[~]$ mkdir work
[~]$ cd work
[work]$ rails demo
create
create app/controllers
create app/helpers
create app/models
create app/views/layouts
create config/environments
create config/initializers
create db
create doc
create lib
create lib/tasks
create log
create public/images
create public/javascripts
create public/stylesheets
create script/performance
create script/process
create test/fixtures
create test/functional
create test/integration
create test/mocks/development
create test/mocks/test
create test/unit
create vendor
create vendor/plugins
create tmp/sessions
create tmp/sockets
create tmp/cache
create tmp/pids
create Rakefile
create README
create app/controllers/application.rb
create app/helpers/application_helper.rb
create test/test_helper.rb
create config/database.yml
create config/routes.rb
create public/.htaccess
create config/initializers/inflections.rb
create config/initializers/mime_types.rb
create config/boot.rb
create config/environment.rb
create config/environments/production.rb
create config/environments/development.rb
create config/environments/test.rb
create script/about
create script/console
create script/destroy
create script/generate
create script/performance/benchmarker
create script/performance/profiler
create script/performance/request
create script/process/reaper
create script/process/spawner
create script/process/inspector
create script/runner
create script/server
create script/plugin
create public/dispatch.rb
create public/dispatch.cgi
create public/dispatch.fcgi
create public/404.html
create public/422.html
create public/500.html
create public/index.html
create public/favicon.ico
create public/robots.txt
create public/images/rails.png
create public/javascripts/prototype.js
create public/javascripts/effects.js
create public/javascripts/dragdrop.js
create public/javascripts/controls.js
create public/javascripts/application.js
create doc/README_FOR_APP
create log/server.log
create log/production.log
create log/development.log
create log/test.log
[work]$ cd demo
[demo]$
[demo]$
[demo]$ ls -p
README Rakefile app/ config/ db/ doc/ lib/ log/ public/ script/ test/ tmp/ vendor/
[demo]$
[demo]$ find . -name dispatch.*
./public/dispatch.cgi
./public/dispatch.fcgi
./public/dispatch.rb
[demo]$

特に重要なのは3つのディスパッチャ(dispatch.cgi, dispatch.fcgi, dispatch.rb)とscriptディレクトリとのことだ。

スタンドアロンのサーバWEBrickを起動

[demo]$ ruby script/server
Rails requires RubyGems >= 0.9.4 (you have 0.9.1). Please `gem update --system` and try again.
[demo]$

「RailsはRubyGemsの0.9.4以降を必要としています(あなたのは0.9.1です)。`gem update --system`を実行して再試行してください」とのこと。
Railsのバージョンが適切な場合はRubyGemsのバージョンが0.9.1でもこのメッセージはでない。

[demo]$ ruby script/server
=> Booting WEBrick...
=> Rails application started on http://0.0.0.0:3000
=> Ctrl-C to shutdown server; call with --help for options
[2007-12-30 23:37:42] INFO WEBrick 1.3.1
[2007-12-30 23:37:42] INFO ruby 1.8.5 (2006-08-25) [i386-linux]
[2007-12-30 23:37:42] INFO WEBrick::HTTPServer#start: pid=3228 port=3000

http://localhost:3000/にアクセスできるが、リモートからはアクセスできなかった。
ファイアウォールの設定でTCPの3000番ポートを開いてリモートからアクセスできることを確認。

| | TrackBack (0)

November 21, 2007

Linuxへの道 その8

やる気がうせてしまったが途中まで手順を書き写していたので、せっかくだからここに記載しておく。
いつか気が向いたらVine Linuxでやってみるかもしれない。

glibcのコンパイル
まず、FedoraのCコンパイラでダウンロードしてきたCライブラリのソースをコンパイルしてLinux領域に導入する。

[linux]#
[linux]# mkdir -pv /usr/local/source/build-glibc    ……ワークエリアを作成
mkdir: created directory `/usr/local/source/build-glibc'
[linux]# cd /usr/local/source/build-glibc
[build-glibc]# pwd
/usr/local/source/build-glibc
[build-glibc]#
[build-glibc]#
[build-glibc]#
[build-glibc]# ls ../
build-glibc glibc-2.4 module-init-tools-3.2
busybox-1.1.1 glibc-2.4.tar.bz2 module-init-tools-3.2.tar.bz2
busybox-1.1.1.tar.bz2 linux-2.6.16.1.tar.bz2
[build-glibc]# ../glibc-2.4/configure --with-tls \       ……NPTL準拠のglibcを作成
# make
# make install_root=/usr/local/mylinux2 install
#

BusyBoxのコンパイル
組み込み向けLinuxやLinuxディストリビューションの起動に使われているコマンドユーティリティBusyBoxをコンパイルする。

#
# cd /usr/local/source/busybox-1.1.1
# make defconfig                   ……デバッグ用コマンドを含むすべてのコマンドを利用できるように
# make dep                      ……依存関係の確認
# make                         ……コンパイル
# make PREFIX=/usr/local/mylinux2 install  ……指定ディレクトリに導入
#

module-init-toolsのコンパイル
カーネルにモジュールを組み込んだり外したりするツール群(カーネル・モジュール・ローダ)をコンパイルして導入する。

#
# cd /usr/local/source/module-init-tools-3.2
# ./configure --prefix=/usr --exec-prefix=/usr/local/mylinux2 \
> --datadir=/usr/local/mylinux2/usr/share \
> --includedir=/usr/local/mylinyx2/usr/include \
> --mandir=/usr/local/mylinux2/usr/share/man
# make
# make install  ……導入
#

カーネルのコンパイル
カーネルの様々な機能を有効にするか無効にするか後で組み込めるようにするかを設定している「カーネルパラメータ」を設定する必要があるが、大変なのでFedora Core 5のものを流用しようということになっている。
Fedora Core 5の場合は"/boot/config-2.6.16-1.2080_FC5"にカーネルパラメータが記述されている。番号はカーネルのバージョン番号なので"uname"コマンドで確認し"/usr/src/linux/.config"にコピーする。

# uname -r
#
# cd /boot
# cp config-2.6.16-1.2080_FC5 /usr/src/linux/.config

"/usr/src/linux/Makefile"の"EXTRAVERSION=.1"を以下のように編集する。
EXTRAVERSION=.1-mylinux2

コンパイルする。
# cd /usr/src/linux
# make oldconfig
# make
# make INSTALL_MOD_PATH=/usr/local/mylinux2 modules_installl

| | Comments (0) | TrackBack (0)

November 16, 2007

Linuxへの道 その7

気になっていたアップデートを完了して、改めてglibcのコンパイルを実行してみたが、やはり同様のエラーで失敗する。
ハードウェアかOSが原因。メモリの不良か。ネットで検索すると確かにメモリの不良でこのエラーが出ている人もいる。
Memtestを一晩かけて実行してみた。3回パスしてエラーは見つからなかった。メモリ容量は推奨環境をクリアしている。
 
PC-VU50L25DのCPUは AMD社の K6-2 (500MHz)で Pentium II 相当のCPUだ。メモリは最大の256MBに増設している。ハードディスクは10GBと少し心もとないがフルインストールさえしなければ環境を満たしている。
 
Fedora Core 2の推奨環境:

Minimum: Pentium-class
 
Fedora Core 2 is optimized for Pentium PRO (and later) CPUs, but also supports Pentium-class CPUs. This approach has been taken because Pentium-class optimizations actually result in reduced performance for non-Pentium-class processors.
 
Recommended for text-mode: 200 MHz Pentium-class or better
 
Recommended for graphical: 400 MHz Pentium II or better

 
Core 2はPentium PRO以降を対象に最適化されている。グラフィカルの推奨環境も満たしている。
 
Fedora Core 3の推奨環境:
Minimum: Pentium-class
 
Fedora Core 3 is optimized for Pentium 4 CPUs, but also supports earlier CPUs (such as Pentium, Pentium Pro, Pentium II, Pentium III, and including AMD and VIA variants). This approach has been taken because Pentium-class optimizations actually result in reduced performance for non-Pentium-class processors, and Pentium 4 scheduling is sufficiently different (while making up the bulk of today's processors) to warrant this change.
 
Recommended for text-mode: 200 MHz Pentium-class or better
 
Recommended for graphical: 400 MHz Pentium II or better

 
Core 3ではいきなりPentium 4を対象に最適化していると記載されているが、それ以前のCPUもサポートしていることになっている。このあたりを見るとどうがんばってもCore 2あたりが妥当のようである。
がグラフィカルモードの推奨環境も満たしている。
 
Fedora Core 6の推奨環境:
6.3.1. x86 Hardware Requirements
In order to use specific features of Fedora Core 6 during or after installation, you may need to know details of other hardware components such as video and network cards.
 
6.3.1.1. Processor and Memory Requirements
The following CPU specifications are stated in terms of Intel processors. Other processors, such as those from AMD, Cyrix, and VIA that are compatible with and equivalent to the following Intel processors, may also be used with Fedora Core.
 
Fedora Core 6 requires an Intel Pentium or better processor, and is optimized for Pentium 4 and later processors.
 
Recommended for text-mode: 200 MHz Pentium-class or better
 
Recommended for graphical: 400 MHz Pentium II or better
 
Minimum RAM for text-mode: 128MiB
 
Minimum RAM for graphical: 192MiB
 
Recommended RAM for graphical: 256MiB

 
そして、Core 6のグラフィックモードでも最低環境を満たしている。しかし使用感は非常に悪い。
ワンランク下げてFedora Core 5 をインストールしてみることにした。
ついでにパーティションなどもデフォルトのままでやってみる。
 
が、結果は同じであった。メモリが原因でなければOSか。
CentOS 2を試してみたがインストールすらできない。
CentOS requires an i686 class processor to install and we have detected i586.

 
CentOS 4.4ではi586にも対応しているということなので試してみると
kernel panic - not syncing: include/linux/smp_lock.h:25: spin_unlocl(kernel/sched.c:c036d5d8) not locked
 
<0>Kernel panic - not- syncing: kernel/sched.c:480: spin_lock(kernel/sched.c:c04105a0) already locked by kernel/sched.c/2700

 
FAQを検索すると、同様のエラーに遭遇した人がCD-ROMドライブのIDEケーブルをシールドタイプのものに交換したところうまく行ったという報告をみつけた。

つまりハードウェア的に非常に不安定であるということか。ケーブルを新調つもりはない。

一般向け低価格パソコンでも動きそうなVine Linuxをインストールしてみた。無事インストールはできたが、グラフィックボードとディスプレイの設定をいい加減に指定してしまい解像度が640×400と設定されてしまった。オマケに左右に少しずつはみ出している。

Vine LinuxのFAQを検索するとGNOM端末からrootでXconfiguratorを起動して再調整するとよいとのこと。途中で表示された/etc/X11/xconf.orgを少々いじってみたところrootのデスクトップだけはうまく1024×768に設定できた。一般ユーザのデスクトップはGUIメニューから解像度を変更できた。

ログイン画面だけは1280×768から変更できない。Bootマネージャの設定からBootイメージエディタでパラメータの編集を実行し起動オプションエディタを使って設定してみたがうまくゆかない。これは、後の課題として先へ進む。

Vine Linuxではコンパイルもうまく行くが、ソースはVine Linux専用に開発されたものをダウンロードしてこないといけない。

パーティションもデフォルトのままでインストールしている。テキストとしている雑誌ではFedora Coreのカーネルをそのままコピーする記述もある。随分とテキストから離れた環境になってしまった。

最初から分かっていたことだが、このまま進めてもUSBメモリからブートはできない。

なんだか熱が冷めてしまった。

| | Comments (0) | TrackBack (0)

November 03, 2007

Linuxへの道 その6

gccのコンパイルで異常終了に突き当たった。インストール直後のアップデートを失敗したままにしていたことが気になる。アップデートを完了してからコンパイルを再度試すことにした。
 
> Error: elfutils-libelf conflicts with elfutils-libelf-devel > 0.123-1.fc6
 
 elfutils-libelfのバージョンがelfutils-libelf-devel の0.123-1.fc6のものと衝突しているらしい。
 

[~]#
[~]# rpm -qa | grep elfutils
elfutils-libs-0.123-1.fc6
elfutils-libelf-0.123-1.fc6
elfutils-libelf-devel-0.123-1.fc6
elfutils-libelf-0.129-1.fc6
elfutils-libs-0.129-1.fc6
elfutils-0.129-1.fc6
elfutils-0.123-1.fc6
[~]#

 
 古いほうを削除してよいものか調べてみる。
 
[~]#
[~]# rpm -q --whatrequires `rpm -qa | grep ^elfutils`
elfutils-libs-0.123-1.fc6 を必要とするパッケージは存在しません。
elfutils-libelf-0.123-1.fc6 を必要とするパッケージは存在しません。
elfutils-libelf-devel-0.123-1.fc6 を必要とするパッケージは存在しません。
elfutils-libelf-0.129-1.fc6 を必要とするパッケージは存在しません。
elfutils-libs-0.129-1.fc6 を必要とするパッケージは存在しません。
elfutils-0.129-1.fc6 を必要とするパッケージは存在しません。
elfutils-0.123-1.fc6 を必要とするパッケージは存在しません。
[~]#

 
 特に他のパッケージに影響するものもなさそうだ。まず,elfutils-0.123-1.fc6を削除する。
 
[~]#
[~]# yum remove elfutils-0.123-1.fc6
Loading "installonlyn" plugin
Setting up Remove Process
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Package elfutils.i386 0:0.123-1.fc6 set to be erased
--> Running transaction check
 
Dependencies Resolved
 
=============================================================================
Package Arch Version Repository Size
=============================================================================
Removing:
elfutils i386 0.123-1.fc6 installed 340 k
 
Transaction Summary
=============================================================================
Install 0 Package(s)
Update 0 Package(s)
Remove 1 Package(s)
 
Is this ok [y/N]: y
Downloading Packages:
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Removing : elfutils ######################### [1/1]
 
Removed: elfutils.i386 0:0.123-1.fc6
Complete!
[~]#

 
 次に,elfutils-libs-0.123-1.fc6を削除。ログを取り忘れたが問題なく削除できた。調子よく続けようとしたところ,
 
[~]#
[~]# yum remove elfutils-libelf-0.123-1.fc6
Loading "installonlyn" plugin
Setting up Remove Process
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Package elfutils-libelf.i386 0:0.123-1.fc6 set to be erased
--> Running transaction check
Setting up repositories
core 100% |=========================| 1.1 kB 00:00
updates 100% |=========================| 1.2 kB 00:00
extras 100% |=========================| 1.1 kB 00:00
Reading repository metadata in from local files
primary.xml.gz 100% |=========================| 1.7 MB 00:01
extras : ################################################## 5373/5373
--> Processing Dependency: elfutils-libelf = 0.123-1.fc6 for package: elfutils-libelf-devel
--> Restarting Dependency Resolution with new changes.
--> Populating transaction set with selected packages. Please wait.
---> Package elfutils-libelf-devel.i386 0:0.123-1.fc6 set to be erased
--> Running transaction check
--> Processing Dependency: elfutils-libelf-devel for package: rpm-devel
--> Restarting Dependency Resolution with new changes.
--> Populating transaction set with selected packages. Please wait.
---> Package rpm-devel.i386 0:4.4.2-32 set to be erased
--> Running transaction check
 
Dependencies Resolved
 
=============================================================================
Package Arch Version Repository Size
=============================================================================
Removing:
elfutils-libelf i386 0.123-1.fc6 installed 80 k
Removing for dependencies:
elfutils-libelf-devel i386 0.123-1.fc6 installed 216 k
rpm-devel i386 4.4.2-32 installed 3.5 M
 
Transaction Summary
=============================================================================
Install 0 Package(s)
Update 0 Package(s)
Remove 3 Package(s)
 
Is this ok [y/N]:

とでた。elfutils-libelf-devel-0.123-1.fc6は最初から削除するつもりだったので問題ないが,rpm-develまで依存しているとは困った。develとは開発環境という意味らしい。削除してもとりあえずは問題ないであろうし,必要なら再度ダウンロードしてくるだろうと踏んで気合で先へ進む。ま,気合ではどうにもならないのだが,……

Is this ok [y/N]: y
Downloading Packages:
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Removing : rpm-devel ######################### [1/3]
Removing : elfutils-libelf ######################### [2/3]
Removing : elfutils-libelf-devel ######################### [3/3]
 
Removed: elfutils-libelf.i386 0:0.123-1.fc6
Dependency Removed: elfutils-libelf-devel.i386 0:0.123-1.fc6 rpm-devel.i386 0:4.4.2-32
Complete!
[~]#

 
 削除完了! 再アップデート。
 
[~]#
[~]# yum -y update
Loading "installonlyn" plugin
Setting up Update Process
Setting up repositories
Reading repository metadata in from local files
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Package nss_ldap.i386 0:257-3.fc6 set to be updated
---> Package docbook-style-xsl.noarch 0:1.72.0-1.fc6 set to be updated
---> Package gnome-panel-devel.i386 0:2.16.3-2.fc6 set to be updated
---> Package gjdoc.i386 0:0.7.7-14.fc6 set to be updated

 
 最初とメッセ-ジが少し違うが一度すんでいるからだろう。ログを見つめる。かなりの時間がかかった。
祈ってもおそらく結果は変わらないのだが,祈らずにいられないところが弱い。
 
……
Cleanup : gdm ##################### [448/449]
Cleanup : openldap-devel ##################### [449/449]
 
Installed: bluez-gnome.i386 0:0.6-1.fc6 kernel.i586 0:2.6.22.9-61.fc6 kernel-devel.i586 0:2.6.22.9-61.fc6 kexec-tools.i386 0:1.101-56.fc6 libpurple.i386 0:2.0.2-3.fc6.1 pidgin.i386 0:2.0.2-3.fc6.1
Dependency Installed: avahi-compat-howl.i386 0:0.6.16-4.fc6 busybox.i386 1:1.2.0-4 cyrus-sasl-md5.i386 0:2.1.22-4 libicu.i386 0:3.6-4 meanwhile.i386 0:1.0.2-3.fc6 perl-libwww-perl.noarch 0:5.805-1.1.1 pygobject2-doc.i386 0:2.12.3-2.fc6 pygtk2-codegen.i386 0:2.10.4-1.fc6 systemtap-runtime.i386 0:0.5.13-1.fc6
Updated: SDL-devel.i386 0:1.2.11-1.fc6 a2ps.i386 0:4.13b-57.fc6.3 anacron.i386 0:2.3-44.fc6 at.i386 0:3.1.8-85.fc6 authconfig.i386 0:5.3.18-0.1.fc6 authconfig-gtk.i386 0:5.3.18-0.1.fc6 autofs.i386 1:5.0.1-0.rc3.33 beagle.i386 0:0.2.13-1.fc6 beagle-evolution.i386 0:0.2.13-1.fc6 beagle-gui.i386 0:0.2.13-1.fc6 bind-utils.i386 31:9.3.4-7.P1.fc6 bluez-utils.i386 0:3.7-2 boost.i386 0:1.33.1-11.fc6 boost-devel.i386 0:1.33.1-11.fc6 bug-buddy.i386 1:2.16.0-4.fc6 bzip2-devel.i386 0:1.0.3-6.fc6 cadaver.i386 0:0.22.3-4.fc6 compiz.i386 0:0.3.6-2.fc6 control-center.i386 1:2.16.3-11.fc6 cpio.i386 0:2.6-22.fc6 cpp.i386 0:4.1.2-13.fc6 cpuspeed.i386 1:1.2.1-1.48.fc6 cups.i386 1:1.2.12-5.fc6 cups-libs.i386 1:1.2.12-5.fc6 cvs.i386 0:1.11.22-6.fc6 desktop-printing.i386 0:0.19-21.fc6 devhelp.i386 0:0.12-11.fc6 dhcdbd.i386 0:2.1-2.fc6 dhclient.i386 12:3.0.5-5.fc6 diffstat.i386 0:1.43-1.fc6 docbook-style-xsl.noarch 0:1.72.0-1.fc6 doxygen.i386 1:1.5.1-1 ed.i386 0:0.3-0.fc6 eel2.i386 0:2.16.1-1.fc6 eel2-devel.i386 0:2.16.1-1.fc6 ekiga.i386 0:2.0.5-3.fc6 enscript.i386 0:1.6.4-5.fc6 eog.i386 0:2.16.3-1.fc6 evince.i386 0:0.6.0-6.fc6 evolution.i386 0:2.8.3-2.fc6 evolution-data-server-devel.i386 0:1.8.3-7.fc6 fetchmail.i386 0:6.3.6-3.fc6 file-roller.i386 0:2.16.3-1.fc6 firefox.i386 0:1.5.0.12-5.fc6 firefox-devel.i386 0:1.5.0.12-5.fc6 flac.i386 0:1.1.2-28 fonts-japanese.noarch 0:0.20061016-1.fc6 foomatic.i386 0:3.0.2-39.5.fc6 gcalctool.i386 0:5.8.25-1.fc6 gcc.i386 0:4.1.2-13.fc6 gcc-c++.i386 0:4.1.2-13.fc6 gcc-gfortran.i386 0:4.1.2-13.fc6 gd-devel.i386 0:2.0.35-1.fc6 gdm.i386 1:2.16.5-2.fc6 gimp-print-utils.i386 0:4.2.7-23.fc6 gjdoc.i386 0:0.7.7-14.fc6 glx-utils.i386 0:6.5.1-9.fc6 gmp-devel.i386 0:4.1.4-10.fc6 gnome-applets.i386 1:2.16.0.1-13.fc6 gnome-bluetooth.i386 0:0.7.0-12.fc6 gnome-bluetooth-libs.i386 0:0.7.0-12.fc6 gnome-desktop-devel.i386 0:2.16.3-1.fc6 gnome-media.i386 0:2.16.1-4.fc6 gnome-panel-devel.i386 0:2.16.3-2.fc6 gnome-pilot-devel.i386 0:2.0.15-1.fc6 gnome-power-manager.i386 0:2.16.3-1.fc6 gnome-python2.i386 0:2.16.2-2.fc6 gnome-python2-bonobo.i386 0:2.16.2-2.fc6 gnome-python2-canvas.i386 0:2.16.2-2.fc6 gnome-python2-extras.i386 0:2.14.2-10.fc6 gnome-python2-gconf.i386 0:2.16.2-2.fc6 gnome-python2-gnomevfs.i386 0:2.16.2-2.fc6 gnome-python2-libegg.i386 0:2.14.2-10.fc6 gnome-screensaver.i386 0:2.16.3-1.fc6 gnome-session.i386 0:2.16.3-1.fc6 gnome-themes.noarch 0:2.16.3-1.fc6 gnome-vfs2-devel.i386 0:2.16.2-2.fc6 gnome-vfs2-smb.i386 0:2.16.2-2.fc6 gnome-volume-manager.i386 0:2.15.0-4.fc6 gnupg.i386 0:1.4.7-5 gpm-devel.i386 0:1.20.1-84.fc6 gstreamer.i386 0:0.10.11-1.fc6 gstreamer-plugins-base.i386 0:0.10.11-1.fc6 gstreamer-plugins-good.i386 0:0.10.4-3.fc6 gtk-doc.noarch 0:1.7-2.fc6 gtkhtml3.i386 0:3.12.3-1.fc6 hal-cups-utils.i386 0:0.6.9-1.fc6 hal-devel.i386 0:0.5.8.1-6.fc6 hplip.i386 0:1.7.4a-3.fc6 httpd.i386 0:2.2.6-1.fc6 ipsec-tools.i386 0:0.6.5-8.fc6 irqbalance.i386 2:0.55-2.fc6 jpackage-utils.noarch 0:1.7.3-1jpp.3.fc6 jwhois.i386 0:3.2.3-8.fc6 krb5-workstation.i386 0:1.5-23.fc6 kudzu.i386 0:1.2.57.6-1 kudzu-devel.i386 0:1.2.57.6-1 lftp.i386 0:3.5.9-0.fc6 libXfont-devel.i386 0:1.2.8-1.fc6 libdrm-devel.i386 0:2.3.0-1.fc6 libgnomeprint22-devel.i386 0:2.12.1-9.fc6 libgsf-devel.i386 0:1.14.1-7 libgtop2-devel.i386 0:2.14.9-1.fc6 libpng.i386 2:1.2.10-10.fc6 libpng-devel.i386 2:1.2.10-10.fc6 librsvg2-devel.i386 0:2.16.1-1.fc6 libsane-hpaio.i386 0:1.7.4a-3.fc6 libstdc++-devel.i386 0:4.1.2-13.fc6 libvorbis-devel.i386 1:1.1.2-2.fc6 libxslt-devel.i386 0:1.1.21-1.fc6 linuxwacom.i386 0:0.7.4_1-2.2 logwatch.noarch 0:7.3-7.fc6 m4.i386 0:1.4.8-2 man.i386 0:1.6d-2.fc6 man-pages.noarch 0:2.39-7.fc6 minicom.i386 0:2.2-1.fc6 mkinitrd.i386 0:5.1.19.0.3-1 mlocate.i386 0:0.15-0.fc6.1 mutt.i386 5:1.4.2.3-1.fc6 nash.i386 0:5.1.19.0.3-1 nautilus.i386 0:2.16.2-7.fc6 nautilus-cd-burner.i386 0:2.16.3-1.fc6 netpbm.i386 0:10.35.32-1.fc6 netpbm-devel.i386 0:10.35.32-1.fc6 nfs-utils.i386 1:1.0.10-14.fc6 nss-tools.i386 0:3.11.7-0.6.2.fc6 nss_ldap.i386 0:257-3.fc6 openldap-devel.i386 0:2.3.30-2.fc6 opensp.i386 0:1.5.2-4.fc6 openssh.i386 0:4.3p2-25.fc6 openssh-askpass.i386 0:4.3p2-25.fc6 openssh-clients.i386 0:4.3p2-25.fc6 openssh-server.i386 0:4.3p2-25.fc6 openssl-devel.i386 0:0.9.8b-15.fc6 oprofile.i386 0:0.9.2-3.fc6 oprofile-gui.i386 0:0.9.2-3.fc6 orca.i386 0:1.0.1-1.fc6 pam-devel.i386 0:0.99.6.2-3.22.fc6 parted.i386 0:1.8.2-2.fc6 pinfo.i386 0:0.6.9-3.fc6 pirut.noarch 0:1.2.8-1.fc6 policycoreutils.i386 0:1.34.1-9.fc6 popt.i386 0:1.10.2.1-2.fc6 ppp.i386 0:2.4.4-1.fc6 psacct.i386 0:6.3.2-42.fc6 pygobject2-devel.i386 0:2.12.3-2.fc6 pygtk2-devel.i386 0:2.10.4-1.fc6 readahead.i386 1:1.3-7.fc6 redhat-rpm-config.noarch 0:8.0.45-9.fc6 rhgb.i386 0:0.16.4-3.fc6 rpm.i386 0:4.4.2.1-2.fc6 rpm-build.i386 0:4.4.2.1-2.fc6 rpm-libs.i386 0:4.4.2.1-2.fc6 rpm-python.i386 0:4.4.2.1-2.fc6 rsh.i386 0:0.17-38.fc6 rsync.i386 0:2.6.9-2.fc6 samba-client.i386 0:3.0.24-7.fc6 sane-backends.i386 0:1.0.18-15.fc6 sane-backends-libs.i386 0:1.0.18-15.fc6 scim-anthy.i386 0:1.2.4-1.fc6 scim-bridge.i386 0:0.4.10-1.fc6 scim-bridge-gtk.i386 0:0.4.10-1.fc6 selinux-policy.noarch 0:2.4.6-107.fc6 selinux-policy-targeted.noarch 0:2.4.6-107.fc6 sendmail.i386 0:8.14.1-4.2.fc6 setup.noarch 0:2.6.1.1-1.fc6 slang-devel.i386 0:2.0.7-1.fc6 slrn.i386 0:0.9.8.1pl1-2.fc6 smartmontools.i386 1:5.37-1.2.fc6 spamassassin.i386 0:3.1.9-1.fc6 strace.i386 0:4.5.16-1.fc6 subversion.i386 0:1.4.3-2.fc6 swig.i386 0:1.3.31-0.fc6 sysklogd.i386 0:1.4.1-41.fc6 system-config-date.noarch 0:1.8.12-2.fc6 system-config-network.noarch 0:1.3.96-1.fc6 system-config-network-tui.noarch 0:1.3.96-1.fc6 system-config-printer.i386 0:0.7.63.4-1.fc6 system-config-printer-libs.i386 0:0.7.63.4-1.fc6 system-config-securitylevel.i386 0:1.6.27-2 system-config-soundcard.noarch 0:2.0.6-6.fc6 system-config-users.noarch 0:1.2.47-1.fc6 systemtap.i386 0:0.5.13-1.fc6 tar.i386 2:1.15.1-27.fc6 tcpdump.i386 14:3.9.4-11.fc6 tcsh.i386 0:6.14-12 texinfo.i386 0:4.8-14.fc6 traceroute.i386 3:2.0.3-1.fc6 vim-common.i386 2:7.0.235-1.fc6 vim-enhanced.i386 2:7.0.235-1.fc6 vino.i386 0:2.13.5-6.fc6 vixie-cron.i386 4:4.1-69.fc6 vnc-server.i386 0:4.1.2-9.fc6 vte.i386 0:0.14.2-1.fc6 wget.i386 0:1.10.2-8.fc6.1 wpa_supplicant.i386 1:0.4.9-1.fc6 xorg-x11-drv-ati.i386 0:6.6.3-1.fc6 xorg-x11-drv-i810.i386 0:1.6.5-10.fc6 xorg-x11-drv-mga.i386 0:1.4.5-2.fc6 xorg-x11-drv-mouse.i386 0:1.2.1-1.fc6 xorg-x11-drv-s3.i386 0:0.5.0-1.fc6 xorg-x11-drv-savage.i386 0:2.1.2-3.fc6 xorg-x11-drv-tdfx.i386 0:1.3.0-2.fc6 xorg-x11-drv-trident.i386 0:1.2.3-1.fc6 xorg-x11-server-Xorg.i386 0:1.1.1-47.10.fc6 xterm.i386 0:227-1.fc6 yelp.i386 0:2.16.0-13.fc6 ypbind.i386 3:1.19-7.fc6 yum.noarch 0:3.0.6-1.fc6 yum-updatesd.noarch 0:3.0.6-1.fc6 zenity.i386 0:2.16.3-1.fc6
Replaced: bluez-pin.i386 0:0.30-5 diskdumputils.i386 0:1.3.6-5.1 gaim.i386 2:2.0.0-0.15.beta3.fc6 netdump.i386 0:0.7.16-5
Complete!
[~]#

 
 完了!

| | Comments (0) | TrackBack (0)

October 28, 2007

Linuxへの道 その5

入手したソフトウェアをコンパイルして自分Linux領域に導入する。

glibcのコンパイル
まず、FedoraのCコンパイラでダウンロードしてきたCライブラリのソースをコンパイルしてLinux領域に導入する。

[linux]#
[linux]# mkdir -pv /usr/local/source/build-glibc    ……ワークエリアを作成
mkdir: created directory `/usr/local/source/build-glibc'
[linux]# cd /usr/local/source/build-glibc
[build-glibc]# pwd
/usr/local/source/build-glibc
[build-glibc]#
[build-glibc]#
[build-glibc]#
[build-glibc]# ls ../
build-glibc glibc-2.4 module-init-tools-3.2
busybox-1.1.1 glibc-2.4.tar.bz2 module-init-tools-3.2.tar.bz2
busybox-1.1.1.tar.bz2 linux-2.6.16.1.tar.bz2
[build-glibc]# ../glibc-2.4/configure --with-tls \       ……NPTL準拠のglibcを作成
> --without-selinex \                ……SELinexに関するライブラリをコンパイルしない
> --with-headers=/usr/src/linux/include \  ……ヘッダファイルの格納場所
> --prefix=/usr                    ……glibcの格納場所
checking build system type... i586-pc-linux-gnu
checking host system type... i586-pc-linux-gnu
configure: running configure fragment for add-on nptl
checking sysdep dirs... sysdeps/i386/elf nptl/sysdeps/unix/sysv/linux/i386/i586 nptl/sysdeps/unix/sysv/linux/i386 sysdeps/unix/sysv/linux/i386 nptl/sysdeps/unix/sysv/linux nptl/sysdeps/pthread sysdeps/pthread sysdeps/unix/sysv/linux sysdeps/gnu sysdeps/unix/common sysdeps/unix/mman sysdeps/unix/inet sysdeps/unix/sysv/i386 nptl/sysdeps/unix/sysv sysdeps/unix/sysv sysdeps/unix/i386 nptl/sysdeps/unix sysdeps/unix sysdeps/posix nptl/sysdeps/i386/i586 sysdeps/i386/i586 sysdeps/i386/i486 nptl/sysdeps/i386/i486 sysdeps/i386/fpu nptl/sysdeps/i386 sysdeps/i386 sysdeps/wordsize-32 sysdeps/ieee754/ldbl-96 sysdeps/ieee754/dbl-64 sysdeps/ieee754/flt-32 sysdeps/ieee754 sysdeps/generic/elf sysdeps/generic
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking for gcc... gcc
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking how to run the C preprocessor... gcc -E
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for ranlib... ranlib
checking whether as is GNU as... yes
checking whether ld is GNU ld... yes
checking for as... as
checking version of as... 2.17.50.0.3, ok
checking for ld... ld
checking version of ld... 2.17.50.0.3, ok
checking for pwd... /bin/pwd
checking for gcc... gcc
checking version of gcc... 4.1.1, ok
checking for gnumake... no
checking for gmake... gmake
checking version of gmake... 3.81, ok
checking for gnumsgfmt... no
checking for gmsgfmt... no
checking for msgfmt... msgfmt
checking version of msgfmt... 0.14.6, ok
checking for makeinfo... makeinfo
checking version of makeinfo... 4.8, ok
checking for sed... sed
checking version of sed... 4.1.5, ok
checking for autoconf... autoconf
checking whether autoconf works... yes
checking whether ranlib is necessary... no
checking LD_LIBRARY_PATH variable... ok
checking whether GCC supports -static-libgcc... -static-libgcc
checking for bash... /bin/sh
checking for gawk... gawk
checking for perl... /usr/bin/perl
checking for install-info... /sbin/install-info
checking for bison... /usr/bin/bison
checking for signed size_t type... no
checking for libc-friendly stddef.h... yes
checking whether we need to use -P to assemble .S files... no
checking whether .text pseudo-op must be used... yes
checking for assembler global-symbol directive... .globl
checking for .set assembler directive... yes
checking for assembler .type directive prefix... @
checking for .symver assembler directive... yes
checking for ld --version-script... yes
checking for .previous assembler directive... yes
checking for .protected and .hidden assembler directive... yes
checking whether __attribute__((visibility())) is supported... yes
checking for broken __attribute__((visibility()))... no
checking for broken __attribute__((alias()))... no
checking whether to put _rtld_local into .sdata section... no
checking for .preinit_array/.init_array/.fini_array support... yes
checking for libunwind-support in compiler... no
checking for -z nodelete option... yes
checking for -z nodlopen option... yes
checking for -z initfirst option... yes
checking for -z relro option... yes
checking for -Bgroup option... yes
checking for libgcc_s suffix...
checking for --as-needed option... yes
checking whether --noexecstack is desirable for .S files... yes
checking for -z combreloc... yes
checking for -z execstack... yes
checking for -fpie... yes
checking for -fno-toplevel-reorder... no
checking for -fstack-protector... yes
checking whether cc puts quotes around section names... no
checking for assembler .weak directive... yes
checking whether CFI directives are supported... yes
checking for ld --no-whole-archive... yes
checking for gcc -fexceptions... yes
checking for __builtin_expect... yes
checking for __builtin_memset... no
checking for redirection of built-in functions... yes
checking for __thread... yes
checking for tls_model attribute... yes
checking for libgd... yes
checking for is_selinux_enabled in -lselinux... yes
checking for NSCD Flask permissions in selinux/av_permissions.h... yes
checking for audit_log_user_avc_message in -laudit... no
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for long double... yes
checking size of long double... 12
running configure fragment for sysdeps/i386/elf
checking for i386 TLS support... yes
running configure fragment for nptl/sysdeps/pthread
checking for forced unwind support... yes
checking for C cleanup handling... yes
running configure fragment for sysdeps/pthread
running configure fragment for sysdeps/unix/sysv/linux
checking for egrep... (cached) grep -E
checking installed Linux kernel header files... 2.0.10 or later
checking for symlinks in /usr/include... ok
running configure fragment for sysdeps/i386
checking if -g produces usable source locations for assembler-with-cpp... yes
checking for old glibc 2.0.x headers... no
checking whether -fPIC is default... no
configure: creating ./config.status
config.status: creating config.make
config.status: creating Makefile
config.status: creating config.h
config.status: executing default commands
[build-glibc]#
[build-glibc]#
[build-glibc]#
[build-glibc]# make
make -r PARALLELMFLAGS="" CVSOPTS="" -C ../glibc-2.4 objdir=`pwd` all
make[1]: ディレクトリ `/usr/local/source/glibc-2.4' に入ります
make subdir=csu -C csu ..=../ subdir_lib
make[2]: ディレクトリ `/usr/local/source/glibc-2.4/csu' に入ります
make[2]: ディレクトリ `/usr/local/source/glibc-2.4/csu' から出ます
make[2]: ディレクトリ `/usr/local/source/glibc-2.4/csu' に入ります
make[2]: `subdir_lib' に対して行うべき事はありません.
make[2]: ディレクトリ `/usr/local/source/glibc-2.4/csu' から出ます
make subdir=iconv -C iconv ..=../ subdir_lib
make[2]: ディレクトリ `/usr/local/source/glibc-2.4/iconv' に入ります
make[2]: ディレクトリ `/usr/local/source/glibc-2.4/iconv' から出ます
make[2]: ディレクトリ `/usr/local/source/glibc-2.4/iconv' に入ります
gcc gconv_open.c -c -std=gnu99 -O2 -Wall -Winline -Wwrite-strings -fmerge-all-constants -g -Wstrict-prototypes -mpreferred-stack-boundary=2 -pg -I../include -I/usr/local/source/build-glibc/iconv -I/usr/local/source/build-glibc -I../sysdeps/i386/elf -I../nptl/sysdeps/unix/sysv/linux/i386/i586 -I../nptl/sysdeps/unix/sysv/linux/i386 -I../sysdeps/unix/sysv/linux/i386 -I../nptl/sysdeps/unix/sysv/linux -I../nptl/sysdeps/pthread -I../sysdeps/pthread -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../sysdeps/unix/sysv/i386 -I../nptl/sysdeps/unix/sysv -I../sysdeps/unix/sysv -I../sysdeps/unix/i386 -I../nptl/sysdeps/unix -I../sysdeps/unix -I../sysdeps/posix -I../nptl/sysdeps/i386/i586 -I../sysdeps/i386/i586 -I../sysdeps/i386/i486 -I../nptl/sysdeps/i386/i486 -I../sysdeps/i386/fpu -I../nptl/sysdeps/i386 -I../sysdeps/i386 -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/ldbl-96 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754 -I../sysdeps/generic/elf -I../sysdeps/generic -I../nptl -I.. -I../libio -I. -nostdinc -isystem /usr/lib/gcc/i386-redhat-linux/4.1.1/include -isystem /usr/src/linux/include -D_LIBC_REENTRANT -include ../include/libc-symbols.h -DPROF -o /usr/local/source/build-glibc/iconv/gconv_open.op -MD -MP -MF /usr/local/source/build-glibc/iconv/gconv_open.op.dt -MT /usr/local/source/build-glibc/iconv/gconv_open.op
gconv_open.c: In function ‘__gconv_open’:
gconv_open.c:59: 警告: ‘ptr’ may be used uninitialized in this function

…略…

#gcc gconv_open.c -c -std=gnu99 -O2 -Wall -Winline -Wwrite-strings -fmerge-all-constants -g -Wstrict-prototypes -mpreferred-stack-boundary=2 -pg -I../include -I/usr/local/source/build-glibc/iconv -I/usr/local/source/build-glibc -I../sysdeps/i386/elf -I../nptl/sysdeps/unix/sysv/linux/i386/i586 -I../nptl/sysdeps/unix/sysv/linux/i386 -I../sysdeps/unix/sysv/linux/i386 -I../nptl/sysdeps/unix/sysv/linux -I../nptl/sysdeps/pthread -I../sysdeps/pthread -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../sysdeps/unix/sysv/i386 -I../nptl/sysdeps/unix/sysv -I../sysdeps/unix/sysv -I../sysdeps/unix/i386 -I../nptl/sysdeps/unix -I../sysdeps/unix -I../sysdeps/posix -I../nptl/sysdeps/i386/i586 -I../sysdeps/i386/i586 -I../sysdeps/i386/i486 -I../nptl/sysdeps/i386/i486 -I../sysdeps/i386/fpu -I../nptl/sysdeps/i386 -I../sysdeps/i386 -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/ldbl-96 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754 -I../sysdeps/generic/elf -I../sysdeps/generic -I../nptl -I.. -I../libio -I. -nostdinc -isystem /usr/lib/gcc/i386-redhat-linux/4.1.1/include -isystem /usr/src/linux/include -D_LIBC_REENTRANT -include ../include/libc-symbols.h -DPROF -o /usr/local/source/build-glibc/iconv/gconv_open.op -MD -MP -MF /usr/local/source/build-glibc/iconv/gconv_open.op.dt -MT /usr/local/source/build-glibc/iconv/gconv_open.op
gconv_open.c: In function ‘__gconv_open’:
gconv_open.c:59: 警告: ‘ptr’ may be used uninitialized in this function
gconv_open.c:344: internal compiler error: セグメンテーション違反です
完全なバグ報告を送って下さい。
適切ならばプリプロセス後のソースをつけてください。
を見れば方法が書いてあります。
The bug is not reproducible, so it is likely a hardware or OS problem.
make[2]: *** [/usr/local/source/build-glibc/iconv/gconv_open.op] エラー 1
make[2]: ディレクトリ `/usr/local/source/glibc-2.4/iconv' から出ます
make[1]: *** [iconv/subdir_lib] エラー 2
make[1]: ディレクトリ `/usr/local/source/glibc-2.4' から出ます
make: *** [all] エラー 2
[build-glibc]#

gconv_open.cのコンパイルでエラーが発生した。

> The bug is not reproducible, so it is likely a hardware or OS problem.
> バグには再現性がないので、ハードウェアかOSの問題でしょう。

なんどか「make」を繰り返すと中断したところから再開し、先へ進み同様のエラーとなる。
何回か繰り返したところ最後まで終了した。
非常に不安定である。

| | Comments (0) | TrackBack (0)

October 27, 2007

Linuxへの道 その4

なんとかメモリも手に入りやっとLinuxが気軽に使える環境ができた。

しかし、どうにもFedoraのGUI環境が重い。CUIで起動したいと思い立ち、ヘルプなど探してみたがCUIで起動する方法がみつけられない。もう少し学習を進めると軽い環境を自分で構築できるようになるのではないかと思う。

今は仕方がないのでウィンドウの動作を軽くする設定を試してみた。心持ち軽くなったようだ。

メインの自作デスクトップPC(Windows98SE2)にPuTTYを、ノートPC(WindowsVistaHomeEditionPremium)にPoderosaをインストールし、SSHで接続して利用することにする。

PuTTYはダイアログの日本語が文字化けしたが既知の問題でダウンロードサイト(PuTTY日本語パッチ適用版)の説明にしたがって設定を変更し解決。

> puttyjp.lng をテキストエディタで開き、
> 「_OFONTNAME_=MS Shell Dlg」と書かれている行を削除して保存する。

これでディスプレイ切り替え機で切り替える必要もなくCUI環境で利用できる。ログや実行結果の記録もコピー&ペーストでWindows環境にもってこられるのでブログの記録もやりやすくなった。

次は本題の開発環境の整備。自分のLinuxを作るために必要な道具を揃える。

Linux構築に必要なソフトウェア


ソフトウェアの入手手順
[~]$ su -
パスワード(P):
[~]# cd /usr/local/source
[source]#
[source]#
[source]#
[source]# wget http://ftp.gnu.org/gnu/glibc/glibc-2.4.tar.bz2
--23:31:32-- http://ftp.gnu.org/gnu/glibc/glibc-2.4.tar.bz2
ftp.gnu.org をDNSに問いあわせています... 140.186.70.20
ftp.gnu.org|140.186.70.20|:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 15202445 (14M) [application/x-tar]
Saving to: `glibc-2.4.tar.bz2'

100%[===============================================================================================================>] 15,202,445 1.06M/s in 18s

23:31:51 (843 KB/s) - `glibc-2.4.tar.bz2' を保存しました [15202445/15202445]

[source]#
[source]#
[source]# wget http://www.busybox.net/downloads/busybox-1.1.1.tar.bz2
--23:32:19-- http://www.busybox.net/downloads/busybox-1.1.1.tar.bz2
www.busybox.net をDNSに問いあわせています... 140.211.166.42
www.busybox.net|140.211.166.42|:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 1424767 (1.4M) [application/x-tar]
Saving to: `busybox-1.1.1.tar.bz2'

100%[===============================================================================================================>] 1,424,767 532K/s in 2.6s

23:32:23 (532 KB/s) - `busybox-1.1.1.tar.bz2' を保存しました [1424767/1424767]

[source]#
[source]#
[source]# wget ftp://ftp.kernel.org/pub/linux/utils/kernel/module-init-tools/module-init-tools-3.2.tar.bz2
--23:32:48-- ftp://ftp.kernel.org/pub/linux/utils/kernel/module-init-tools/module-init-tools-3.2.tar.bz2
=> `module-init-tools-3.2.tar.bz2'
ftp.kernel.org をDNSに問いあわせています... 204.152.191.37, 204.152.191.5
ftp.kernel.org|204.152.191.37|:21 に接続しています... 接続しました。
anonymous としてログインしています... ログインしました!
==> SYST ... 完了しました。 ==> PWD ... 完了しました。
==> TYPE I ... 完了しました。 ==> CWD /pub/linux/utils/kernel/module-init-tools ... 完了しました。
==> SIZE module-init-tools-3.2.tar.bz2 ... 165109
==> PASV ... 完了しました。 ==> RETR module-init-tools-3.2.tar.bz2 ... 完了しました。
長さ: 165109 (161K)

100%[===============================================================================================================>] 165,109 183K/s in 0.9s

23:32:51 (183 KB/s) - `module-init-tools-3.2.tar.bz2' を保存しました [165109]

[source]#
[source]#
[source]# wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.16.1.tar.bz2
--23:33:16-- http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.16.1.tar.bz2
www.kernel.org をDNSに問いあわせています... 204.152.191.37, 204.152.191.5
www.kernel.org|204.152.191.37|:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 40841031 (39M) [application/x-bzip2]
Saving to: `linux-2.6.16.1.tar.bz2'

100%[===============================================================================================================>] 40,841,031 256K/s in 43s

23:34:00 (938 KB/s) - `linux-2.6.16.1.tar.bz2' を保存しました [40841031/40841031]

[source]#
[source]#
[source]# ls -l
合計 56360
-rw-r--r-- 1 root root 1424767 3月 23 2006 busybox-1.1.1.tar.bz2
-rw-r--r-- 1 root root 15202445 3月 6 2006 glibc-2.4.tar.bz2
-rw-r--r-- 1 root root 40841031 3月 28 2006 linux-2.6.16.1.tar.bz2
-rw-r--r-- 1 root root 165109 10月 27 23:32 module-init-tools-3.2.tar.bz2
[source]#


ソフトウェアの展開と設定
[source]#
[source]#
[source]# cd /usr/local/source
[source]# pwd
/usr/local/source
[source]# tar jxvf busybox-1.1.1.tar.bz2
[source]# tar jxvf module-init-tools-3.2.tar.bz2
[source]# tar jxvf glibc-2.4.tar.bz2
[source]# cd /usr/src
[src]# pwd
cd /usr/src
[src]# tar jxvf /usr/local/source/linux-2.6.16.1.tar.bz2
[src]#
[src]# ln -s linux-2.6.16.1 linux
[src]# ls -l
合計 20
drwxr-xr-x 3 root root 4096 9月 11 07:48 kernels
lrwxrwxrwx 1 root root 14 10月 28 00:04 linux -> linux-2.6.16.1
drwxrwxrwx 19 root root 4096 3月 28 2006 linux-2.6.16.1
drwxr-xr-x 7 root root 4096 9月 11 08:59 redhat
[src]#
[src]#
[src]# cd linux
[linux]# pwd
/usr/src/linux
[linux]# make mrproper
[linux]# make include/linux/version.h
Makefile:476: .config: そのようなファイルやディレクトリはありません
CHK include/linux/version.h
UPD include/linux/version.h
[linux]#
[linux]#
[linux]#
[linux]# cd include
[include]# pwd
/usr/src/linux/include
[include]# ln -s asm-i386 asm
[include]# ls -l asm
lrwxrwxrwx 1 root root 8 10月 28 17:02 asm -> asm-i386
[include]#
[include]#
[include]#
[include]# cd linux
[linux]# pwd
/usr/src/linux/include/linux
[linux]# touch autoconf.h
[linux]# ls -l autoconf.h
-rw-r--r-- 1 root root 0 10月 28 17:02 autoconf.h
[linux]#
[linux]#

以上でコンパイルの準備完了。

| | Comments (0) | TrackBack (0)

September 18, 2007

Language Unavailable

Language Unavailable
ja_JP.UTF8 display is unavailable in text mode.
The instration will continue in English.

言語が使えません
ja_JP.UTF8表示がテキストモードで使えません。
インストールは継続しますが英語です。

| | TrackBack (0)

September 17, 2007

Linuxへの道 その3

 いよいよインストール。
 が、いきなりエラーに遭遇。「メモリが足りません」
 最低でも128MBが必要とのこと。

 なんとかインストールだけは済ませようとメインパソコンのメモリを流用。
 インストールは画面の質問に答えて自動的に終わる。今回の書籍の環境を作るために既定値を変えて操作した点は以下のとおり。


  1. パーティションを手動で作成するため"Create custom layout."を選択
  2. 導入するパッケージとして「ソフトウェア開発」を選択しLinuxの開発に必要なコンパイラなどをインストールする
  3. SELinuxを無効にする
  4. 各種ソフトウェアを最新版に更新

 
パーティションの大きさ
/boot100MB以上
/usr/local/mylinux2約1GB
スワップ搭載メモリの2倍程度
/残りすべて

 
ソフトウェアを更新するコマンド
[user@vu50l ~]$ su -
パスワード(P):
[root@vu50l ~]# yum -y update
Loading "installonlyn" plugin
Setting up Update Process
Setting up repositories
core 100% |=========================| 1.1 kB 00:00
updates 100% |=========================| 1.2 kB 00:00
extras 100% |=========================| 1.1 kB 00:00
Reading repository metadata in from local files
primary.xml.gz 100% |=========================| 824 kB 00:00
core : ################################################## 2242/2242
primary.xml.gz 100% |=========================| 405 kB 00:00
updates : ################################################## 1099/1099
primary.xml.gz 100% |=========================| 1.7 MB 00:11
extras : ################################################## 5386/5386
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for nss_ldap to pack into transaction set.
nss_ldap-257-3.fc6.i386.r 100% |=========================| 28 kB 00:00
---> Package nss_ldap.i386 0:257-3.fc6 set to be updated
---> Downloading header for docbook-style-xsl to pack into transaction set.
docbook-style-xsl-1.72.0- 100% |=========================| 156 kB 00:00
---> Package docbook-style-xsl.noarch 0:1.72.0-1.fc6 set to be updated
  
……略……
 
elfutils-libelf-devel-sta 100% |=========================| 14 kB 00:00
---> Package elfutils-libelf-devel-static.i386 0:0.129-1.fc6 set to be updated
---> Downloading header for busybox to pack into transaction set.
busybox-1.2.0-4.i386.rpm 100% |=========================| 7.1 kB 00:00
---> Package busybox.i386 1:1.2.0-4 set to be updated
--> Running transaction check
--> Processing Conflict: elfutils-libelf conflicts elfutils-libelf-devel > 0.123-1.fc6
--> Finished Dependency Resolution
Error: elfutils-libelf conflicts with elfutils-libelf-devel > 0.123-1.fc6
[root@vu50l ~]#

 
 異常終了してしまう。最新版にしていなくても特に問題はないだろうと気にしながらも先に進むことにする。

 さて、インストールは終わったもののメモリをなんとかしないとLinuxを使うたびにメモリを移動しなければならない。どう考えても非現実的である。
 この際、随分辛抱して使っていたメインPCのメモリとハードディスクもアップグレードすることにした。メモリが手に入るまでLinuxへの道は一休みである。

| | Comments (0) | TrackBack (0)

August 30, 2007

Linuxへの道 その2

 ダウンロードは無事終了。CD-Rに焼く方法が分からない。件の書籍にはダウンロードの後は、インストール画面の記述。
 とりあえず通常のデータを焼くようにWindowsの機能を使ってみたところUDFというDVD用のファイルシステムで記録されて開発用PC(NEC VALUESTAR VU50L/25D)では読めなかった。CD用のファイルシステムを指定してみたが、通常のファイルとして読めるだけで、インストールプログラムは起動できない。
 初心に返ってFedoraのInstration Instructionの記述を読むと書いてあった。


ISO images are not written to CDs/DVDs the same way as other files.
   ……略……
If you are using another operating system, refer to the documentation for your burning software.


ISOイメージは他のファイルと同じ方法ではCDやDVDに書き込めません。
   ……略……
Fedora以外のオペレーティングシステムを用いるときには、書き込みソフトの説明書を参照してください。

 私が書き込み用に使ったOSはWindows Vistaが乗ったNECのオールインパソコン。書き込みソフトはRoxyoのEasy Media Creator® 9がバンドルされていた。
 ISOイメージを書き込む機能があり、なんなくインストールディスクが作成できた。
 開発用PC Altair (NEC PC-VU50L25D)に挿入して再起動する。BIOSはCDから起動できるように設定済みである。めでたくFedoraのインストール画面が表示される。
 マニュアルを読まずに遠回りしてCD-Rを数枚無駄にした。間抜けだった。ファイルシステムについての知識と少しの教訓を学んだ。

| | Comments (0) | TrackBack (0)

August 21, 2007

Linuxへの道

 古いパソコンが1台手に入った。NEC VALUESTAR VU50L/25D。以下vu50lと呼ぶ。
 奇しくも「自分で作るLinux OS」という本が職場にあった。ぱらぱらとめくって拾い読みしていると,試してみようという気になってきた。フラッシュメモリから起動するLinuxを作る方法を解説しているのでフラッシュメモリから起動できるマザーボードが必要である。もちろんvu50lではできないが,Linuxのコンパイルを通して少なからずLinuxについて学べるであろう。あまりお金をかけずに行けるところまで行ってみようと思う。
 まずは、開発環境を構築する。

 記事には、最新Linux「Fedora Core 5」のディストリビューションをダウンロードとあるが,2006年春の記述で,すでにバージョンは7が最新となっている。
 取り合えず記事のとおりに,FedoraプロジェクトのWebページhttp://fedora.redhat.com/Downloadから「i386」のリンクを開くとFedora Core 6のダウンロードページが開いた。
 成り行きに任せてそのまま,5つのインストールイメージをダウンロードしようと試みたが,「サーバーが拡張情報を返しました」というエラーが発生。以下は,そのメッセージダイアログ。

Error1

 このメッセージは設定が原因のようである。
 vu50lにインストールしているブラウザはIE6のSP1だ。別のPCからIE6SP2で試すとうまく行く。SP2でもインターネットオプションの[詳細設定]タブ→[ブラウズ]にある「パッシブFTP(ファイアウォールおよびDSLモデム互換用)を使用する」にチェックを外すと同じエラーが出た。だた,この設定はIE6SP1にはない。

 vu50lにはCD-ROMドライブしかないし,Linux boxにするつもりなので余計な手間はかけずに別のPCでインストールCDを作成することにした。

| | Comments (0) | TrackBack (0)