apache虚拟主机配置

httpd.conf可以添加 Include /etc/httpd/conf/sites-enabled/

创建目录sites-enabled、sites-available.

sites-available里面放的是可用的配置文件,如test.vhost

<VirtualHost 127.0.0.1:80>
    ServerName www.test.com
    DocumentRoot "/home/apache/sites/test"
    ServerAdmin postmaster@gdboluosh.org
 
    ErrorLog logs/test_error_log
    LogLevel warn
    CustomLog logs/test_access_log combined
 
 
<Directory "/home/apache/sites/test">  
    AllowOverride None  
    Options None  
    Order allow,deny  
    Allow from all  
</Directory>  
</VirtualHost>

sites-enabled里的文件是从sites-available里建立超链接过来的.

未经允许不得转载:SuperMan's blog » apache虚拟主机配置

评论 0

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址