1、修改apache配置文件httpd.conf(此文件在apache安装目录下的conf文件内),找到Listen 行,添加需要配置的端口8080 和8888。
Listen 8080
Listen 8888

2、修改配置文件httpd-vhosts.conf,添加端口对应的网站文件目录。
<VirtualHost *:8080>
# ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "E:/PHP/Apache24/htdocs/8080"
<Directory />
Options FollowSymLinks
#AllowOverride None
AllowOverride None
Order allow,deny
Allow from all
</Directory>
ServerName 127.0.0.1:8080
#ServerAlias www.dummy-host.example.com
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>
同理将8080换成8888,并将文件目录修改到对应的网站目录即可

3、最终实现结果

