apache虚拟主机配置

httpd.conf文件中配置一台www.sohu.cn的虚拟主机,而后在window系统中注册www.sohu.cn这台主机。php

 

 httpd.conf 文件中启用 httpd-vhosts.confhtml

就是把#注销掉web

# Virtual hosts ,虚拟主机windows

Include conf/extra/httpd-vhosts.confide

 

 假设咱们的虚拟主机在 f:/myweb 盘 [该站点,事先有]spa

 设置http-vhosts.conf文件htm

#配置咱们本身的虚拟主机blog

<VirtualHost127.0.0.1:80>ip

    DocumentRoot "d:/myblog"get

    #这里配置欢迎首页面

    DirectoryIndex index.html index.htmindex.php

    <Directory />

    Options FollowSymLinks

    #不准可别人修改咱们的页面

    AllowOverride None

    #设置访问权限

    Order allow,deny

    Allow from all

    </Directory>

</VirtualHost>

4. hosts文件中添加咱们的ip 和主机映射关系

 

c:/windows/system32/drivers/etc/hosts

 

127.0.0.1             www.sohu.cn

相关文章
相关标签/搜索