かなり前にLinuxを勉強した事の忘備録です

良くあるお約束事ですが・・・記事内容の実行は、あくまで自己責任でお願いします。
間違った情報などありましたらお知らせいただければ幸いです。

(#はスーパーユーザー、$は一般ユーザで作業)


ユーザ追加

#useradd user

#passwd user password


sudoの登録

#vi /etc/sudoers

hoge ALL=(ALL)ALL

ftpサーバの起動

serviceコマンド で proftpdFTPサーバ)を起動する

#service proftpd start


カーネルのupdate

# apt-get update

# apt-get dist-upgrade

# uname -r // カーネルのバージョンの確認方法

2.4.27-0vl7

# apt-get install kernel

(気が小さい自分は初め、# apt-get install -s kernel と-sを付けてシュミレーション?してから実行しました。)


apache2

apache1.3*からapache2.0へアップグレード

# apt-get update

# apt-get install apache2

/etc/apache2/conf/httpd.confの編集

変更した箇所は・・・

ServerName 192.168.1.100:80 // サーバのIPアドレス(外部公開用ではないのでDNSは不使用)

# AddDefaultCharset ISO-8859-1 // コメントにする

// 以下、お好み設定

DocumentRoot "/home/httpd/html"

#

# This should be changed to whatever you set DocumentRoot to.

#

<Directory "/home/httpd/html"> // DocumentRootと同じ場所を指定

UserDir www // public_htmlより変更(お好み)

DirectoryIndex index.html index.php /cgi-bin/index.pl // お好みで

ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

<Directory "/home/httpd/cgi-bin">

(略)

< Directory>

コンソールに移り・・・

# service httpd stop // apache1.3が起動していたら

# service apache2 restart

各ユーザーのトップディレクトリで・・・

$ mkdir www

$ chmod 755 www


自動時刻合わせ(ntp)

# apt-get update

# apt-get install ntp

/etc/ntp.conf の編集

#server 127.127.1.0

# local clock

#fudge 127.127.1.0 stratum 10

server clock.nc.fukuoka-u.ac.jp

コンソールに移り・・・

#/etc/rc.d/init.d/ntpd start // サーバ起動

#chkconfig ntpd on // 次回より自動起動


PHP

php4からphp5へアップグレード

# apt-get install php5

/etc/php.iniの編集

// 自分の環境(クライアントはMacとWin)ではShift_JISで編集するので以下を修正

mbstring.internal_encoding = SJIS

mbstring.http_output = SJIS

# service apache2 restart

pearのインストール

# apt-get install php5-pear

再び/etc/php.iniの編集

include_pathへ「:/usr/share/php5-pear」を追加

コマンド

#pear search XXXX (XXXXは例えばXML_RSSなど)

#pear install -a XXXX (-aは依存関係もインストールしてくれる)

#pear list

#pear list-all

#pear upgrade-all



途中、Warningが表示されたのでメッセージ通りに以下のコマンドを実行

#pear channel-update pear.php.net


mysql インストール

# apt-get install MySQL-server MySQL-client

# apt-get install php5-mysql

設定はまた後ほど・・・。

netatalk

インストール

#atp-get install netatalk

設定

#/etc/netatalk/AppleVolumes.defaultファイルの最後へ共有フォルダの設定を追加
/var/samba/public public  (←共有ディレクトリ 共有名)
#/etc/rc.d/init.d/atalk restart

webdav

こちらのサイトを参照
してインストール。

/etc/apache2/conf/httpd.confの編集

ファイルの一番最後に以下を追加した。

Alias /webdav "/home/httpd/html/webdav"

<Location /webdav>

Allowoverride All

Options +ExecCGI

DAV on

</Location>

電源ボタンでPower OFF

#vi /etc/acpi/events/power

記述

event=button.power.*

action=/sbin/poweroff


rarインストール

RARLABの「 UnRAR source」より最新版(2007/12/17現在ではunrarsrc-3.7.8.tar.gz)を取得する。

unrarsrc-3.7.8.tar.gzを~/src/.へコピーする。

$cd ~/src

$tar zxvf unrarsrc-3.7.8.tar.gz

$cd unrar

$mv makefile.unix makefile

$make clean

$make

コンパイルが完了するとunrarというバイナリーが作成されている。

$sudo cp unrar /usr/bin./

コマンド

$unrar x hogehoge.rar
で解凍が始まる。


fortune設定

ログイン時に一言コメントしてくれるfortuneを設定した。

#apt-get install fortune-modをするとすでにインストールされていると言う事なのでインストールは無し。

インストール先を調べてみると・・・

$which fortune

/usr/bin/fortune
ということなので

$cd ~

$emacs .bash_profile

末にでも以下を記述

if [ $SHLVL = 1 ]; then

if [ -x /usr/bin/fortune ]; then

/usr/bin/fortune

fi

fi
$source ~/.bash_profile


# ####
# ### At Bat Web Studio 出水ベースのWeb屋
# ## サイバーまめカン ストックメディア
# #