假设要配置基于8000端口的虚拟主机
修改httpd.conf
# vim /etc/httpd/conf/httpd.conf
找到Listen 80,在下面添加Listen 8000(提示:在防火墙中打开8000端口)
<VirtualHost *:8000>
ServerAdmin webmaster@123admin.com
DocumentRoot /var/www/html/123admin
ErrorLog logs/123admin.com-error_log
CustomLog logs/123admin.com-access_log combined
DirectoryIndex index.html index.htm index.php
<Directory "/var/www/html/123admin">
Options -Indexes FollowSymLinks
AllowOverride all
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
重启apache
# service httpd reload