Linux change directory storage location (visit www.baidu.com to create a web page for yourself)

Visit www.baidu.com to create a web page for yourself

umount /dev/sda5-take the mount of saa5
umount /dev/sda6
Df-h
Insert picture description here

pvcreate /dev/
sda5 creates a pv type sda5 pvcreate /dev/sda6 creates a pv type sda6

Pvs ——Check whether the creation is successful. (Pvdisplay is also for viewing)
Insert picture description here

vgcreate vg1 /dev/sda5 /dev/sda6-change the pv type to the vg type and name it vg1
Vgs

 lvcreate -n lv1 -L 10G vg1——改成lv型10G大小

Lvs
Insert picture description here

mkfs.xfs /dev/vg1/lv1-format lv1Insert picture description here

mount /dev/vg1/lv1 /data/www-mount the directory

df -h——查看挂载是否成功
 ll /etc/httpd/conf/httpd.conf 

vim vhost.conf (content)
content: (white is the IP address of my own virtual machine, if you don’t know, you can check it with IP a, the domain name is www.baidu.com)
[root@localhost conf.d]# cat vhost.conf
<Directory /data/www>
AllowOverride none
Require all granted

<virtualhost 192.168.170.136:80>
servername www.baidu.com
documentroot /data/www

Insert picture description here

  echo "你好,很高兴认识你" > /data/www/index.html  写一些内容进入网页.

 getenforce ——查看状态
setenforce 0——关闭SELinux
 getenforce 

Insert picture description here

(Method 2) vim /etc/selinux/config-or modify SELinux
systemctl restart httpd under config- start httpd service.
Insert picture description here

The following modify the computer's local cache
path: C:/windiws/System32/drivers/etc/hosts
Insert picture description here

Need to use Notepad++ (you can download it online)Insert picture description here

The result is shown in the figureInsert picture description here

Guess you like

Origin blog.csdn.net/weixin_47514459/article/details/108920242