1. 修改Apache配置文件
打开Apache的配置文件,/etc/apache2/sites-enabled/000-default.conf
在文件底部添加以下内容
<VirtualHost *:8080>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/phpmyadmin
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
2. 添加监听端口
打开Apache端口配置文件,/etc/apache2/ports.conf
添加需要监听的端口
Listen 80
Listen 8084
3. 测试
通过访问http://127.0.0.1:8080即可访问新的虚拟站点
网友评论