关于Apache配置虚拟主机后在局域网中让其他电脑访问

#test1#
NameVirtualHost *:80    
    ServerName  www.t1.com
    DocumentRoot "/Users/me/www/test1"    
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
    
#test2#
NameVirtualHost *:80    
    ServerName  www.t2.com
    DocumentRoot "/Users/me/www/test2"    
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
    
#错误显示#
php_flag display_errors        on
php_value error_reporting       2039

如上所示,共配置了2个虚拟主机:

www.t1.com

www.t2.com

如果我本机 的IP地址是:192.168.1.123

那么在 局域网内访问此IP看到的网站就是上面配置中第一个配置的虚拟主机,本案例中就是:www.t1.com

如果想要访问别的虚拟主机,那么只需要把对应的主机放置到最前面即可!

【备注】
Options FollowSymLinks 表示不列出目录下的文件,如果要列出文件列表,则使用  Options Indexes FollowSymLinks

C:\Windows\System32\drivers\etc 目录下  hosts文件中:最后添加一行:127.0.0.1   www.t1.com
Linux 系统下,是在 /etc/hosts 文件中。(本地路由优先!)

最新文章

  1. 立即执行函数: (function(){...})() 与 (function(){...}()) 有什么区别?
  2. 【Logcat】在Android Studio中查看android APP 日志
  3. 使用WinRAR创建可执行程序(例如:Java程序打包 成exe)
  4. javaEE基础
  5. c# 文件遍历
  6. push
  7. HashTable、HashSet和Dictionary的区别
  8. POJ3616 Milking Time 简单DP
  9. 通过web修改svn用户密码
  10. BestCoder Round 59 (HDOJ 5500) Reorder the Books
  11. Intellij idea插入表数据【在UI界面插入出错】
  12. poj 2905 双向队列(待补充)
  13. Easyui Datagrid 修改显示行号列宽度
  14. Python-爬取妹子图(单线程和多线程版本)
  15. Chapter 5 Blood Type——20
  16. 雷林鹏分享:url中加号引发的错误
  17. Delphi7安装
  18. 项目总结之Oauth2.0免登陆及相关知识点总结
  19. Springboot 2.0 - 集成redis
  20. Xcode6 itunes完美打包api 方法

热门文章

  1. AI逻辑实现-取舍行为树还是状态机
  2. There are inconsistent line endings in the 'xxx' script. Some are Mac OS X (UNIX) and some are Windows.问题解决
  3. DeDeCMS织梦的采集教程
  4. VR资源浏览网站
  5. mysql中什么是逻辑备份
  6. mongodb 安装(windows mongodb 安装)
  7. listView解决滑动时黑色背景问题
  8. mybatis由浅入深day01_5mybatis开发dao的方法(5.1SqlSession使用范围_5.2原始dao开发方法)
  9. Redis(二)-- 发布订阅、事务、安全、持久化
  10. Apache nutch1.5 & Apache solr3.6