Lampp域名及二级域名配置方法

1、可以在apache的http.conf或httpd-vhosts.conf中配置,不过建议在httpd-vhosts.conf中配置

2、配置实例

#如果需要IP来访问服务,需配置这
DocumentRoot /opt/apache/www ServerName 222.212.33.22

#主域名 #ServerAdmin [email protected] DocumentRoot /opt/apache/www ServerName www.abc.cn #ErrorLog "logs/www.abc.cn-error_log" #CustomLog "logs/www.abc.cn-access_log" common
    #DirectoryIndex index.html index.htm index.php

#二级域名

    #ServerAdmin [email protected]
    DocumentRoot /opt/apache/www/blog
    ServerName  blog
    ServerAlias blog.abc.cn  
#ErrorLog "logs/blog.abc.cn-error_log" #CustomLog "logs/blog.abc.cn-access_log" common
#DirectoryIndex index.html index.htm index.php
 
  
 
  


你可能感兴趣的:(嵌入式开发/Linux)