« 2005年6月 | メイン | 2005年11月 »
2005年10月24日
Apache
当初の目的のWebのテスト用サーバーの構築に取りかかることにする。
目標は、現在の環境とほぼ同じことがテストできる環境。
主に、PHP+MySQLの環境が試せること。
デフォルトで、Apache起動と、ユーザーディレクトリへのアクセスは可能。
PHPのファイルへのアクセスがダウンロードになってしまうので、まずはPHPを動作させる。
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
のコメントをはずす。
ついでに、
AddHandler cgi-script .cgi .sh .pl
AddType text/html .shtml
AddHandler server-parsed .shtml
のコメントもはずす。テスト用環境なので、多少多めにはずしても問題なかろう。
動かない…。
LoadModule php4_module /usr/lib/apache/1.3/libphp4.so
をコメントアウトで動作。
投稿者 mituha : 21:11
ProFtpd
とりあえず、立ち上がるようにはなった。
が、接続してもファイル一覧が見えない?
検索してみると仕様上、FFFTPとの相性問題らしいが、FFFTPもバージョンアップされていて、設定(FFFTP)を変えることで問題なくなった。
次はApacheの設定をいじることにする。
投稿者 mituha : 01:20
2005年10月23日
xinetd
ProFtpdを動作させようとするがうまく動かないので、ふらっと # aptitude install xinetd としてみた。
すると、telnetとか動かなくなってしまった…。
SSHで接続していたので、とりあえず、そのままあれこれいじってみる。
ってか、接続切ったら2度と接続できない可能性もあるか…。
/etc/xinet.d/ の下にtelnetのファイルを作成。
# vi /etc/xinet.d/
service telnet
{
disable = no
flags = REUSE
socket_type = stream
wait = no
uset = root
setver = /usr/sbin/in.telnetd
only_from = 127.0.0.1 192.168.0.0/24
}
# /etc/init.d/xinetd restart
なんとかtelnet接続も可能っぽい。
同じような形でswatとかも作ると接続できるようになった。
swat は port = 901 を足す。flags不要?
色々調べてるうちに webmin_xinetd もあるらしいので入れてみる。
ところで、ProFtpdが動作しなかったのは、設定が悪かったみたい。
/etc/proftpd.conf の
LsDefaultOptions "-l" が何かだめと言われる。
とりあえず、ListOptions "-a" にしたら動作するようなので、詳しくは後日調べることにする。
投稿者 mituha : 02:14
2005年10月19日
sarge化
参考
APT HOWTO
Debian JP Project
てきとうにバージョンアップを試してみた。
/etc/apt/sources.list のwoodyをsargeに変更。
# apt-get install netselect
# apt-get install wget
# wget http://www.debian.or.jp/debian-ftp-mirrors-jp
# netselect -vv `cat debian-ftp-mirrors-jp`
[`]の文字を普段使わないから思わず探してしまった。``でくくった部分はコマンドが実行されるらしい。
ミラーサイトで早そうな場所を選択。
sources.listのサンプルもあったので参考に書き換える。
# apt-get update
# apt-get dist-update
でがりがりと更新。
よくわからいので適当にすすめる。
何かあちこち設定も変わったらしく、webminとか動かなく(アクセス拒否)なってしまった。
/etc/webmin/miniserv.conf
の中身が変わったせいっぽい。
allow=127.0.0.1 192.168.0.0
としてとりあえずネットワーク内からのアクセスを可能に変更。
Linuxは知らないことだらけでおもしろい。
地道にいじって遊ぶことにする。
投稿者 mituha : 23:03
2005年10月17日
LAMP環境構築
とりあえず、あれこれ適当にインストールしてみる。
# apt-get install samba
# apt-get install swat
/etc/inetd.conf
を編集してswapを有効にする。
再起動は # /etc/init.d/inetd restart
接続はhttp://xxxxx:901/
# apt-get install apache
# apt-get install php4
# apt-get install mysql-server
# apt-get install php4-mysql
# apt-get install webmin
# apt-get install webmin-mysql
# apt-get install webmin-apach
# apt-get install webmin-core
# apt-get install webmin-samba
接続はhttps://xxxxx:10000/
# apt-get install php4-pear
投稿者 mituha : 22:13
現在のパッケージ一覧
dpkg -l コマンドで現在のパッケージ一覧の取得が可能。
KURO-BOX:~# dpkg -l Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed |/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad) ||/ Name Version Description +++-==============-==============-============================================ ii adduser 3.47 Add and remove users and groups ii amiga-fdisk 0.04-6 Partition editor for Amiga ii apt 0.5.4 Advanced front-end for dpkg ii apt-utils 0.5.4 APT utility programs ii at 3.1.8-11 Delayed job execution and batch processing ii base-config 1.33.18 Debian base configuration package ii base-files 3.0.2 Debian base system miscellaneous files ii base-passwd 3.4.1 Debian Base System Password/Group Files ii bash 2.05a-11 The GNU Bourne Again SHell ii bsdmainutils 5.20020211-4.9 More utilities from FreeBSD. ii bsdutils 2.11n-7 Basic utilities from 4.4BSD-Lite. ii console-common 0.7.14 Basic infrastructure for text console config ii console-data 1999.08.29-24. Keymaps, fonts, charset maps, fallback table ii console-tools 0.2.3-23.3 Linux console and font utilities. ii console-tools- 0.2.3-23.3 Shared libraries for Linux console and font ii cpio 2.4.2-39woody1 GNU cpio -- a program to manage archives of ii cron 3.0pl1-72 management of regular background processing ii debconf 1.0.32 Debian configuration management system ii debianutils 1.16.2woody1 Miscellaneous utilities specific to Debian. ii dhcp-client 2.0pl5-11woody DHCP Client ii diff 2.7-29 File comparison utilities ii dpkg 1.9.21 Package maintenance system for Debian ii e2fsprogs 1.27-2 The EXT2 file system utilities and libraries ii ed 0.2-19 The classic unix line editor ii exim 3.35-1woody4 An MTA (Mail Transport Agent) ii fdutils 5.3-7 Linux floppy utilities ii fileutils 4.1-10 GNU file management utilities ii findutils 4.1.7-2 utilities for finding files--find, xargs, an ii ftp 0.17-9 The FTP client. ii gettext-base 0.10.40-5 GNU Internationalization utilities for the b ii grep 2.4.2-3 GNU grep, egrep and fgrep. ii groff-base 1.17.2-15.wood GNU troff text-formatting system (base syste ii gzip 1.3.2-3woody5 The GNU compression utility. ii hfsutils 3.2.6-7 Tools for reading and writing Macintosh volu ii hostname 2.09 A utility to set/show the host name or domai ii ifupdown 0.6.4-4 High level tools to configure network interf ii info 4.1-2 Standalone GNU Info documentation browser ii ipchains 1.3.10-15 Network firewalling for Linux 2.2.x ii iptables 1.2.6a-5.0wood IP packet filter administration tools for 2. ii klogd 1.4.1-10 Kernel Logging Daemon ii libc6 2.2.5-11.8 GNU C Library: Shared libraries and Timezone ii libcap1 1.10-12 support for getting/setting POSIX.1e capabil ii libdb2 2.7.7.0-7 The Berkeley database routines (run-time fil ii libdb3 3.2.9-16 Berkeley v3 Database Libraries [runtime] ii libgdbmg1 1.7.3-27 GNU dbm database routines (runtime version). ii libident 0.22-2 simple RFC1413 client library - runtime ii libldap2 2.0.23-6.3 OpenLDAP libraries. ii liblockfile1 1.03 NFS-safe locking library, includes dotlockfi ii libncurses5 5.2.20020112a- Shared libraries for terminal handling ii libnewt0 0.50.17-9.6 Not Erik's Windowing Toolkit - text mode win ii libpam-modules 0.72-35 Pluggable Authentication Modules for PAM ii libpam-runtime 0.72-35 Runtime support for the PAM library ii libpam0g 0.72-35 Pluggable Authentication Modules library ii libpcap0 0.6.2-2 System interface for user-level packet captu ii libpcre3 3.4-1.1 Philip Hazel's Perl Compatible Regular Expre ii libperl5.6 5.6.1-8.9 Shared Perl library. ii libpopt0 1.6.2-7 lib for parsing cmdline parameters ii libreadline4 4.2a-5 GNU readline and history libraries, run-time ii libsasl7 1.5.27-3.1wood Authentication abstraction library. ii libssl0.9.6 0.9.6c-2.woody SSL shared libraries ii libstdc++2.10- 2.95.4-11woody The GNU stdc++ library ii libwrap0 7.6-9 Wietse Venema's TCP wrappers library ii login 20000902-12woo System login tools ii logrotate 3.5.9-8 Log rotation utility ii mac-fdisk 0.1-8 Apple disk partition manipulation tool ii mailx 8.1.2-0.200204 A simple mail user agent. ii make 3.79.1-14 The GNU version of the "make" utility. ii makedev 2.3.1-58 Creates device files in /dev. ii man-db 2.3.20-18.wood The on-line manual pager ii manpages 1.39-1.1 Man pages about using a Linux system. ii mawk 1.3.3-8 a pattern scanning and text processing langu ii modconf 0.2.43 Device Driver Configuration ii modutils 2.4.15-1 Linux module utilities. ii mount 2.11n-7 Tools for mounting and manipulating filesyst ii nano 1.0.6-3 free Pico clone with some new features ii ncurses-base 5.2.20020112a- Descriptions of common terminal types ii ncurses-bin 5.2.20020112a- Terminal-related programs and man pages ii net-tools 1.60-4 The NET-3 networking toolkit ii netbase 4.07 Basic TCP/IP networking system ii netkit-inetd 0.10-9 The Internet Superserver ii netkit-ping 0.10-9 The ping utility from netkit ii nvi 1.79-20 4.4BSD re-implementation of vi. ii passwd 20000902-12woo Change and administer password and group dat ii pciutils 2.1.9-4 Linux PCI Utilities (for 2.[1234].x kernels) ii perl 5.6.1-8.9 Larry Wall's Practical Extraction and Report ii perl-base 5.6.1-8.9 The Pathologically Eclectic Rubbish Lister. ii perl-modules 5.6.1-8.9 Core Perl modules. ii powerpc-utils 1.1.3-5 Various utilities for Linux/PowerPC ii ppp 2.4.1.uus-4 Point-to-Point Protocol (PPP) daemon. ii pppconfig 2.0.14 A text menu based utility for configuring pp ii pppoe 3.3-1.2 PPP over Ethernet driver ii pppoeconf 0.9.10.6 configures PPPoE/ADSL ii procps 2.0.7-8.woody1 The /proc file system utilities. ii proftpd 1.2.4+1.2.5rc1 Versatile, virtual-hosting FTP daemon ii proftpd-common 1.2.4+1.2.5rc1 Versatile, virtual-hosting FTP daemon ii psmisc 20.2-2.1 Utilities that use the proc filesystem ii quik 2.0e-0.6 Bootloader for PowerMac or CHRP systems ii sed 3.02-8 The GNU sed stream editor. ii setserial 2.17-24 Controls configuration of serial ports. ii shellutils 2.0.11-11 The GNU shell programming utilities. ii slang1 1.4.4-7.2 The S-Lang programming library - runtime ver ii sysklogd 1.4.1-10 System Logging Daemon ii sysvinit 2.84-2woody1 System-V like init. ii tar 1.13.25-2 GNU tar ii tasksel 1.18 Tool for selecting tasks for installation on ii tcpd 7.6-9 Wietse Venema's TCP wrapper utilities ii telnet 0.17-18woody3 The telnet client. ii telnetd 0.17-18woody3 The telnet server. ii textutils 2.0-12 The GNU text file processing utilities. ii util-linux 2.11n-7 Miscellaneous system utilities. ii whiptail 0.50.17-9.6 Displays user-friendly dialog boxes from she ii yaboot 1.3.6-1 Yet Another Bootloader ii zlib1g 1.1.4-1.0woody compression library - runtime KURO-BOX:~#
投稿者 mituha : 00:00
2005年10月16日
apt-get
パッケージ管理をしてくれるものらしい。
Windows Update みたいなものと思えば良さそう。
とりあえず、apt-get update をしてみた。
なにやら、woodyという、文字列があちこち出てくる。
Debianのパッケージには安定版(stable)、テスト版(testing)、不安定版(unstable)とあるらしい。
で、debian_2005_08_21_dist.tgzの時点では、stable(woody)、testing(sarge)、unstable(sid)らしい。
このwoody,sargeはコードネームらしく、Debian3.0が、woody、次のバージョンがsargeみたいです。
なお、現在はsargeがstable(安定版)になったみたいなので、そのうちアップグレードしたいと思う。
パッケージ取得用の設定ファイルの中身
ファイルの中身の表示はcatコマンドで行う。
KURO-BOX:~# cat /etc/apt/sources.list # See sources.list(5) for more information, especialy # Remember that you can only use http, ftp or file URIs # CDROMs are managed through the apt-cdrom tool.# Security updates for "stable"
deb http://security.debian.org woody/updates main contrib
#deb http://security.debian.org testing/updates main contrib# Woody
#deb http://ftp2.de.debian.org/pub/debian woody main contrib
#deb http://ftp2.de.debian.org/pub/debian-non-US woody/non-US main contribdeb ftp://ftp.dti.ad.jp/pub/Linux/debian woody main contrib
deb ftp://ftp.dti.ad.jp/pub/Linux/debian-non-US woody/non-US main contrib# Sources
#deb-src http://ftp2.de.debian.org/pub/debian woody main contrib
#deb-src http://ftp2.de.debian.org/pub/debian-non-US woody/non-US main contrib
deb-src ftp://ftp.dti.ad.jp/pub/Linux/debian woody main contrib
deb-src ftp://ftp.dti.ad.jp/pub/Linux/debian-non-US woody/non-US main contrib
# Testing
#deb http://ftp2.de.debian.org/pub/debian testing main contrib non-free
#deb http://ftp2.de.debian.org/pub/debian-non-US testing/non-US main contrib non-free# Sources
#deb-src http://ftp2.de.debian.org/pub/debian testing main contrib non-free
#deb-src http://ftp2.de.debian.org/pub/debian-non-US testing/non-US main contrib non-free# Unstable
#deb http://ftp2.de.debian.org/debian unstable main contrib non-free
#deb http://ftp2.de.debian.org/debian-non-US unstable/non-US main contrib non-free# Sources
#deb-src http://ftp2.de.debian.org/debian unstable main contrib non-free
#deb-src http://ftp2.de.debian.org/debian-non-US unstable/non-US main contrib non-free# Experimental
#deb http://ftp2.de.debian.org/debian ../project/experimental main contrib non-free
#deb-src http://ftp2.de.debian.org/debian ../project/experimental main contrib non-free# Mozilla
# deb http://non-us.debian.org/~kitame/mozilla ./
# deb-src http://non-us.debian.org/~kitame/mozilla ./# GNOME 2.0
# deb http://www.gnome.de/debian/ ./# KDE 3
# deb http://ktown.kde.org/~nolden/kde stable main
# deb-src http://ktown.kde.org/~nolden/kde stable main
# We get packages from testing/unstable for now# cdbakeoven
# deb http://coyote.asoc.euitt.upm.es/mud/debian/ ./# XFree 4.2/4.3
# deb http://people.debian.org/~branden/packages sid/i386/
# deb-src http://people.debian.org/~branden/packages sid/source/
# deb http://www.penguinppc.org/~daniels/sid/i386 ./
# deb-src http://www.penguinppc.org/~daniels/sid/source ./# Java
#deb ftp://ftp.gwdg.de/pub/languages/java/linux/debian woody main non-free
#deb-src ftp://ftp.gwdg.de/pub/languages/java/linux/debian woody main non-free
#deb ftp://ftp.gwdg.de/pub/languages/java/linux/debian unstable main non-free
#deb-src ftp://ftp.gwdg.de/pub/languages/java/linux/debian unstable main non-free
# deb http://people.debian.org/~sgybas/jdk13# LyX & others (now in debian/unstable)
# deb ftp://ntama.uni-mainz.de/pub/debian unofficial/
# deb-src ftp://ntama.uni-mainz.de/pub/debian unofficial/# Evolution
#deb ftp://ftp.ximian.com/pub/debian stable main
#deb-src ftp://ftp.ximian.com/pub/debian stable main# Blades Repository (pppoeconf & co)
# deb http://people.debian.org/~blade/testing ./
# deb-src http://people.debian.org/~blade/testing ./# Wine CVS snapshot
# deb http://people.debian.org/~andreas/debian wine main
# deb-src http://people.debian.org/~andreas/debian wine main# deb cdrom:[Debian GNU/Linux 2.2 r3 _Potato_ - Official i386 Binary-1 (20010427)]/ unstable contrib main non-US/contrib non-US/main
ファイルの中身表示用のコマンドは他にもmore、less等ある。
lessはインストールされていなかった。apt-get install less でインストールされた。
明示的にwoodyを指定してあるみたいなので、もう少し理解するまでこのまま(woody)にしておく。
stable指定されてたら、勝手にバージョンアップされるのかも。
投稿者 mituha : 23:47
2005年10月15日
ユーザー/パスワード変更
セキュリティ上、および、自分用にrootのパスワード変更と、一般ユーザーの追加、および、登録済みのユーザー(tmp-kun)の削除。
以降の表記ではユーザー名等はxxxxxで伏せてあります。
rootユーザーのパスワード変更。
passwdで変更。
一般ユーザー(tmp-kun)の変更。
tmp-kunの代わりに通常使用するユーザーを作成します。
tmp-kun@KURO-BOX:~$ su -
Password: xxxxx
KURO-BOX:~# adduser
Enter a username to add: xxxxx
Adding user xxxxx...
Adding new group xxxxx (1001).
Adding new user xxxxx (1001) with group xxxxx.
Creating home directory /home/xxxxx.
Copying files from /etc/skel
Enter new UNIX password: xxxxx
Retype new UNIX password: xxxxx
passwd: password updated successfully
Changing the user information for xxxxx
Enter the new value, or press return for the default
Full Name []:
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [y/n] y
作成したユーザーでログインできることの確認。
ログインできた場合、デフォルトの一般ユーザー(tmp-kun)の削除を行います。
xxxxx@KURO-BOX:~$ su
Password:xxxxx
KURO-BOX:/home/xxxxx# deluser --remove-all-files tmp-kun
Looking for files to backup/remove...
Removing files...
Removing user tmp-kun...
done.
--remove-all-filesオプションをつけて、関連ファイルを含めてすべて削除。
メモ
su
id
passwd
投稿者 mituha : 14:27
インストール
WEB用のテスト環境を作ってみようと、玄箱HGを購入。
しかし、Linuxの知識がほぼ0に近いので、かなり負け気分。
無印と、HGで手順が異なるのか、途中、FlashROM異常の5回点滅等の状態になって、かなり焦りました。
6時間ほど格闘して、なんとかDebian化の入り口までたどり着いたので寝ることにする。
とりあえず、メモ。
後日、修正予定。
玄箱うぉううぉう♪さん。
debian_2005_08_21_dist.tgz
大阪てきとー日記さんの記事をほぼそのまま実行でなんとか成功。
イメージファイルが新しかった(2005/08/21)おかげか、細かい対策はなしでいけてる模様?
root/kuroadmin
#echo -n 'NGNG' > /dev/fl3
#reboot
#mount /dev/root on / type auto (rw,errors=remount-ro,errors=remount-ro) proc on /proc type proc (rw) none on /dev/pts type devpts (rw,gid=5,mode=20)#/bin/mount -t ext3 /dev/hda1 /mnt
#/bin/mount -t ext3 /dev/hda3 /mnt2#mount
/dev/root on / type auto (rw,errors=remount-ro,errors=remount-ro)
proc on /proc type proc (rw)
none on /dev/pts type devpts (rw,gid=5,mode=20)
/dev/hda1 on /mnt type ext3 (rw)
/dev/hda3 on /mnt2 type ext3 (rw)
#cd /mnt #rm -r *#tar zxvf /mnt2/share/debian_2005_08_21_dist.tgz
#echo -n 'OKOK' > /dev/fl3 #reboot
tmp-kun/tmp-kun
#su -
root
#vi /etc/network/interfaces (#vi /etc/hosts.allow) #vi /etc/resolv.conf #vi /etc/hosts
投稿者 mituha : 03:42
玄箱メモ
玄箱カテゴリーについて。
Linuxの知識がほとんどない状態から、玄箱を構築していく課程を自分用にメモしていきます。
記載内容が正しい保証はありません。
とりあえずは適当にメモ。
そのうち、整頓できたらする方針で。
投稿者 mituha : 00:00
2005年10月 9日
PEARメモ
PEARのインストールメモ
unix系は普段さわらないから忘れまくり…
共有ホストにおける PEAR のローカルコピーのインストール
$ pear -s -c ~/.pearrc -d doc_dir=/home/HOME/pear/docs
-d ext_dir=/home/HOME/pear/ext
-d php_dir=/home/HOME/pear/lib
-d data_dir=/home/HOME/pear/data
-d test_dir=/home/HOME/pear/tests
-d cache_dir=/home/HOME/pear/cache
-d bin_dir=/home/HOME/pear/bin
$ pear -c ~/.pearrc install Archive_Tar PEAR Console_Getopt XML_RPC
.で始まるファイルの表示。
%ls -la
.cshrcにパスの追加。
$HOME/pear/bin
vi
aで文字挿入。編集モード。
ESCでコマンドモード。
ZZで上書き保存で終了。
php.ini
include_pathに"/home/HOME/pear/lib"を追加。
新規時、include_path=".:/home/HOME/pear/lib"
サーバーに元々入っているPEARのバージョンが1.3.2のため、requires package 'PEAR' >= 1.3.3 等と表示され、うまくインストールされないパッケージがあった。最新のPEARも。
%pear install pear-1.3.3
として、古いのをいったんインストール。
%pear upgrade PEAR
で最新版インストール成功。
元々サーバーに入っていたバージョン
%pear list
Installed packages:
===================
Package Version State
Archive_Tar 1.1 stable
Console_Getopt 1.2 stable
DB 1.6.2 stable
HTTP 1.2.2 stable
Mail 1.1.3 stable
Net_SMTP 1.2.6 stable
Net_Socket 1.0.1 stable
PEAR 1.3.2 stable
XML_Parser 1.0.1 stable
XML_RPC 1.1.0 stable
しかし、うまく動作していないような?
pear list では新しくなるが、PEAR_Infoでは古いままになっている。
PEAR_Infoが使用できてるから良いといえば良い気もするが?
投稿者 mituha : 23:09