Linux下Apache虚拟主机配置
Linux下Apache虚拟主机的三种配置。这样可以实现一台主机架构多个独立域名网站。其中基于域名的最为常见。性价比也最高。下面 PHP程序员雷雪松 详细的讲解下Linux下Apache虚拟主机配置的具体步骤。 1、基于多ip地址的虚拟主机 Listen 80 <VirtualHost 12.34.56.78> DocumentRoot /home/httpd/html1 ServerName www.ok1.com ErrorLog /usr/local/apache/logs/error1_log CustomLog /usr/local/apache/logs/access1_log combined </VirtualHost> <VirtualHost 87.65.43.21> DocumentRoot /home/httpd/html2 ServerName www.ok2.com ErrorLog /usr/local/apache/logs/error2_log CustomLog /usr/local/apache/logs/access2_log combined </VirtualHost> 2、基于多IP 和多端口的虚拟主机配置 Listen 12.34.56.78:80 Listen 12.34.56.78:8080 Listen 87.65.43.21