首先需要修改根目录权限为如下所示
<Directory />
AllowOverride none
Require all granted
</Directory>
然后在httpd.conf末尾添加如下配置即可
Listen 8001

<VirtualHost *:8001>
ServerAdmin xtiqin@163.com
DocumentRoot /opt/lampp/static
ServerName yunp.top:8001
<Directory "/opt/lampp/static">
Options All
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>