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)