一,安装软件
[root@1 ~]# yum install httpd* -y
[root@1 ~]# systemctl start httpd
[root@1 ~]# setenforce 0 //关闭SELinux, 0是关,1是开
二,设置虚拟目录
创建真实目录 /t ,并在目录下放入网页文件index.html
1.写入
[root@1 ~]# mkdir /t && cd /t
[root@1 t]# echo "qq">index.html
- 修改配置
[root@1 conf.d]# vim /etc/httpd/conf/httpd.conf
追加内容:
ps:(G到最后一行,gg到第一行)
Alias /b "/t" //b是虚拟目录,t是真实目录,虚拟目录是真是目录的一个别名
<Directory "/t"> //设置真实目录访问权限
Require all