WWW
WWW是World Wide Web(环球信息网)的缩写,经常表述为Web、3W或W3,中文名字为“万维网”
WWW通过“超文本传输协议”(HTTP,HyperText Tarnsfer Protocol)向用户提供多媒体信息,这些信息的基本单位是网页,每一个网页可包含文字、图像、动画、声音、视频等多种信息。
采用“统一资源定位符”(URL Uniform Resource Locator)来唯一标识和定位网页信息,通用的URL描述格式为:
信息服务类型://信息资源地址[:端口号]/路径名/文件名
WWW的工作原理
WWW服务系统由Web服务器、客户端浏览器和通信协议三个部分组成
磁盘配置
添加80GB的磁盘。
# fdisk -l
Disk /dev/sda: 21.5 GB, 21474836480 bytes,41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes /512 bytes
I/O size (minimum/optimal): 512 bytes / 512bytes
Disk label type: dos
Disk identifier: 0x00012974
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 1026047 512000 83 Linux
/dev/sda2 1026048 41943039 20458496 8e Linux LVM
Disk /dev/mapper/centos-swap: 2147 MB,2147483648 bytes, 4194304 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes /512 bytes
I/O size (minimum/optimal): 512 bytes / 512bytes
Disk /dev/mapper/centos-root: 18.8 GB,18798870528 bytes, 36716544 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes /512 bytes
I/O size (minimum/optimal): 512 bytes / 512bytes
没有到新的磁盘
# echo "- - -" >/sys/class/scsi_host/host0/scan
# echo "- - -" >/sys/class/scsi_host/host1/scan
# echo "- - -" > /sys/class/scsi_host/host2/scan
# fdisk -l
Disk /dev/sda: 42.9 GB, 42949672960 bytes,83886080 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes /512 bytes
I/O size (minimum/optimal): 512 bytes / 512bytes
Disk label type: dos
Disk identifier: 0x0003747c
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 1026047 512000 83 Linux
/dev/sda2 1026048 83886079 41430016 8e Linux LVM
Disk /dev/sdb: 85.9 GB, 85899345920 bytes,167772160 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes /512 bytes
I/O size (minimum/optimal): 512 bytes / 512bytes
可以看到/dev/sdb
LVM配置
创建一个分区
# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, untilyou decide to write them.
Be careful before using the write command.
Device does not contain a recognizedpartition table
Building a new DOS disklabel with diskidentifier 0xf390d7bf.
Command (m for help): n
Partition type:
p primary (0 primary, 0extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1):
First sector (2048-167772159, default2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G}(2048-167772159, default 167772159):
Using default value 167772159
Partition 1 of type Linux and of size 80GiB is set
Command (m for help): p
Disk /dev/sdb: 85.9 GB, 85899345920 bytes,167772160 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes /512 bytes
I/O size (minimum/optimal): 512 bytes / 512bytes
Disk label type: dos
Disk identifier: 0xf390d7bf
Device Boot Start End Blocks Id System
/dev/sdb1 2048 167772159 83885056 83 Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
创建pv
# pvscan
PV/dev/sda2 VG centos_zzsrv1 lvm2 [39.51 GiB / 0 free]
Total: 1 [39.51 GiB] / in use: 1 [39.51 GiB] / in no VG: 0 [0 ]
# pvcreate /dev/sdb1
Physical volume "/dev/sdb1" successfully created
# pvscan
PV/dev/sda2 VG centos_zzsrv1 lvm2 [39.51 GiB / 0 free]
PV/dev/sdb1 lvm2[80.00 GiB]
Total: 2 [119.51 GiB] / in use: 1 [39.51 GiB] / in no VG: 1 [80.00 GiB]
创建VG
# vgscan
Reading all physical volumes. This may take a while...
Found volume group "centos_zzsrv1" using metadata type lvm2
# vgcreate DATAVG /dev/sdb1
Volume group "DATAVG" successfully created
# vgscan
Reading all physical volumes. This may take a while...
Found volume group "centos_zzsrv1" using metadata type lvm2
Found volume group "DATAVG" using metadata type lvm2
# vgdisplay DATAVG
---Volume group ---
VGName DATAVG
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 1
VGAccess read/write
VGStatus resizable
MAXLV 0
CurLV 0
Open LV 0
MaxPV 0
CurPV 1
ActPV 1
VGSize 80.00 GiB
PESize 4.00 MiB
Total PE 20479
Alloc PE / Size 0 / 0
Free PE / Size 20479 / 80.00 GiB
VGUUID RwFWG8-ZGj9-I8xJ-yxcc-hsO1-8do9-8QcgrZ
创建一个LV,使用VG的全部PE
# lvscan
ACTIVE '/dev/centos_zzsrv1/swap' [2.03 GiB] inherit
ACTIVE '/dev/centos_zzsrv1/root' [37.48 GiB] inherit
# lvcreate -n LV1 -l 20479 DATAVG
Logical volume "LV1" created
# lvscan
ACTIVE '/dev/centos_zzsrv1/swap' [2.03 GiB] inherit
ACTIVE '/dev/centos_zzsrv1/root' [37.48 GiB] inherit
ACTIVE '/dev/DATAVG/LV1' [80.00 GiB] inherit
# lvdisplay /dev/DATAVG/LV1
---Logical volume ---
LVPath /dev/DATAVG/LV1
LVName LV1
VGName DATAVG
LVUUID Jl7Otp-cYTx-0CgS-0z3d-0f3n-cjUn-yjgiVU
LVWrite Access read/write
LVCreation host, time ZZSRV1.localdomain, 2014-08-16 16:08:35 +0800
LVStatus available
#open 0
LVSize 80.00 GiB
Current LE 20479
Segments 1
Allocation inherit
Read ahead sectors auto
-currently set to 8192
Block device 253:2
# vgdisplay DATAVG
---Volume group ---
VGName DATAVG
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 2
VGAccess read/write
VGStatus resizable
MAXLV 0
CurLV 1
Open LV 0
MaxPV 0
CurPV 1
ActPV 1
VGSize 80.00 GiB
PESize 4.00 MiB
Total PE 20479
Alloc PE / Size 20479 /80.00 GiB
Free PE / Size 0 / 0
VGUUID RwFWG8-ZGj9-I8xJ-yxcc-hsO1-8do9-8QcgrZ
文件系统配置
先格式化LV
# mkfs.ext4 /dev/DATAVG/LV1
创建mount点,设置为自动mount
# mkdir /wwwroot
# vi /etc/fstab
在最后添加如下内容
/dev/DATAVG/LV1 /wwwroot ext4 defaults 0 0
# mount /wwwroot/
# mount
在最后会看到如下内容
/dev/mapper/DATAVG-LV1 on /wwwroot typeext4 (rw,relatime,data=ordered)