apache perl の動作確認
参考サイト
FC4/SELinux/動作モード確認・変更と起動時の設定 - Pocketstudio.jp Linux Wiki
http://honana.com/fedora_core_6_setup
自分自身からはwget でページを取得できるのですが、他のサーバからは" 接続を拒否されました"と出て接続できない。
やっぱりFireWall関係かな?と思い調べた結果、以下のようにSeLinuxとIPTablesを停止することで接続できるようになりました。
最初にSeLinuxを止めたのですが、もしかしたらIPTablesだけで良かったのかも知れません。
SELinuxを無効化
# getenforce Enforcing <=★ # vi /etc/selinux/config #SELINUX=enforcing SELINUX=disabled サーバ再起動 # getenforce Disabled <=★
ファイアーウォールの停止
# service iptables status テーブル: filter Chain INPUT (policy ACCEPT) num target prot opt source destination 1 RH-Firewall-1-INPUT all -- 0.0.0.0/0 0.0.0.0/0 Chain FORWARD (policy ACCEPT) num target prot opt source destination 1 RH-Firewall-1-INPUT all -- 0.0.0.0/0 0.0.0.0/0 Chain OUTPUT (policy ACCEPT) num target prot opt source destination Chain RH-Firewall-1-INPUT (2 references) num target prot opt source destination 1 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 2 ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0 icmp type 255 3 ACCEPT esp -- 0.0.0.0/0 0.0.0.0/0 4 ACCEPT ah -- 0.0.0.0/0 0.0.0.0/0 5 ACCEPT udp -- 0.0.0.0/0 224.0.0.251 udp dpt:5353 6 ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:631 7 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:631 8 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED 9 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22 10 REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited # service iptables stop ファイアウォールルールを適用中: [ OK ] チェインポリシーを ACCEPT に設定中filter [ OK ] iptables モジュールを取り外し中 [ OK ] # service iptables status ファイアウォールは停止
訳あってPerl始めます
参考サイト
Perl - Wikipedia
Vim - Wikipedia
welcome home : vim online
http://ichikoro.com/webp/bk/00039.html
apache に mod_perl を組み込む|perl|@OMAKASE
訳あってPerlを始めます。"今更"なんていつになっても無いのです。
とりあえずエディタとしてvimを使いましょう。
Linux機は今VM上にFedora6を入れているのでそれを使おうと思います。
まずは準備です。
Apacheのインストール
# yum install httpd Loading "installonlyn" plugin Setting up Install Process Setting up repositories core 100% |=========================| 1.1 kB 00:00 extras 100% |=========================| 1.1 kB 00:00 updates 100% |=========================| 1.2 kB 00:00 Reading repository metadata in from local files Parsing package install arguments Resolving Dependencies --> Populating transaction set with selected packages. Please wait. ---> Downloading header for httpd to pack into transaction set. httpd-2.2.4-2.1.fc6.i386. 100% |=========================| 54 kB 00:01 ---> Package httpd.i386 0:2.2.4-2.1.fc6 set to be updated --> Running transaction check --> Processing Dependency: libaprutil-1.so.0 for package: httpd --> Processing Dependency: libapr-1.so.0 for package: httpd --> Restarting Dependency Resolution with new changes. --> Populating transaction set with selected packages. Please wait. ---> Downloading header for apr to pack into transaction set. apr-1.2.7-10.i386.rpm 100% |=========================| 10 kB 00:00 ---> Package apr.i386 0:1.2.7-10 set to be updated ---> Downloading header for apr-util to pack into transaction set. apr-util-1.2.8-1.fc6.i386 100% |=========================| 7.3 kB 00:00 ---> Package apr-util.i386 0:1.2.8-1.fc6 set to be updated --> Running transaction check --> Processing Dependency: libpq.so.4 for package: apr-util --> Restarting Dependency Resolution with new changes. --> Populating transaction set with selected packages. Please wait. ---> Downloading header for postgresql-libs to pack into transaction set. postgresql-libs-8.1.9-1.f 100% |=========================| 16 kB 00:00 ---> Package postgresql-libs.i386 0:8.1.9-1.fc6 set to be updated --> Running transaction check Dependencies Resolved ============================================================================= Package Arch Version Repository Size ============================================================================= Installing: httpd i386 2.2.4-2.1.fc6 updates 1.1 M Installing for dependencies: apr i386 1.2.7-10 core 123 k apr-util i386 1.2.8-1.fc6 updates 77 k postgresql-libs i386 8.1.9-1.fc6 updates 196 k Transaction Summary ============================================================================= Install 4 Package(s) Update 0 Package(s) Remove 0 Package(s) Total download size: 1.5 M Is this ok [y/N]: y Downloading Packages: (1/4): apr-1.2.7-10.i386. 100% |=========================| 123 kB 00:00 (2/4): httpd-2.2.4-2.1.fc 100% |=========================| 1.1 MB 00:27 (3/4): postgresql-libs-8. 100% |=========================| 196 kB 00:04 (4/4): apr-util-1.2.8-1.f 100% |=========================| 77 kB 00:01 warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2 Importing GPG key 0x4F2A6FD2 "Fedora Project <fedora@redhat.com>" Is this ok [y/N]: y Importing GPG key 0xDB42A60E "Red Hat, Inc <security@redhat.com>" Is this ok [y/N]: y Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing: apr ######################### [1/4] Installing: postgresql-libs ######################### [2/4] Installing: apr-util ######################### [3/4] Installing: httpd ######################### [4/4] Installed: httpd.i386 0:2.2.4-2.1.fc6 Dependency Installed: apr.i386 0:1.2.7-10 apr-util.i386 0:1.2.8-1.fc6 postgresql-libs.i386 0:8.1.9-1.fc6 Complete!
DSO対応か確認する。(mod_so.cがリストされればOK)
# httpd -l Compiled in modules: core.c prefork.c http_core.c mod_so.c
mod_perlのインストール
# yum install mod_perl Loading "installonlyn" plugin Setting up Install Process Setting up repositories Reading repository metadata in from local files Parsing package install arguments Resolving Dependencies --> Populating transaction set with selected packages. Please wait. ---> Downloading header for mod_perl to pack into transaction set. mod_perl-2.0.2-6.2.fc6.i3 100% |=========================| 87 kB 00:01 ---> Package mod_perl.i386 0:2.0.2-6.2.fc6 set to be updated --> Running transaction check --> Processing Dependency: perl(BSD::Resource) for package: mod_perl --> Restarting Dependency Resolution with new changes. --> Populating transaction set with selected packages. Please wait. ---> Downloading header for perl-BSD-Resource to pack into transaction set. perl-BSD-Resource-1.28-1. 100% |=========================| 7.1 kB 00:00 ---> Package perl-BSD-Resource.i386 0:1.28-1.fc6.1 set to be updated --> Running transaction check Dependencies Resolved ============================================================================= Package Arch Version Repository Size ============================================================================= Installing: mod_perl i386 2.0.2-6.2.fc6 updates 4.0 M Installing for dependencies: perl-BSD-Resource i386 1.28-1.fc6.1 core 29 k Transaction Summary ============================================================================= Install 2 Package(s) Update 0 Package(s) Remove 0 Package(s) Total download size: 4.0 M Is this ok [y/N]: y Downloading Packages: (1/2): perl-BSD-Resource- 100% |=========================| 29 kB 00:00 (2/2): mod_perl-2.0.2-6.2 100% |=========================| 4.0 MB 00:34 Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing: perl-BSD-Resource ######################### [1/2] Installing: mod_perl ######################### [2/2] Installed: mod_perl.i386 0:2.0.2-6.2.fc6 Dependency Installed: perl-BSD-Resource.i386 0:1.28-1.fc6.1 Complete!
確認
http://
例のあのページが出ない。
調査報告は明日
LVM:VolumeGroup(VG)からLogicalVolume(LV)を作成する
関連サイト
VirtualMachineにディスクを追加する - 明日=今日×(反省+前向き)+努力
http://d.hatena.ne.jp/oragoku/20070725/1185458278
LVM:PVをVolumeGroupに追加する - 明日=今日×(反省+前向き)+努力
参考サイト
エンタープライズ:特集:LVMによるディスクパーティションの動的化(前編) (1/7)
ITmedia エンタープライズ:特集:LVMによるディスクパーティションの動的化(後編) (1/5)
すぱなび日誌: LVM on Linux
VGから、新たにLV(LogicalVolume)を作成します。
# lvcreate -L 10G -n LogVol02 VolGroup00 Logical volume "LogVol02" created # vgdisplay -v VolGroup00 Using volume group(s) on command line Finding volume group "VolGroup00" --- Volume group --- VG Name VolGroup00 System ID Format lvm2 Metadata Areas 2 Metadata Sequence No 11 VG Access read/write VG Status resizable MAX LV 0 Cur LV 3 Open LV 2 Max PV 0 Cur PV 2 Act PV 2 VG Size 11.84 GB PE Size 32.00 MB Total PE 379 Alloc PE / Size 376 / 11.75 GB Free PE / Size 3 / 96.00 MB VG UUID Zu2VS4-NsiV-o4ya-2F0b-Gqle-DyZj-cFJkCQ --- Logical volume --- LV Name /dev/VolGroup00/LogVol00 VG Name VolGroup00 LV UUID M6nCVf-ySlu-FDId-m1m9-m1yz-5jsb-0DSTj0 LV Write Access read/write LV Status available # open 1 LV Size 1.25 GB Current LE 40 Segments 1 Allocation inherit Read ahead sectors 0 Block device 253:0 --- Logical volume --- LV Name /dev/VolGroup00/LogVol01 VG Name VolGroup00 LV UUID 4NPofz-gdBy-6DQo-7ybj-VKdQ-kbU4-poXa1R LV Write Access read/write LV Status available # open 1 LV Size 512.00 MB Current LE 16 Segments 1 Allocation inherit Read ahead sectors 0 Block device 253:1 --- Logical volume --- LV Name /dev/VolGroup00/LogVol02 VG Name VolGroup00 LV UUID LmPi13-COWX-vTue-72g1-BqXT-QyMb-2Xv5L8 LV Write Access read/write LV Status available # open 0 LV Size 10.00 GB Current LE 320 Segments 2 Allocation inherit Read ahead sectors 0 Block device 253:2 --- Physical volumes --- PV Name /dev/sda2 PV UUID 5TPYV3-3lJm-VzAG-H8WJ-mhIX-Oy0S-79vPNJ PV Status allocatable Total PE / Free PE 60 / 3 PV Name /dev/sdb1 PV UUID uaDeVG-et1x-hTMH-rC5p-GmrX-EF7f-9d2Zyt PV Status allocatable Total PE / Free PE 319 / 0 # ll /dev/VolGroup00/ 合計 0 lrwxrwxrwx 1 root root 31 7月 27 08:33 LogVol00 -> /dev/mapper/VolGroup00-LogVol00 lrwxrwxrwx 1 root root 31 7月 27 08:33 LogVol01 -> /dev/mapper/VolGroup00-LogVol01 lrwxrwxrwx 1 root root 31 7月 27 08:43 LogVol02 -> /dev/mapper/VolGroup00-LogVol02
ファイルシステムをフォーマットします
# mkfs.ext3 -j /dev/VolGroup00/LogVol02 mke2fs 1.38 (30-Jun-2005) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) 1310720 inodes, 2621440 blocks 131072 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=2684354560 80 block groups 32768 blocks per group, 32768 fragments per group 16384 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632 Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 36 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override.
マウントします
# mount /dev/VolGroup00/LogVol02 /opt/ # df Filesystem 1K-ブロック 使用 使用可 使用% マウント位置 /dev/mapper/VolGroup00-LogVol00 1269632 1150900 53196 96% / /dev/sda1 101086 9967 85900 11% /boot tmpfs 63124 0 63124 0% /dev/shm /dev/mapper/VolGroup00-LogVol02 10321208 154236 9642684 2% /opt
起動時に自動的にマウントできるように/etc/fstabを編集します
# vi /etc/fstab /dev/VolGroup00/LogVol02 /opt ext3 defaults 1 2
起動時に自動マウントはできましたが、/(root)パーティションが1.2GBしか無く空き容量もほとんどありません。
LV"VolGroup00-LogVol00"を増やす事はできるのですが、その後でファイルシステムを拡張するのが大変そうだったので、今回は再インストールする事にしました。
/rootパーティションの初期設計は慎重に行っておく必要がありますね。
# df Filesystem 1K-ブロック 使用 使用可 使用% マウント位置 /dev/mapper/VolGroup00-LogVol00 1269632 1150932 53164 96% / /dev/sda1 101086 9967 85900 11% /boot tmpfs 63124 0 63124 0% /dev/shm /dev/mapper/VolGroup00-LogVol02 10321208 154236 9642684 2% /opt
以上
LVM:PVをVolumeGroupに追加する
関連エントリ
VirtualMachineにディスクを追加する - 明日=今日×(反省+前向き)+努力
LVM:PhysicalVolumeを定義する - 明日=今日×(反省+前向き)+努力
LVM:VolumeGroup(VG)からLogicalVolume(LV)を作成する - 明日=今日×(反省+前向き)+努力
追加したPV"/dev/sdb1"を既存VGに追加する。
# vgextend VolGroup00 /dev/sdb1 Volume group "VolGroup00" successfully extended # vgdisplay -v VolGroup00 Using volume group(s) on command line Finding volume group "VolGroup00" --- Volume group --- VG Name VolGroup00 System ID Format lvm2 Metadata Areas 2 Metadata Sequence No 4 VG Access read/write VG Status resizable MAX LV 0 Cur LV 2 Open LV 2 Max PV 0 Cur PV 2 Act PV 2 VG Size 11.84 GB <=★VGサイズが増加した PE Size 32.00 MB Total PE 379 Alloc PE / Size 56 / 1.75 GB Free PE / Size 323 / 10.09 GB <=★空きサイズも増えている VG UUID Zu2VS4-NsiV-o4ya-2F0b-Gqle-DyZj-cFJkCQ --- Logical volume --- LV Name /dev/VolGroup00/LogVol00 VG Name VolGroup00 LV UUID M6nCVf-ySlu-FDId-m1m9-m1yz-5jsb-0DSTj0 LV Write Access read/write LV Status available # open 1 LV Size 1.25 GB Current LE 40 Segments 1 Allocation inherit Read ahead sectors 0 Block device 253:0 --- Logical volume --- LV Name /dev/VolGroup00/LogVol01 VG Name VolGroup00 LV UUID 4NPofz-gdBy-6DQo-7ybj-VKdQ-kbU4-poXa1R LV Write Access read/write LV Status available # open 1 LV Size 512.00 MB Current LE 16 Segments 1 Allocation inherit Read ahead sectors 0 Block device 253:1 --- Physical volumes --- PV Name /dev/sda2 PV UUID 5TPYV3-3lJm-VzAG-H8WJ-mhIX-Oy0S-79vPNJ PV Status allocatable Total PE / Free PE 60 / 4 PV Name /dev/sdb1 <=★VGにPV"/dev/sdb1"が追加された PV UUID uaDeVG-et1x-hTMH-rC5p-GmrX-EF7f-9d2Zyt PV Status allocatable Total PE / Free PE 319 / 319
明日は、増加したVGから新たにLogicalVolume(LV)を作成したいと思います。
LVM:PhysicalVolumeを定義する
関連エントリ
VirtualMachineにディスクを追加する - 明日=今日×(反省+前向き)+努力
LVM:PVをVolumeGroupに追加する - 明日=今日×(反省+前向き)+努力
LVM:VolumeGroup(VG)からLogicalVolume(LV)を作成する - 明日=今日×(反省+前向き)+努力
追加したディスクパーティションをPV(Physical Volume)として定義
# pvcreate /dev/sdb1 Physical volume "/dev/sdb1" successfully created
VG(VolumeGroup)の情報を表示
# vgdisplay --- Volume group --- VG Name VolGroup00 <=★VG名 System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 3 VG Access read/write VG Status resizable MAX LV 0 Cur LV 2 Open LV 2 Max PV 0 Cur PV 1 Act PV 1 VG Size 1.88 GB PE Size 32.00 MB Total PE 60 Alloc PE / Size 56 / 1.75 GB Free PE / Size 4 / 128.00 MB VG UUID Zu2VS4-NsiV-o4ya-2F0b-Gqle-DyZj-cFJkCQ # vgdisplay -v VolGroup00 <=★VGの詳細を表示 Using volume group(s) on command line Finding volume group "VolGroup00" --- Volume group --- VG Name VolGroup00 System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 3 VG Access read/write VG Status resizable MAX LV 0 Cur LV 2 Open LV 2 Max PV 0 Cur PV 1 Act PV 1 VG Size 1.88 GB PE Size 32.00 MB Total PE 60 Alloc PE / Size 56 / 1.75 GB Free PE / Size 4 / 128.00 MB VG UUID Zu2VS4-NsiV-o4ya-2F0b-Gqle-DyZj-cFJkCQ --- Logical volume --- LV Name /dev/VolGroup00/LogVol00 <=★VGからLVとしてアサインされている領域 VG Name VolGroup00 LV UUID M6nCVf-ySlu-FDId-m1m9-m1yz-5jsb-0DSTj0 LV Write Access read/write LV Status available # open 1 LV Size 1.25 GB Current LE 40 Segments 1 Allocation inherit Read ahead sectors 0 Block device 253:0 --- Logical volume --- LV Name /dev/VolGroup00/LogVol01 <=★VGからLVとしてアサインされている領域 VG Name VolGroup00 LV UUID 4NPofz-gdBy-6DQo-7ybj-VKdQ-kbU4-poXa1R LV Write Access read/write LV Status available # open 1 LV Size 512.00 MB Current LE 16 Segments 1 Allocation inherit Read ahead sectors 0 Block device 253:1 --- Physical volumes --- PV Name /dev/sda2 <=★VGに含まれているPV ※/dev/sdb1はまだ含まれていない PV UUID 5TPYV3-3lJm-VzAG-H8WJ-mhIX-Oy0S-79vPNJ PV Status allocatable Total PE / Free PE 60 / 4
他の確認
LVの"LogVol01"は、swap領域になっている。デフォルトインストール
# cat /proc/swaps Filename Type Size Used Priority /dev/mapper/VolGroup00-LogVol01 partition 524280 0 -1
明日は、PVをVGに追加したいと思います。
VirtualMachineにディスクを追加する
関連エントリ
LVM:PhysicalVolumeを定義する - 明日=今日×(反省+前向き)+努力
LVM:PVをVolumeGroupに追加する - 明日=今日×(反省+前向き)+努力
LVM:VolumeGroup(VG)からLogicalVolume(LV)を作成する - 明日=今日×(反省+前向き)+努力
FedoraCoreをインストールしたVMware構成でふと?ディスク2GBしか用意していませんでした。しかもデフォルトで作ったからLVMになってる!ディスク追加とLVMの再構成をしてみました。
VMwareにディスクを追加する。
ゲストOSで設定する。
- http://swan.ipc.miyakyo-u.ac.jp/isao/linux/hdd.html
- http://www.linux.or.jp/JF/JFdocs/LVM-HOWTO-3.html#ss3.1
追加した10GBのディスクが確認できます
# fdisk -l Disk /dev/sda: 2147 MB, 2147483648 bytes 255 heads, 63 sectors/track, 261 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 13 104391 83 Linux /dev/sda2 14 261 1992060 8e Linux LVM Disk /dev/sdb: 10.7 GB, 10737418240 bytes <=★追加された 255 heads, 63 sectors/track, 1305 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/sdb doesn't contain a valid partition table
ディスクパーティションを作成
# fdisk /dev/sdb The number of cylinders for this disk is set to 1305. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: 1) software that runs at boot time (e.g., old versions of LILO) 2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK) Command (m for help): n <=★入力 Command action e extended p primary partition (1-4) p <=★入力 Partition number (1-4): 1 <=★入力 First cylinder (1-1305, default 1): <=★空Enter Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-1305, default 1305): <=★空Enter Using default value 1305 Command (m for help): t <=★入力 Selected partition 1 Hex code (type L to list codes): 8e <=★入力 Changed system type of partition 1 to 8e (Linux LVM) Command (m for help): p <=★入力 Disk /dev/sdb: 10.7 GB, 10737418240 bytes 255 heads, 63 sectors/track, 1305 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sdb1 1 1305 10482381 8e Linux LVM <=★LVM用に変更された Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks.
fdiskのオプションは以下の通り
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
明日はLVMの設定を行います。
WindowsXP HomeEditionで自動ログイン設定
OS再インストール そしてこれから・・・ - 明日=今日×(反省+前向き)+努力
VNCを使ってリモート接続する - 明日=今日×(反省+前向き)+努力
WindowsXP HomeEdition にVMwareServerをインストール - 明日=今日×(反省+前向き)+努力
VMWareServerの入っているWinXPHomeEditionのPCを、本当はWakeupOnLan設定にしたかったのだけど。
WakeupOnLanのフリーウェアとか探している内に、そもそも有線じゃないと!って事に気づき、玄箱意外は全部無線LANにしてあるのでダメって事になりました。
電源ボタンは手動で押すことにしたのですが、ログインが面倒くさかったのでユーザ認証無しでログインする設定にしました。
参考サイト:start [yohgaki's wiki]