关闭防火墙
systemctl stop firewalld
在http的子配置目录下创建新的文件进行配置
vim /etc/httpd/conf.d/yqalias.conf
配置详情如下
<VirtualHost 192.168.222.222:80 >
ServerName 192.168.222.222
DocumentRoot /CSDN
alias /pub /CSDN/ftp/pub #alias 你要定义的简写方式 其文件的绝对路径
</Virtualhost>
<Directory /CSDN>
AllowOverride none
Require all granted
</Directory>
进入/CSDN目录
cd /CSDN
创建目录
mkdir -p ./ftp/pub
将任意东西写进index.html
echo "pub" > ./ftp/pub/index.html
重启http
systemctl restart httpd
在浏览器用如下方式进行访问