ミナログ´ω`)ノ

やりたい事とか ・RAID ・LPIC-201 ・自転車を買う(買っちゃった~) ・サイト作成

2009年8月27日木曜日

キューのメールを削除する

消していいかちゃんと確認しおろ


postfix

postmaster -d ALL





sendmail

rm -f /var/spool/mqueue

You must add a global ddns-update-style statement to /etc/dhcpd.conf.

You must add a global ddns-update-style statement to /etc/dhcpd.conf.

そのまんまですが、

ddns-update-style

を追加しろよと。


これはDNSに向けてDynamic DNSの更新を要求するかどうかを決めるステートメント。

ddns-update-style interim; ← DNS更新を要求
ddns-update-style add-hoc; ← DNS更新を要求しない。
ddns-update-style none; ← DDNSを使用しない。

NFSの構築と実現

立ち上げておくサービス

クライアント
・portmap

サーバ
・portmap
・nfsd
・mountd ← nfsdを起動するときに一緒に立ちあがるっぽい。





設定
192.168.0.0/24にだけ/tmpをnfsで読み書き可能で公開する場合の設定。

vi /etc/exports
エクスポートするパス 公開するクライアント/ネットマスク(オプション)
/tmp 192.168.0.0/255.255.255.0(rw)


オプションに関しては下記の通り
・ro…読み込み専用
・rw…読み書き可能
・no_root_squash…rootでアクセス時、root権限で実行
・root_squash…rootでアクセス時、匿名アカウント権限で実行
・all_squash…すべてのアクセスを匿名アカウント権限で実行





/etc/exportsの設定を有効にする
exportfs -a

-a…すべてのディレクトリをエクスポートする
-au…全てのディレクトリをアンエクスポートする
-r…すべてのディレクトリを再エクスポートする
-v…詳細表示





エクスポートされているディレクトリを調べるにはshowmountコマンドを使用する
showmount

-a…ホスト名とエクスポートしているディレクトリを表示
-e…指定したホスト名でエクスポートしてるディレクトリを表示






マウントする
nfsmountはもう使えない。ので、

mount -t nfs 192.168.100.1:/tmp /tmp/nfs





mountオプション
bg…マウントに失敗してもバックグラウンドで試行し続ける
fg…フォアグラウンドで実行し続ける
soft…ソフトマウント
hard…ハードマウント
initr…ハードマウント時割り込み許可
retrans…ソフトマウント時再試行回数
nolock…ファイルロックしない
rsize…読み取りブロックサイズ
wsize…書き込みサイズ

2009年8月26日水曜日

-bash: smbmount: command not found

-bash: smbmount: command not found


smbmountが
sambaを入れても、smbclientを入れても無い…?




smbmountはなくなったそうです。
http://www.ivoryworks.com/blog/2009/05/cifsmountcifswindows.php




代わりは、mountで。

2009年8月25日火曜日

独自認証局を立てた時にエラー

Using configuration from /etc/pki/tls/openssl.cnf
Enter pass phrase for ./demoCA/private/./cakey.pem:
I am unable to access the ../../demoCA/newcerts directory
../../demoCA/newcerts: No such file or directory


とか


Using configuration from /etc/pki/tls/openssl.cnf
Enter pass phrase for ./demoCA/private/./cakey.pem:
I am unable to access the ../../CA/newcerts directory
../../CA/newcerts: No such file or directory



って言われたら、



/etc/pki/tls/openssl.conf

の45行目の




dir = ../../demoCA # Where everything is kept









dir = ./demoCA # Where everything is kept





に変更

2009年8月21日金曜日

UserDirの設定

UserDirで超はまった。

つぼに来たわけではないのだ。
わからなくて、罠から抜け出せなかったのだ。

二度とそうならないように、手順を残す。


環境:CentOS5.3。Apache2.2.3-22.el5
今回は「hoge」というユーザの場所(/home/hoge)でやるとします。
基本はrootユーザで作業をしていきます。



0.基本として、hogeユーザを追加しておくこと。パーミッションも変更。
useradd hoge
passwd hoge
chmod 711 /homge/hoge



1./home/hogeにpublic_htmlディレクトリを作成する。
su hoge
mkdir /home/hoge/public_html
exit






2./home/hoge/public_htmlに、index.htmlを作成
vi /home/hoge/public_html/index.html
#index.htmlの中は適当に。







3.httpd.confを編集
vi /etc/httpd/conf/httpd.conf
-------
<IfModule mod_userdir.c>
#
# UserDir is disabled by default since it can confirm the presence
# of a username on the system (depending on home directory
# permissions).
#
#UserDir disabled              ←☆この部分をコメントアウト
UserDir enabled hoge             ←☆この部分を追加

#
# To enable requests to /~user/ to serve the user's public_html
# directory, remove the "UserDir disable" line above, and uncomment
# the following line instead:
#
UserDir public_html          ←☆この部分を追加

</IfModule>
<Directory /home/*/public_html>         ←☆ここから
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>                    ←☆ここまで新規に追加








4.httpdをrestart
service httpd restart







5.ブラウザから確認。下記のアドレスをブラウザに打ち込めば、あなたが用意した/home/hoge/public_html/index.htmlが表示されるはず。
http://サーバのIP/~hoge/








6.アクセスできなければ、/var/log/httpd/error_logを確認


・File does not exist /var/www/html/hoge が出ていたら、そもそも根本的になにか間違っている
・(13)Permission denied: access to /~negishi hoge の場合、7以降を行ってみる必要がある。










7./home/hoge/パーミッションの確認する。
その他のユーザに
ディレクトリだと、実行権限、
index.htmlだと読み取り権限が必要。

#要はこんな感じなんだわ。
/home          ←drwxr-xr-x
/home/hoge         ←drwx--x--x
/home/hoge/httpd      ←drwx--x--x
/home/hoge/httpd/error_log ←drwxr--r--


問題なさそうなら、ブラウザで確認。





7.それでも表示されない場合。SELinuxの停止
system-config-securitylevel-tui
SELinux:Enforceing
    Permissive
    無効       ←選択


それでもう一回ブラウザで確認してみて。




7.それでも表示されない場合。下記の秘密の呪文を唱える。(SELinux関連のコマンド)
fixfiles restore



もう一回確認してみて。




それでもダメなら、私にはわからん。

2009年8月14日金曜日

わかんなかったとこLPIC2勉強

テンションが低いです。
なんでですかね?金曜?
隣の亀が暴れています。。。



hdparm
 →-i…詳細情報表示
 →-t…バッファキャッシュを使わず読み込み書き込みテスト
 →-T…読み込み書き込みテスト
 →-c…32ビットI/Oサポート
 →-d…DMAモード


/proc/partitions
 ・ファイルシステムの割り当てを確認



/proc/bus/usb/devices
 ・usbデバイス情報を表示

vgchange
 ・-a…アクティブを非アクティブにする

arp
 ・-a…すべて表示 
 ・-s…arpテーブルに設定
 ・-d…delete
 ・-i…interface

allow-transefar
 ・スレーブサーバのIP

フォロワー

ブログ アーカイブ